[Mesa-dev] [PATCH] softpipe: Change faces type to uint

2015-09-12 Thread Krzesimir Nowak
This is to avoid needless float<->int conversions, since all face-related computations are made on integers. Spotted by Emil Velikov. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 10 +- src/gallium/drivers/softpipe/sp_tex_sample.h | 2 +- 2 files changed, 6 insertions(+), 6 deletion

[Mesa-dev] [PATCH] softpipe: Fix faces array type

2015-09-12 Thread Krzesimir Nowak
This is a followup fix from const fixes series. I wasn't entirely sure which type to use - uint or unsigned. Both seem to be used. Used uint - it's shorter. Krzesimir Nowak (1): softpipe: Change faces type to uint src/gallium/drivers/softpipe/sp_tex_sample.c | 10 +- s

Re: [Mesa-dev] [PATCH 1/7] softpipe: Move the faces array from view to filter_args

2015-09-11 Thread Krzesimir Nowak
On Fri, Sep 11, 2015 at 11:57 PM, Emil Velikov wrote: > On 11 September 2015 at 19:07, Krzesimir Nowak > wrote: > > With that, sp_sampler_view instances are not abused anymore as a local > > storage, so we can later make them constant. > > --- > > src/gallium/dr

[Mesa-dev] [PATCH 7/7] softpipe: Constify variables

2015-09-11 Thread Krzesimir Nowak
This commit makes a lot of variables constant - this is basically done by moving the computation to variable definition. Some of them are moved into lower scopes (like in img_filter_2d_ewa). --- src/gallium/drivers/softpipe/sp_tex_sample.c | 441 --- 1 file changed, 199 ins

[Mesa-dev] [PATCH 5/7] softpipe: Constify sampler and view parameters in mip filters

2015-09-11 Thread Krzesimir Nowak
Those functions actually could always take them as constants. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 32 ++-- src/gallium/drivers/softpipe/sp_tex_sample.h | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp

[Mesa-dev] [PATCH 6/7] softpipe: Constify sp_tgsi_sampler

2015-09-11 Thread Krzesimir Nowak
Add a small inline function doing the casting - this is to make sure we don't do a cast from some completely unrelated type. This commit does not make tgsi_sampler parameters const in vfuncs themselves for now - probably llvmpipe would need looking at before making such a change. --- src/gallium/d

[Mesa-dev] [PATCH 3/7] tgsi, softpipe: Constify tgsi_sampler in query_lod vfunc

2015-09-11 Thread Krzesimir Nowak
A followup from previous commit - since all functions called by query_lod take pointers to const sp_sampler_view and const sp_sampler, which are taken from tgsi_sampler subclass, we can the tgsi_sampler as const itself now. --- src/gallium/auxiliary/tgsi/tgsi_exec.h | 2 +- src/gallium/drive

[Mesa-dev] [PATCH 1/7] softpipe: Move the faces array from view to filter_args

2015-09-11 Thread Krzesimir Nowak
With that, sp_sampler_view instances are not abused anymore as a local storage, so we can later make them constant. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 36 +--- src/gallium/drivers/softpipe/sp_tex_sample.h | 4 +--- 2 files changed, 23 insertions(+), 17 dele

[Mesa-dev] [PATCH 2/7] softpipe: Constify some sampler and view parameters

2015-09-11 Thread Krzesimir Nowak
This is to prepare for making tgsi_sampler parameter in query_lod a const too. These functions do not modify anything in either sampler or view anymore. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 51 ++-- src/gallium/drivers/softpipe/sp_tex_sample.h | 4 +-- 2 file

[Mesa-dev] [PATCH 0/7] Const fixes/cleanups in softpipe's tex samplers

2015-09-11 Thread Krzesimir Nowak
ot no regressions. Krzesimir Nowak (7): softpipe: Move the faces array from view to filter_args softpipe: Constify some sampler and view parameters tgsi, softpipe: Constify tgsi_sampler in query_lod vfunc softpipe: Constify sampler and view parameters in img filters softpipe: Constify sampler and

[Mesa-dev] [PATCH 4/7] softpipe: Constify sampler and view parameters in img filters

2015-09-11 Thread Krzesimir Nowak
Those functions actually could always take them as constants. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 68 ++-- src/gallium/drivers/softpipe/sp_tex_sample.h | 4 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_t

Re: [Mesa-dev] [PATCH v2 00/10] Reroll of textureQueryLod in softpipe

2015-09-10 Thread Krzesimir Nowak
On Thu, Sep 10, 2015 at 5:54 PM, Roland Scheidegger wrote: > Am 10.09.2015 um 14:15 schrieb Krzesimir Nowak: > > I tried to address most of the issues and nitpicks you had in previous > > version. Please see updated commit messages to see what has changed. > > > >

[Mesa-dev] [PATCH v2 03/10] softpipe: Split compute_lambda_lod into two functions

2015-09-10 Thread Krzesimir Nowak
textureQueryLod returns a vec2 with a mipmap information and a LOD. The latter needs to be not clamped. v2: - changed the "not_clamped" part to "unclamped" - corrected "clamp into" to "clamp to" - splitted too long lines Reviewed-by: Brian Paul --- src/gallium/drivers/softpipe/sp_tex_samp

[Mesa-dev] [PATCH v2 09/10] softpipe: Implement and enable textureQueryLod

2015-09-10 Thread Krzesimir Nowak
Passes the shader piglit tests and introduces no regressions. This commit finally makes use of the refactoring in previous commits. v2: - adapted the code to changes in previous commits (renames, need_cube_convert stuff) - splitted too long lines Reviewed-by: Brian Paul --- src/gallium

[Mesa-dev] [PATCH v2 01/10] tgsi: Remove trailing backslash in comment

2015-09-10 Thread Krzesimir Nowak
It clearly is here by accident. Reviewed-by: Brian Paul --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 75cd0d5..9544623 100644 --- a/src/gallium/

[Mesa-dev] [PATCH v2 02/10] softpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS value

2015-09-10 Thread Krzesimir Nowak
The level-of-detail bias wasn't simply added in the explicit LOD case. This case seems to be tested only in piglit's fs-texturequerylod-nearest-biased test, which is currently skipped, as softpipe does not support textureQueryLod at the moment. Reviewed-by: Brian Paul --- src/gallium/drivers/sof

[Mesa-dev] [PATCH v2 07/10] softpipe: Add functions for computing relative mipmap level

2015-09-10 Thread Krzesimir Nowak
These functions will be used by textureQueryLod. v2: - renamed mip_level_* funcs to mip_rel_level_* to indicate that these functions return mip level relative to base level and documented them - renamed a level member in sp_filter_funcs struct to relative_level - changed mip_rel_lev

[Mesa-dev] [PATCH v2 05/10] softpipe: Split code getting a filter into separate function

2015-09-10 Thread Krzesimir Nowak
This function will be later used by textureQueryLod. The img_filter_func are optional, because textureQueryLod will not need them. v2: - adapted to changes in previous commit (renames) - simplified conditions a bit - updated docs - splitted too long lines Reviewed-by: Brian Paul --- src

[Mesa-dev] [PATCH v2 08/10] tgsi: Add code for handling lodq opcode

2015-09-10 Thread Krzesimir Nowak
This introduces new vfunc in tgsi_sampler just for this opcode. I decided against extending get_samples vfunc to return the mipmap level and LOD - the function's prototype is already too scary and doing the sampling for textureQueryLod would be a waste of time. v2: - splitted too long lines Rev

[Mesa-dev] [PATCH v2 10/10] docs: Update wrt. textureQueryLod on softpipe

2015-09-10 Thread Krzesimir Nowak
--- docs/GL3.txt | 2 +- docs/relnotes/11.1.0.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/GL3.txt b/docs/GL3.txt index 561f204..8ad1aac 100644 --- a/docs/GL3.txt +++ b/docs/GL3.txt @@ -116,7 +116,7 @@ GL 4.0, GLSL 4.00 --- all DONE: nvc0, radeonsi

[Mesa-dev] [PATCH v2 04/10] softpipe: Put mip_filter_func inside a struct

2015-09-10 Thread Krzesimir Nowak
Putting this function pointer into a struct enables grouping of several related functions in a single place. For now it is just a single function, but the struct will be later extended with a mip_level_func for returning relative mip level. v2: - renamed sp_mip struct to sp_filter_funcs - rena

[Mesa-dev] [PATCH v2 06/10] softpipe: Split 3D to 2D coords conversion into separate function

2015-09-10 Thread Krzesimir Nowak
This is to avoid tying the conversion to the sampling - textureQueryLod will need to do the conversion too, but it does not do any sampling. So instead of a "get_samples" vfunc, there is just a bool saying whether the conversion is needed or not. This solution keeps a nice property of not adding a

[Mesa-dev] [PATCH v2 00/10] Reroll of textureQueryLod in softpipe

2015-09-10 Thread Krzesimir Nowak
I tried to address most of the issues and nitpicks you had in previous version. Please see updated commit messages to see what has changed. I also added another commit updating the release notes and the GL3.txt. Krzesimir Nowak (10): tgsi: Remove trailing backslash in comment softpipe: Fix

Re: [Mesa-dev] [PATCH 9/9] softpipe: Implement and enable textureQueryLod

2015-09-10 Thread Krzesimir Nowak
On Wed, Sep 9, 2015 at 5:26 PM, Brian Paul wrote: > On 09/09/2015 04:35 AM, Krzesimir Nowak wrote: > >> Passes the shader piglit tests and introduces no regressions. >> >> This commit finally makes use of the refactoring in previous >> commits. >> -

Re: [Mesa-dev] [PATCH 8/9] tgsi: Add code for handling lodq opcode

2015-09-10 Thread Krzesimir Nowak
On Wed, Sep 9, 2015 at 5:26 PM, Brian Paul wrote: > On 09/09/2015 04:35 AM, Krzesimir Nowak wrote: > >> This introduces new vfunc in tgsi_sampler just for this opcode. I >> decided against extending get_samples vfunc to return the mipmap level >> and LOD - the function&#x

Re: [Mesa-dev] [PATCH 7/9] softpipe: Add functions for computing mipmap level

2015-09-10 Thread Krzesimir Nowak
On Wed, Sep 9, 2015 at 8:19 PM, Ilia Mirkin wrote: > On Wed, Sep 9, 2015 at 2:17 PM, Roland Scheidegger > wrote: > > Am 09.09.2015 um 12:35 schrieb Krzesimir Nowak: > >> These functions will be used by textureQueryLod. > >> --- > >> src/gallium

[Mesa-dev] [PATCH 5/9] softpipe: Split code getting a filter into separate function

2015-09-09 Thread Krzesimir Nowak
This function will be later used by textureQueryLod. The img_filter_func are optional, because textureQueryLod will not need them. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 53 +++- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/src/gallium/drivers

[Mesa-dev] [PATCH 2/9] softpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS value.

2015-09-09 Thread Krzesimir Nowak
The level-of-detail bias wasn't simply added in the explicit LOD case. This case seems to be tested only in piglit's fs-texturequerylod-nearest-biased test, which is currently skipped, as softpipe does not support textureQueryLod at the moment. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 2

[Mesa-dev] [PATCH 9/9] softpipe: Implement and enable textureQueryLod

2015-09-09 Thread Krzesimir Nowak
Passes the shader piglit tests and introduces no regressions. This commit finally makes use of the refactoring in previous commits. --- src/gallium/drivers/softpipe/sp_screen.c | 2 +- src/gallium/drivers/softpipe/sp_tex_sample.c | 47 +++- 2 files changed, 47 inserti

[Mesa-dev] [PATCH 6/9] softpipe: Split 3D to 2D coords conversion into separate function.

2015-09-09 Thread Krzesimir Nowak
This is to avoid tying the conversion to sampling - textureQueryLod will need to do the conversion too, but it does not do any sampling. So instead of a "sample" vfunc, there is a "convert" vfunc. The drawback of this approach is that a "noop" convert copies 3 arrays of floats. Would be nice to av

[Mesa-dev] [PATCH 4/9] softpipe: Put mip_filter_func inside a struct

2015-09-09 Thread Krzesimir Nowak
Putting this function pointer into a struct enables grouping of several related functions in a single place. For now it is just a single function, but the struct will be later extended with a mip_level_func for returning mip level. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 28

[Mesa-dev] [PATCH 7/9] softpipe: Add functions for computing mipmap level

2015-09-09 Thread Krzesimir Nowak
These functions will be used by textureQueryLod. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 100 +-- src/gallium/drivers/softpipe/sp_tex_sample.h | 7 ++ 2 files changed, 101 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c

[Mesa-dev] [PATCH 1/9] tgsi: Remove trailing backslash in comment

2015-09-09 Thread Krzesimir Nowak
It clearly is here by accident. --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 75cd0d5..9544623 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c

[Mesa-dev] [PATCH 3/9] softpipe: Split compute_lambda_lod into two functions

2015-09-09 Thread Krzesimir Nowak
textureQueryLod returns a vec2 with a mipmap information and a LOD. The latter needs to be not clamped. --- src/gallium/drivers/softpipe/sp_tex_sample.c | 55 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_tex_sample.c

[Mesa-dev] [PATCH 8/9] tgsi: Add code for handling lodq opcode

2015-09-09 Thread Krzesimir Nowak
This introduces new vfunc in tgsi_sampler just for this opcode. I decided against extending get_samples vfunc to return the mipmap level and LOD - the function's prototype is already too scary and doing the sampling for textureQueryLod would be a waste of time. --- src/gallium/auxiliary/tgsi/tgsi_

[Mesa-dev] [PATCH 0/9] Implement textureQueryLod in softpipe

2015-09-09 Thread Krzesimir Nowak
stakes. Thanks. Krzesimir Nowak (9): tgsi: Remove trailing backslash in comment softpipe: Fix textureLod with nonzero GL_TEXTURE_LOD_BIAS value. softpipe: Split compute_lambda_lod into two functions softpipe: Put mip_filter_func inside a struct softpipe: Split code getting a filter into se