[Mesa-dev] [PATCH 2/2] i965: Handle nested uniform array indexing

2014-11-18 Thread Chris Forbes
When converting a uniform array reference to a pull constant load, the `reladdr` expression itself may have its own `reladdr`, arbitrarily deeply. This arises from expressions like: a[b[x]] where a, b are uniform arrays (or lowered const arrays), and x is not a constant. Jus

[Mesa-dev] [PATCH 1/2] glsl: Generate unique names for each const array lowered to uniforms

2014-11-18 Thread Chris Forbes
Uniform names (even for hidden uniforms) are required to be unique; some parts of the compiler assume they can be looked up by name. Fixes the piglit test: tests/spec/glsl-1.20/linker/array-initializers-1 Signed-off-by: Chris Forbes Cc: "10.4" --- src/glsl/lower_const_arrays_to_uniforms.cpp |

[Mesa-dev] [PATCH 09/20] mesa: Add a concept of an array format

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand An array format is a 32-bit integer format identifier that can represent any format that can be represented as an array of standard GL datatypes. While the MESA_FORMAT enums provide several of these, they don't account for all of them. v2 by Iago Toral Quiroga : - Set pad to

[Mesa-dev] [PATCH 10/20] mesa: Add a _mesa_is_format_color_format helper

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand --- src/mesa/main/formats.c | 19 +++ src/mesa/main/formats.h | 3 +++ 2 files changed, 22 insertions(+) diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index f86925e..f14250b 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c

[Mesa-dev] [PATCH 20/20] mesa/pack: refactor _mesa_pack_rgba_span_float()

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Use autogenerated format pack functions and take advantage of some macros to reduce source code, facilitating its maintenance. Unfortunately, dstType == GL_UNSIGNED_SHORT cannot simplified like the others, so keep it as it is. Signed-off-by: Samuel Iglesias Gonsa

[Mesa-dev] [PATCH 01/20] mesa/format_utils: Fix a bug in one of the format helper functions

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand --- src/mesa/main/format_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c index 93a0cea..b6d0fbc 100644 --- a/src/mesa/main/format_utils.c +++ b/src/mesa/main/format_utils.c @@ -152,7 +152

[Mesa-dev] [PATCH 00/20] Auto-generate pack/unpack functions

2014-11-18 Thread Iago Toral Quiroga
This is the fist of two series of patches to address: https://bugs.freedesktop.org/show_bug.cgi?id=84566 The idea is that we have a lot of format conversion code scattered through different files in the repository, a lot of that is redundant / duplicated, so this intends to address that issue. Th

[Mesa-dev] [PATCH 19/20] mesa/main/pack_tmp.h: Add float conversion support

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We will use this in a later patch to refactor _mesa_pack_rgba_span_float. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/pack_tmp.h | 75 +++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/s

[Mesa-dev] [PATCH 06/20] mesa: Fix _mesa_swizzle_and_convert integer conversions to clamp properly

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Fix various conversion paths that involved integer data types of different sizes (uint16_t to uint8_t, int16_t to uint8_t, etc) that were not being clamped properly. Also, one of the paths was incorrectly assigning the value 12, instead of 1, to the constant "one"

[Mesa-dev] [PATCH 05/20] mesa: Fix get_texbuffer_format().

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We were returning incorrect mesa formats for GL_LUMINANCE_ALPHA16I_EXT and GL_LUMINANCE_ALPHA32I_EXT. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/teximage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texi

[Mesa-dev] [PATCH 18/20] mesa/pack: use autogenerated format_pack functions

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Take advantage of new mesa formats and new format_pack functions to reduce source code in _mesa_pack_rgba_span_from_ints() and _mesa_pack_rgba_span_from_uints(). Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/pack.c | 663 +++-

[Mesa-dev] [PATCH 02/20] mesa: Fix packing/unpacking of MESA_FORMAT_R5G6B5_UNORM

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand Aparently, the packing/unpacking functions for these formats have differed from the format description in formats.h. Instead of fixing this, people simply left a comment saying it was broken. Let's actually fix it for real. Signed-off-by: Jason Ekstrand --- src/mesa/main

[Mesa-dev] [PATCH 04/20] mesa: Fix A1R5G5B5 packing/unpacking

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand As with B5G6R5, these have been left broken with comments saying they are. Signed-off-by: Jason Ekstrand --- src/mesa/main/format_pack.c | 8 +--- src/mesa/main/format_unpack.c| 11 --- src/mesa/main/formats.c | 2 ++ src/mesa/swrast/s_texfe

[Mesa-dev] [PATCH 16/20] mesa/formats: add new mesa formats and their pack/unpack functions.

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This will be used to refactor code in pack.c and support conversion to/from these types in a master convert function that will be added later. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.c.mako | 36 - src/mesa/main/for

[Mesa-dev] [PATCH 03/20] mesa/colormac: Remove an unused macro

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand The PACK_565_REV macro is no longer used. It was also extremely confusing because it's actually a byteswapped 565 not reversed 565. Signed-off-by: Jason Ekstrand --- src/mesa/main/colormac.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesa/main/colormac.h b/

[Mesa-dev] [PATCH 07/20] swrast: Remove unused variable.

2014-11-18 Thread Iago Toral Quiroga
--- src/mesa/swrast/s_drawpix.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index f7926e4..227faa2 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -414,7 +414,6 @@ draw_rgba_pixels( struct gl_context

[Mesa-dev] [PATCH 13/20] mesa: Add _mesa_pack_uint_rgba_row() format conversion function

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We will use this later on to handle uint conversion scenarios in a master convert function. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.c.mako | 88 src/mesa/main/format_pack.h | 3 ++ 2 f

[Mesa-dev] [PATCH 15/20] mesa/format_pack: Add _mesa_pack_int_rgba_row()

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This will be used to unify code in pack.c. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.c.mako | 121 +++ src/mesa/main/format_pack.h | 3 + 2 files changed, 124 insertions(+) diff --git a/src

[Mesa-dev] [PATCH 08/20] mesa/format_utils: Prefix and expose the conversion helper functions

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand Signed-off-by: Jason Ekstrand v2 by Samuel Iglesias : - Fix compilation errors Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_utils.c | 215 +++ src/mesa/main/format_utils.h | 105 + 2 files c

[Mesa-dev] [PATCH 14/20] mesa: Add non-normalized formats support for ubyte packing functions

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.c.mako | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/format_pack.c.mako b/src/mesa/main/format_pack.c.mako index b9f4656..97adf6e 100644 --- a/src

[Mesa-dev] [PATCH 17/20] mesa: use format conversion functions in swrast

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This commit adds a macro to facilitate the task of using format conversions functions but keeps the same API. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/swrast/s_texfetch_tmp.h | 1359 -- 1 file changed, 122 inserti

Re: [Mesa-dev] [PATCH 1/2] glsl: Generate unique names for each const array lowered to uniforms

2014-11-18 Thread Kenneth Graunke
On Tuesday, November 18, 2014 09:15:05 PM Chris Forbes wrote: > Uniform names (even for hidden uniforms) are required to be unique; some > parts of the compiler assume they can be looked up by name. > > Fixes the piglit test: tests/spec/glsl-1.20/linker/array-initializers-1 > > Signed-off-by: Chr

[Mesa-dev] [PATCH] i965/blorp: Fix hiz ops on MSAA surfaces

2014-11-18 Thread Chris Forbes
Two things were broken here: - The depth/stencil surface dimensions were broken for MSAA. - Sample count was programmed incorrectly. Result was the depth resolve didn't work correctly on MSAA surfaces, and so sampling the surface later produced garbage. Fixes the new piglit test arb_texture_multi

Re: [Mesa-dev] [PATCH 2/2] i965: Handle nested uniform array indexing

2014-11-18 Thread Kenneth Graunke
On Tuesday, November 18, 2014 09:15:06 PM Chris Forbes wrote: > When converting a uniform array reference to a pull constant load, the > `reladdr` expression itself may have its own `reladdr`, arbitrarily > deeply. This arises from expressions like: > >a[b[x]] where a, b are uniform arrays

Re: [Mesa-dev] [PATCH] i965/blorp: Fix hiz ops on MSAA surfaces

2014-11-18 Thread Kenneth Graunke
On Tuesday, November 18, 2014 09:49:53 PM Chris Forbes wrote: > Two things were broken here: > - The depth/stencil surface dimensions were broken for MSAA. > - Sample count was programmed incorrectly. > > Result was the depth resolve didn't work correctly on MSAA surfaces, and > so sampling the su

[Mesa-dev] [PATCH 14/29] mesa: use _mesa_format_convert to implement glReadPixels.

2014-11-18 Thread Iago Toral Quiroga
--- src/mesa/main/readpix.c | 354 +--- 1 file changed, 214 insertions(+), 140 deletions(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index b09cf54..8f4894e 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -39,6

[Mesa-dev] [PATCH 07/29] mesa: Add helper to convert a GL format and type to a mesa (array) format.

2014-11-18 Thread Iago Toral Quiroga
--- src/mesa/main/formats.c | 285 src/mesa/main/formats.h | 3 + 2 files changed, 288 insertions(+) diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 06e8973..7464d89 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/fo

[Mesa-dev] [PATCH 05/29] mesa: Consider internal base format in _mesa_format_convert

2014-11-18 Thread Iago Toral Quiroga
Add a dst_internal_format parameter to _mesa_format_convert, that represents the base internal format for texture/pixel uploads, so we can do the right thing when the driver has selected a different internal format for the target dst format. --- src/mesa/main/format_utils.c | 65 ++

[Mesa-dev] [PATCH 26/29] mesa: Replace _mesa_pack_rgba_span_float with _mesa_format_convert

2014-11-18 Thread Iago Toral Quiroga
This replaces all remaining uses of this function, which will be removed in another commit. --- src/mesa/main/texgetimage.c| 23 +++ src/mesa/state_tracker/st_cb_texture.c | 14 ++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/mesa

[Mesa-dev] [PATCH 28/29] mesa: Remove _mesa_(un)pack_index_span

2014-11-18 Thread Iago Toral Quiroga
These are not used anywhere. --- src/mesa/main/pack.c | 219 --- src/mesa/main/pack.h | 15 2 files changed, 234 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 49b2998..a804a58 100644 --- a/src/mesa/main/pack.c +++

[Mesa-dev] [PATCH 00/29] Use a master format convert function

2014-11-18 Thread Iago Toral Quiroga
This is the second of two series of patches to address: https://bugs.freedesktop.org/show_bug.cgi?id=84566 This series is based on the previous series we sent for review: Auto-generate pack/unpack functions. To ease review and testing, the combined series are available here: https://github.com/Ig

[Mesa-dev] [PATCH 03/29] mesa: Do not assert on integer<->non-integer direct pack/unpack fast paths

2014-11-18 Thread Iago Toral Quiroga
We can have conversions from non-integer types to integer types, so remove the assertions for these in the pack/unpack fast paths. It could be that we do not have all the necessary pack/unpack functions in these cases though, so protect these paths with conditionals and let _mesa_format_convert use

[Mesa-dev] [PATCH 08/29] mesa/pack: use _mesa_format_from_format_and_type in _mesa_pack_rgba_span_from_*

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez We had previously added the needed mesa formats, so we can simplify the code further. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/pack.c | 282 +-- 1 file changed, 26 insertions(+), 256 deletions(-)

[Mesa-dev] [PATCH 10/29] mesa: Add RGBA to Luminance conversion helpers

2014-11-18 Thread Iago Toral Quiroga
For glReadPixels with a Luminance destination format we compute luminance values from RGBA as L=R+G+B. This, however, requires ad-hoc implementation, since pack/unpack functions or _mesa_swizzle_and_convert won't do this (and thus, neither will _mesa_format_convert). This patch adds helpers to do t

[Mesa-dev] [PATCH 02/29] mesa: Set normalized=true for float array formats.

2014-11-18 Thread Iago Toral Quiroga
In order to check if a format is normalized Mesa does something like this: normalized = !_mesa_is_enum_format_integer(srcFormat); So all float types will set normalized to true. Since our mesa_array_format includes a normalized flag for each type we want to make it consistent with this. --- src/m

[Mesa-dev] [PATCH 11/29] mesa: Add helpers to extract GL_COLOR_INDEX to RGBA float/ubyte

2014-11-18 Thread Iago Toral Quiroga
We only use _mesa_make_temp_ubyte_image in texstore.c to convert GL_COLOR_INDEX to RGBA, but this helper does more stuff than this. All uses of this helper can be replaced with calls to _mesa_format_convert except for this GL_COLOR_INDEX conversion. This patch extracts the GL_COLOR_INDEX to RGBA l

[Mesa-dev] [PATCH 15/29] mesa: Let _mesa_get_format_base_format also handle mesa_array_format

2014-11-18 Thread Iago Toral Quiroga
When we needed the base format for a mesa_array_format we had to find the matching mesa_format first. This is expensive because it requires to loop through all existing mesa formats until we find the right match. We can resolve the base format of an array format directly by looking at its swizzle

[Mesa-dev] [PATCH 29/29] mesa: Remove _mesa_pack_int_rgba_row() and auxiliary functions

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez These are no longer used. Signed-off-by: Samuel Iglesias Gonsalvez --- src/mesa/main/format_pack.c.mako | 121 --- src/mesa/main/format_pack.h | 4 -- 2 files changed, 125 deletions(-) diff --git a/src/mesa/main/format

[Mesa-dev] [PATCH 27/29] mesa: Remove _mesa_pack_rgba_span_float and tmp_pack.h

2014-11-18 Thread Iago Toral Quiroga
_mesa_pack_rgba_span_float was the last of the color span functions and we have replaced all calls to it with calls to _mesa_format_convert, so we can remove it together with tmp_pack.h which was used to generate the pack functions for multiple types that were used from the various color span funct

[Mesa-dev] [PATCH 12/29] mesa: Fix RGBA8888_UINT direct unpack path in _mesa_format_convert.

2014-11-18 Thread Iago Toral Quiroga
A direct unpack to this format from a signed format won't clamp so we should not resolve converts of this kind via the unpack fast path. These scenarios will be handled properly by mesa_swizzle_and_convert path. --- src/mesa/main/format_utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(

[Mesa-dev] [PATCH 25/29] mesa: Remove _mesa_unpack_color_span_float

2014-11-18 Thread Iago Toral Quiroga
And various helper functions that went unused after removing it. --- src/mesa/main/pack.c | 1033 -- src/mesa/main/pack.h |9 - 2 files changed, 1042 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 0d77c4e..e45bfb1 10

[Mesa-dev] [PATCH 16/29] mesa: use master conversion function to implement get_tex_rgba_uncompressed()

2014-11-18 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez This covers glGetTexImage for uncompressed color formats. Signed-off-by: Samuel Iglesias Gonsalvez Signed-off-by: Eduardo Lima Mitev --- src/mesa/main/texgetimage.c | 170 ++-- 1 file changed, 117 insertions(+), 53 deleti

[Mesa-dev] [PATCH 06/29] mesa: Avoid pack/unpack fast paths if base internal format != base format

2014-11-18 Thread Iago Toral Quiroga
In general, if the dst base internal format and the selected dst format are different we can't be sure that directly packing or unpacking to the destination format will produce correct results. In these cases we probably want to fall back to other paths (like mesa_swizzle_and_convert) that can hand

[Mesa-dev] [PATCH 22/29] mesa: Remove _mesa_unpack_color_span_ubyte

2014-11-18 Thread Iago Toral Quiroga
This is no longer used anywhere after moving to _mesa_format_convert. --- src/mesa/main/pack.c | 256 --- src/mesa/main/pack.h | 9 -- 2 files changed, 265 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 46b103e..d89fc7

[Mesa-dev] [PATCH 23/29] mesa: Remove (signed) integer pack and span functions.

2014-11-18 Thread Iago Toral Quiroga
These are no longer used now that we moved to _mesa_format_convert. --- src/mesa/main/pack.c | 225 --- src/mesa/main/pack.h | 12 --- 2 files changed, 237 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index d89fc7b..0d77c4e

[Mesa-dev] [PATCH 09/29] mesa: Add _mesa_swap2_copy and _mesa_swap4_copy

2014-11-18 Thread Iago Toral Quiroga
We have _mesa_swap{2,4} but these do in-place byte-swapping only. The new functions receive an extra parameter so we can swap bytes on a source input array and store the results in a (possibly different) destination array. This is useful to implement byte-swapping in pixel uploads, since in this c

[Mesa-dev] [PATCH 04/29] mesa: Expose compute_component_mapping as _mesa_compute_component_mapping

2014-11-18 Thread Iago Toral Quiroga
This is necessary to handle conversions between array types where the driver does not support the dst format requested by the client and chooses a different format instead. We will need this in _mesa_format_convert, so move it to format_utils.c, prefix it with '_mesa_' and make it available to oth

[Mesa-dev] [PATCH 13/29] mesa: Use _mesa_format_convert to implement texstore_rgba.

2014-11-18 Thread Iago Toral Quiroga
Notice that _mesa_format_convert does not handle byte-swapping scenarios, GL_COLOR_INDEX or MESA_FORMAT_YCBCR(_REV), so these must be handled separately. Also, remove all the code that goes unused after using _mesa_format_convert. --- src/mesa/main/texstore.c | 676 +--

[Mesa-dev] [PATCH 19/29] mesa: Remove _mesa_unpack_color_span_uint

2014-11-18 Thread Iago Toral Quiroga
This is no longer used. --- src/mesa/main/pack.c | 646 --- src/mesa/main/pack.h | 6 - 2 files changed, 652 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index afc168c..46b103e 100644 --- a/src/mesa/main/pack.c +++ b/src/m

[Mesa-dev] [PATCH 24/29] swrast: Replace _mesa_unpack_color_span_float with _mesa_format_convert

2014-11-18 Thread Iago Toral Quiroga
This is the only place that uses _mesa_unpack_color_span_float so after this we will be able to remove it. --- src/mesa/swrast/s_drawpix.c | 39 +++ 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_dr

[Mesa-dev] [PATCH 20/29] mesa: Remove _mesa_make_temp_ubyte_image

2014-11-18 Thread Iago Toral Quiroga
Now that we have _mesa_format_convert we don't need this. texstore_rgba will use the GL_COLOR_INDEX to RGBA conversion helpers instead and compressed formats that used _mesa_make_temp_ubyte_image to create an ubyte RGBA temporary image can call _mesa_texstore with a RGBA/ubyte dst to achieve the s

[Mesa-dev] [PATCH 21/29] mesa: Remove _mesa_make_temp_float_image

2014-11-18 Thread Iago Toral Quiroga
Now that we have _mesa_format_convert we don't need this. This was only used to create temporary RGBA float images in the process of storing some compressed formats. These can call _mesa_texstore with a RGBA/float dst to achieve the same goal. --- src/mesa/main/texcompress_bptc.c | 20 +++--- sr

[Mesa-dev] [PATCH 17/29] mesa: Unify rebase logic for glReadPixels and glGetTexImage.

2014-11-18 Thread Iago Toral Quiroga
Both glReadPixels and glGetTexImage have RGBA rebasing logic that is almost the same, so move that logic to a separate helper function _mesa_get_rebase_format_for_color_read_back and call this from both implementations. --- src/mesa/main/pack.c| 69 +

[Mesa-dev] [PATCH 01/29] mesa: Add an implementation of a master convert function.

2014-11-18 Thread Iago Toral Quiroga
From: Jason Ekstrand v2 by Iago Toral : - When testing if we can directly pack we should use the src format to check if we are packing from an RGBA format. The original code used the dst format for the ubyte case by mistake. - Fixed incorrect number of bits for dst, it was computed using the

[Mesa-dev] [PATCH 18/29] mesa: Replace _mesa_unpack_bitmap with _mesa_unpack_image()

2014-11-18 Thread Iago Toral Quiroga
From: Eduardo Lima Mitev _mesa_unpack_bitmap() was introduced by commit 02b801c to handle the case when data is stored in PBO by display lists, in the context of this bug: Incorrect pixels read back if draw bitmap texture through Display list https://bugs.freedesktop.org/show_bug.cgi?id=10370 S

Re: [Mesa-dev] [PATCH 00/20] Auto-generate pack/unpack functions

2014-11-18 Thread Iago Toral
I forgot to say that the series is available for testing here: https://github.com/Igalia/mesa/tree/itoral-autogen-packing-review Also, one of the patches was held for review by the list owner due to its size (patch 12, which handles auto-generation of format_unpack.c), so reviewers can fetch it fr

Re: [Mesa-dev] [PATCH 00/20] Auto-generate pack/unpack functions

2014-11-18 Thread Jose Fonseca
> The idea is that we have a lot of format conversion code scattered through > different files in the repository, a lot of that is redundant / duplicated, > so this intends to address that issue. First, I think this is a great goal. And while I haven't reviewed them in detail, just from skimm

[Mesa-dev] [PATCH] util: update hash type comments

2014-11-18 Thread Timothy Arceri
Signed-off-by: Timothy Arceri --- src/util/hash_table.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/hash_table.c b/src/util/hash_table.c index 1b6726c..920bdfd 100644 --- a/src/util/hash_table.c +++ b/src/util/hash_table.c @@ -385,12 +385,12 @@ _mesa_ha

Re: [Mesa-dev] [PATCH] glsl_compiler: Add binding hash tables to avoid SIGSEVs on linking stage

2014-11-18 Thread Andres Gomez
On Mon, 2014-11-17 at 09:25 -0700, Brian Paul wrote: > Please split up this patch into: > > 1. gallium comment fixes > 2. linker string fixes > 3. hash table code changes Sure. I thought it was not worth given the small changes but I suppose it is always better to have different topics in differe

[Mesa-dev] [PATCH 1/3] draw: Fixed inline comments

2014-11-18 Thread Andres Gomez
--- src/gallium/auxiliary/draw/draw_private.h | 2 +- src/gallium/auxiliary/draw/draw_pt_vsplit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_private.h b/src/gallium/auxiliary/draw/draw_private.h index d8dc2ab..37045eb 100644 --- a/src/

[Mesa-dev] [PATCH 2/3] linker: Add carriage returns on several linker errors

2014-11-18 Thread Andres Gomez
--- src/glsl/linker.cpp | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index 2d31801..794efdc 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -642,7 +642,7 @@ validate_geometry_s

[Mesa-dev] [PATCH 3/3] glsl_compiler: Add binding hash tables to avoid SIGSEVs on linking stage

2014-11-18 Thread Andres Gomez
When using the stand alone compiler, if we try to link a shader with vertex attributes it will segfault on linking as the binding hash tables are not included in the shader program. Obviously, we cannot make the linking stage succeed without the bound attributes but we can prevent the crash and jus

Re: [Mesa-dev] [PATCH] nv50/ir: saturate FRC result to avoid completely bogus values

2014-11-18 Thread Roland Scheidegger
Am 18.11.2014 um 05:03 schrieb Ilia Mirkin: > For values above integer accuracy in floats, val - floor(val) might > actually produce a value greater than 1. For such large floats, it's > reasonable to be imprecise, but it's unreasonable for FRC to return a > value that is not between 0 and 1. > >

Re: [Mesa-dev] [PATCH] nv50/ir: saturate FRC result to avoid completely bogus values

2014-11-18 Thread Ilia Mirkin
On Tue, Nov 18, 2014 at 8:54 AM, Roland Scheidegger wrote: > Am 18.11.2014 um 05:03 schrieb Ilia Mirkin: >> For values above integer accuracy in floats, val - floor(val) might >> actually produce a value greater than 1. For such large floats, it's >> reasonable to be imprecise, but it's unreasonab

Re: [Mesa-dev] [PATCH] nv50/ir: saturate FRC result to avoid completely bogus values

2014-11-18 Thread Roland Scheidegger
Am 18.11.2014 um 15:05 schrieb Ilia Mirkin: > On Tue, Nov 18, 2014 at 8:54 AM, Roland Scheidegger > wrote: >> Am 18.11.2014 um 05:03 schrieb Ilia Mirkin: >>> For values above integer accuracy in floats, val - floor(val) might >>> actually produce a value greater than 1. For such large floats, it'

Re: [Mesa-dev] [PATCH] nv50/ir: saturate FRC result to avoid completely bogus values

2014-11-18 Thread Jose Fonseca
On 18/11/14 14:34, Roland Scheidegger wrote: Am 18.11.2014 um 15:05 schrieb Ilia Mirkin: On Tue, Nov 18, 2014 at 8:54 AM, Roland Scheidegger wrote: Am 18.11.2014 um 05:03 schrieb Ilia Mirkin: For values above integer accuracy in floats, val - floor(val) might actually produce a value greater

Re: [Mesa-dev] [PATCH 16/29] mesa: use master conversion function to implement get_tex_rgba_uncompressed()

2014-11-18 Thread Brian Paul
On 11/18/2014 02:23 AM, Iago Toral Quiroga wrote: From: Samuel Iglesias Gonsalvez This covers glGetTexImage for uncompressed color formats. Signed-off-by: Samuel Iglesias Gonsalvez Signed-off-by: Eduardo Lima Mitev --- src/mesa/main/texgetimage.c | 170 ++---

Re: [Mesa-dev] [PATCH] nv50/ir: saturate FRC result to avoid completely bogus values

2014-11-18 Thread Ilia Mirkin
On Tue, Nov 18, 2014 at 9:53 AM, Jose Fonseca wrote: > On 18/11/14 14:34, Roland Scheidegger wrote: >> >> Am 18.11.2014 um 15:05 schrieb Ilia Mirkin: >>> >>> On Tue, Nov 18, 2014 at 8:54 AM, Roland Scheidegger >>> wrote: Am 18.11.2014 um 05:03 schrieb Ilia Mirkin: > > For values

Re: [Mesa-dev] [PATCH 3/3] glsl_compiler: Add binding hash tables to avoid SIGSEVs on linking stage

2014-11-18 Thread Brian Paul
Thanks for splitting up the patch. Your commit message below line wraps a bit short (~70 chars is about right). I'll fix that before pushing. -Brian On 11/18/2014 06:49 AM, Andres Gomez wrote: When using the stand alone compiler, if we try to link a shader with vertex attributes it will seg

Re: [Mesa-dev] [PATCH 1/1] r600: upload implicit arguments even if there are no explicit args

2014-11-18 Thread Jan Vesely
ping On Mon, 2014-11-03 at 20:29 -0500, Jan Vesely wrote: > Signed-off-by: Jan Vesely > --- > > moreover, the condition is never true now that clover appends dim info > > src/gallium/drivers/r600/evergreen_compute.c | 4 > 1 file changed, 4 deletions(-) > > diff --git a/src/gallium/drive

Re: [Mesa-dev] [PATCH 00/20] Auto-generate pack/unpack functions

2014-11-18 Thread Jason Ekstrand
Jose, I haven't had time to fully review Iago and Samuel's code, so I can't 100% comment on it right now. However, let me make a few comments on the "overarching plan" as it were. On Tue, Nov 18, 2014 at 2:36 AM, Jose Fonseca wrote: > > The idea is that we have a lot of format conversion code s

Re: [Mesa-dev] Move mesa version scheme to a more common style ?

2014-11-18 Thread Ian Romanick
On 11/14/2014 07:07 AM, Erik Faye-Lund wrote: > On Fri, Nov 14, 2014 at 3:39 PM, Emil Velikov > wrote: >> Hello all, >> >> This is an old question that I had laying around - why doesn't mesa use >> a more conventional numbering for the development/rc releases ? >> >> Eg. >> mesa 10.4.0-rc1 -> 10.

Re: [Mesa-dev] [PATCH 1/2] radeonsi: support per-sample gl_FragCoord

2014-11-18 Thread Ian Romanick
On 11/17/2014 01:42 PM, Marek Olšák wrote: > From: Marek Olšák > > Cc: 10.4 > --- > src/gallium/drivers/radeonsi/si_state_draw.c | 25 + > 1 file changed, 13 insertions(+), 12 deletions(-) > > diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c > b/src/gallium/dr

Re: [Mesa-dev] [PATCH 06/20] mesa: Fix _mesa_swizzle_and_convert integer conversions to clamp properly

2014-11-18 Thread Jason Ekstrand
In general, I like this patch. However, if we are going to claim to follow the GL rule of "Colors are clampped to their representable range, then there still seem to be quite a few cases missing. For instance, when going from signed to unsigned 8-bit formats, we should should take a min with 0 an

Re: [Mesa-dev] [PATCH v3 0/9] Gallium Nine

2014-11-18 Thread Henri Verbeet
On 17 November 2014 21:05, Emil Velikov wrote: > - GL extensions > I feel that it's a bit too much to shoot the project down, because it > does not introduce GL extensions that will be useful. To clarify, that's not what I said. It's mostly just that I'd like to see some actual evidence for the (

Re: [Mesa-dev] [PATCH 09/20] mesa: Add a concept of an array format

2014-11-18 Thread Jason Ekstrand
On Tue, Nov 18, 2014 at 12:43 AM, Iago Toral Quiroga wrote: > From: Jason Ekstrand > > An array format is a 32-bit integer format identifier that can represent > any format that can be represented as an array of standard GL datatypes. > While the MESA_FORMAT enums provide several of these, they

Re: [Mesa-dev] The ARB_shader_subroutine extension

2014-11-18 Thread Ian Romanick
On 11/16/2014 08:31 AM, Gustaw Smolarczyk wrote: > Hello once again, > > This time, I would like to ask about the shader subroutine extension. > I believe this extension is not very popular, but is still needed for > GL4 compliance. > > What is the reason for its unpopularity? > Is it because one

Re: [Mesa-dev] [PATCH 11/20] mesa: Autogenerate most of format_pack.c

2014-11-18 Thread Jason Ekstrand
On Tue, Nov 18, 2014 at 12:43 AM, Iago Toral Quiroga wrote: > From: Jason Ekstrand > > We were auto-generating it before. The problem was that the autogeneration > tool we were using was called "copy, paste, and edit". Let's use a more > sensible solution. > > Signed-off-by: Jason Ekstrand >

Re: [Mesa-dev] [PATCH 3/3] glsl_compiler: Add binding hash tables to avoid SIGSEVs on linking stage

2014-11-18 Thread Ian Romanick
On 11/18/2014 07:40 AM, Brian Paul wrote: > Thanks for splitting up the patch. Your commit message below line wraps > a bit short (~70 chars is about right). I'll fix that before pushing. You can add Reviewed-by: Ian Romanick to patches 2 and 3 too. > -Brian > > > On 11/18/2014 06:49 AM, A

Re: [Mesa-dev] [PATCH 13/20] mesa: Add _mesa_pack_uint_rgba_row() format conversion function

2014-11-18 Thread Jason Ekstrand
On Tue, Nov 18, 2014 at 12:44 AM, Iago Toral Quiroga wrote: > From: Samuel Iglesias Gonsalvez > > We will use this later on to handle uint conversion scenarios in a master > convert function. > > Signed-off-by: Samuel Iglesias Gonsalvez > --- > src/mesa/main/format_pack.c.mako | 88 > +

Re: [Mesa-dev] [PATCH 13/13] mesa: Drop unused NV_fragment_program opcodes.

2014-11-18 Thread Ian Romanick
Patches 12 and 13 are Reviewed-by: Ian Roamnick The other require_NV_fp opcodes can also be removed from program_lexer.l. ir_to_mesa can generate those opcodes, but we can't get them from an assembly source shader. On 11/12/2014 05:18 PM, Eric Anholt wrote: > The extension itself was deleted 2

Re: [Mesa-dev] [PATCH 14/20] mesa: Add non-normalized formats support for ubyte packing functions

2014-11-18 Thread Jason Ekstrand
On Tue, Nov 18, 2014 at 12:44 AM, Iago Toral Quiroga wrote: > From: Samuel Iglesias Gonsalvez > > Signed-off-by: Samuel Iglesias Gonsalvez > --- > src/mesa/main/format_pack.c.mako | 10 +- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/main/format_pack.c.mak

Re: [Mesa-dev] The ARB_shader_subroutine extension

2014-11-18 Thread Gustaw Smolarczyk
Yeah, I understand this concern. But this could be said about any uber-shader approach. For cases when one cannot afford to change shader program in between draw calls (using features like multi draw indirect), it should be better to use shader subroutine arrays instead of a switch. If the differen

Re: [Mesa-dev] [PATCH] i965/blorp: Fix hiz ops on MSAA surfaces

2014-11-18 Thread Jordan Justen
On 2014-11-18 00:56:02, Kenneth Graunke wrote: > On Tuesday, November 18, 2014 09:49:53 PM Chris Forbes wrote: > > Two things were broken here: > > - The depth/stencil surface dimensions were broken for MSAA. > > - Sample count was programmed incorrectly. > > > > Result was the depth resolve didn'

Re: [Mesa-dev] [PATCH 16/20] mesa/formats: add new mesa formats and their pack/unpack functions.

2014-11-18 Thread Jason Ekstrand
On Tue, Nov 18, 2014 at 12:44 AM, Iago Toral Quiroga wrote: > From: Samuel Iglesias Gonsalvez > > This will be used to refactor code in pack.c and support conversion > to/from these types in a master convert function that will be added > later. > > Signed-off-by: Samuel Iglesias Gonsalvez > --

Re: [Mesa-dev] [PATCH 10/10] mesa: Uniform logging is very, very unlikely

2014-11-18 Thread Anuj Phogat
On Mon, Nov 3, 2014 at 4:23 PM, Ian Romanick wrote: > From: Ian Romanick > > Signed-off-by: Ian Romanick > --- > src/mesa/main/uniform_query.cpp | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp > index

[Mesa-dev] [PATCH] i965/disasm: Properly decode branch_ctrl (gen8+)

2014-11-18 Thread Ben Widawsky
Add support for decoding the new branch control bit. I saw two things wrong with the existing code. 1. It didn't bother trying to decode the bit. - While we do not *intentionally* emit this bit today, I think it's interesting to see if we somehow ended up with the bit set. It may also be usefu

Re: [Mesa-dev] [PATCH v3 0/9] Gallium Nine

2014-11-18 Thread Stefan Dösinger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 2014-11-18 19:36, schrieb Henri Verbeet: > To clarify, that's not what I said. It's mostly just that I'd like > to see some actual evidence for the (implicit) claim that the > performance difference is largely due to inherent OpenGL API > overhead.

Re: [Mesa-dev] [PATCH 00/20] Auto-generate pack/unpack functions

2014-11-18 Thread Jason Ekstrand
Iago, Most of this looks pretty good to me. The one primary concern I have is in the handling of integer formats. I made the comment in a couple of patches, but I'll make it in general here. In a lot of the code, when you convert from integer formats to float, you treat them as if they are norma

Re: [Mesa-dev] [PATCH 00/20] Auto-generate pack/unpack functions

2014-11-18 Thread Jose Fonseca
On 18/11/14 17:10, Jason Ekstrand wrote: Jose, I haven't had time to fully review Iago and Samuel's code, so I can't 100% comment on it right now. However, let me make a few comments on the "overarching plan" as it were. On Tue, Nov 18, 2014 at 2:36 AM, Jose Fonseca mailto:jfons...@vmware.com>>

[Mesa-dev] [PATCH 2/2] llvmpipe: enable PIPE_CAP_TGSI_VS_LAYER_VIEWPORT

2014-11-18 Thread sroland
From: Roland Scheidegger No changes required in the driver itself, all handled by draw. piglit results in a quick run: skip->pass 7 skip->fail 2 (The new failures in the ARB_fragment_layer_viewport group are expected, we fail the same if gs doesn't write these outputs regardless of the vs.) ---

[Mesa-dev] [PATCH 1/2] draw: fixes for vertex shaders outputting layer or viewport index

2014-11-18 Thread sroland
From: Roland Scheidegger Mostly add a couple cases so we don't just check gs for this. There's only one gotcha, the built-in vp transform in the llvm vs can't handle it (this would be fixable though non-trivial due to vp index being non-constant for the SoA outputs, but we don't use it if there's

Re: [Mesa-dev] [PATCH 2/2] llvmpipe: enable PIPE_CAP_TGSI_VS_LAYER_VIEWPORT

2014-11-18 Thread Jose Fonseca
Series LGTM. Jose On 18/11/14 22:05, srol...@vmware.com wrote: From: Roland Scheidegger No changes required in the driver itself, all handled by draw. piglit results in a quick run: skip->pass 7 skip->fail 2 (The new failures in the ARB_fragment_layer_viewport group are expected, we fail the

Re: [Mesa-dev] [PATCH] r600g: geom shaders: always load texture src regs from inputs

2014-11-18 Thread Glenn Kennard
On Tue, 18 Nov 2014 05:09:05 +0100, Dave Airlie wrote: From: Dave Airlie Otherwise we seem to lose the split_gs_inputs and try and pull from an uninitialised register. fixes 9 texelFetch geom shader tests. Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/r600_shader.c | 3 ++- 1 fi

Re: [Mesa-dev] [PATCH] r600g: limit texture offset application to specific types (v2)

2014-11-18 Thread Glenn Kennard
On Tue, 18 Nov 2014 07:59:23 +0100, Dave Airlie wrote: From: Dave Airlie For 1D and 2D arrays we don't want the other coordinates being offset and affecting where we sample. I wrote this patch 6 months ago but lost it. Fixes: ./bin/tex-miplevel-selection textureLodOffset 1DArray ./bin/tex-mi

Re: [Mesa-dev] [PATCH] i965/disasm: Properly decode branch_ctrl (gen8+)

2014-11-18 Thread Matt Turner
On Tue, Nov 18, 2014 at 12:35 PM, Ben Widawsky wrote: > Add support for decoding the new branch control bit. I saw two things wrong > with > the existing code. > > 1. It didn't bother trying to decode the bit. > - While we do not *intentionally* emit this bit today, I think it's > interesting >

Re: [Mesa-dev] [PATCH v3 0/9] Gallium Nine

2014-11-18 Thread Emil Velikov
Hi Stefan, On 18/11/14 21:21, Stefan Dösinger wrote: > Am 2014-11-18 19:36, schrieb Henri Verbeet: >> To clarify, that's not what I said. It's mostly just that I'd like >> to see some actual evidence for the (implicit) claim that the >> performance difference is largely due to inherent OpenGL API

[Mesa-dev] [PATCH] r600: fix texture gradients instruction emission

2014-11-18 Thread Dave Airlie
From: Dave Airlie The piglit tests were failing, and it appeared to be SB optimising out things, but Glenn pointed out the gradients are meant to be clause local, so we should emit the texture instructions in the same clause. This moves things around to always copy to a temp and then emit the tex

Re: [Mesa-dev] [PATCH 00/20] Auto-generate pack/unpack functions

2014-11-18 Thread Jason Ekstrand
On Tue, Nov 18, 2014 at 1:42 PM, Jose Fonseca wrote: > On 18/11/14 17:10, Jason Ekstrand wrote: > >> Jose, >> I haven't had time to fully review Iago and Samuel's code, so I can't >> 100% comment on it right now. However, let me make a few comments on >> the "overarching plan" as it were. >> >>

[Mesa-dev] [PATCH] r600: fix texture gradients instruction emission (v2)

2014-11-18 Thread Dave Airlie
From: Dave Airlie The piglit tests were failing, and it appeared to be SB optimising out things, but Glenn pointed out the gradients are meant to be clause local, so we should emit the texture instructions in the same clause. This moves things around to always copy to a temp and then emit the tex

  1   2   >