[Mesa-dev] [Bug 86690] glmark2-es2-wayland shortly freezes on some frames with egl_dri2 backend (Nouveau/GK20A)

2014-12-01 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=86690 --- Comment #6 from Alexandre Courbot gnu...@gmail.com --- I have tried reverting the following patches as suggested on http://lists.freedesktop.org/archives/dri-devel/2014-November/072367.html: 809e9447: drm/nouveau: use shared fences for

[Mesa-dev] [PATCH 4/5] i965: Make vertex color clamp handling code VS specific.

2014-12-01 Thread Kenneth Graunke
Vertex color clamping only applies to gl_[Secondary]{Front,Back}Color, which are compatibility-only built-in varyings. We only support GS in core profile, so they can't exist in geometry shaders. We can drop several dirty bits from the GS program key - they're unnecessary for a core profile

[Mesa-dev] [PATCH 2/5] i965: Drop use of GL types in program keys.

2014-12-01 Thread Kenneth Graunke
This is really far removed from the API; we should just use C types. Signed-off-by: Kenneth Graunke kenn...@whitecape.org --- src/mesa/drivers/dri/i965/brw_program.h | 46 - 1 file changed, 23 insertions(+), 23 deletions(-) diff --git

[Mesa-dev] [PATCH 3/5] i965/vs: Handle vertex color clamping in emit_urb_slot().

2014-12-01 Thread Kenneth Graunke
Vertex color clamping only applies to a few specific built-ins: COL0/1 and BFC0/1 (aka gl_[Secondary]{Front,Back}Color). It seems weird to handle special cases in a function called emit_generic_urb_slot(). emit_urb_slot() is all about handling special cases, so it makes more sense to handle this

[Mesa-dev] [PATCH 5/5] i965/vs: Set brw_vs_prog_key::clamp_vertex_color to 0 when irrelevant.

2014-12-01 Thread Kenneth Graunke
Vertex color clamping is only relevant if the shader writes to the built-in gl_[Secondary]{Front,Back}Color varyings. Otherwise, brw_vs_prog_key::clamp_vertex_color is never used, so we can simply leave it set to 0. This enables us to correctly predict the clamp_vertex_color key value in the

[Mesa-dev] [PATCH 1/5] i965: Move program key structures to brw_program.h.

2014-12-01 Thread Kenneth Graunke
With fs_visitor/fs_generator being reused for SIMD8 VS/GS programs, we're running into weird #include patterns, where scalar code #includes brw_vec4.h and such. Program keys aren't really related to SIMD4X2/SIMD8 execution - they mostly capture NOS for a particular shader stage. Consolidating

Re: [Mesa-dev] [PATCH 3/3] glx/dri3: Request non-vsynced Present for swapinterval zero.

2014-12-01 Thread Frank Binns
On 30/11/14 11:51, Mario Kleiner wrote: On 11/25/2014 09:31 AM, Frank Binns wrote: Hi, I sent exactly the same patch back in April. Despite getting a review-by it was never merged. See: http://lists.freedesktop.org/archives/mesa-dev/2014-April/058347.html

[Mesa-dev] [PATCH v2 00/23] auto-generate pack/unpack functions

2014-12-01 Thread Iago Toral Quiroga
This is the first of two series that aim to address: https://bugs.freedesktop.org/show_bug.cgi?id=84566 A branch with this series is available here: https://github.com/Igalia/mesa/tree/itoral-autogen-packing-review-v2 Link to the original series:

[Mesa-dev] [PATCH v2 06/23] mesa: Fix incorrect assertion in init_teximage_fields_ms

2014-12-01 Thread Iago Toral Quiroga
_BaseFormat is a GLenum (unsigned int) so testing if its value is greater than 0 to detect the cases where _mesa_base_tex_format returns -1 doesn't work. Fixing the assertion breaks the arb_texture_view-lifetime-format piglit test on nouveau, since that test calls _mesa_base_tex_format with

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

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com 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 jason.ekstr...@intel.com --- src/mesa/main/colormac.h | 3 --- 1 file changed, 3

[Mesa-dev] [PATCH v2 10/23] mesa: Add a concept of an array format

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com 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

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

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com 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

[Mesa-dev] [PATCH v2 09/23] swrast: Remove unused variable.

2014-12-01 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 v2 01/23] mesa/format_utils: Fix a bug in unorm_to_float helper function

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com This patch fixes the return of a wrong value when x is lower than -MAX_INT(src_bits) as the result would not be between [-1.0 1.0]. v2 by Samuel Iglesias sigles...@igalia.com: - Modify unorm_to_float() to avoid doing the division when x ==

[Mesa-dev] [PATCH v2 11/23] mesa: Let _mesa_get_format_base_format also handle mesa_array_format.

2014-12-01 Thread Iago Toral Quiroga
If we need the base format for a mesa_array_format we have 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 v2 08/23] mesa: Fix _mesa_swizzle_and_convert integer conversions to clamp properly

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com 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,

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

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com As with B5G6R5, these have been left broken with comments saying they are. Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com --- src/mesa/main/format_pack.c | 8 +--- src/mesa/main/format_unpack.c| 11 ---

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

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com We were returning incorrect mesa formats for GL_LUMINANCE_ALPHA16I_EXT and GL_LUMINANCE_ALPHA32I_EXT. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/teximage.c | 4 ++-- 1 file changed, 2 insertions(+), 2

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

2014-12-01 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

[Mesa-dev] [PATCH v2 17/23] mesa: Add non-normalized formats support for ubyte packing functions

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/format_pack.c.mako | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/format_pack.c.mako b/src/mesa/main/format_pack.c.mako index

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

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com 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 sigles...@igalia.com --- src/mesa/swrast/s_texfetch_tmp.h | 1359

[Mesa-dev] [PATCH v2 06/29] mesa: Let _mesa_swizzle_and_convert take array format types instead of GL types

2014-12-01 Thread Iago Toral Quiroga
In the future we would like to have a format conversion library that is indepdent of GL so we can share it with Gallium. This is a step in that direction. --- src/mesa/main/format_utils.c | 263 +-- src/mesa/main/format_utils.h | 8 +- 2 files changed,

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

2014-12-01 Thread Iago Toral Quiroga
This is the second of two series that aim to address: https://bugs.freedesktop.org/show_bug.cgi?id=84566 This series requires the previous series that implements auto-generation of the pack/unpack functions. A branch with both series is available here:

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

2014-12-01 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. ---

[Mesa-dev] [PATCH v2 18/23] mesa/format_pack: Add _mesa_pack_int_rgba_row()

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com This will be used to unify code in pack.c. v2: - Modify pack_int_*() function generator to use c.datatype() and f.datatype() Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/format_pack.c.mako | 121

[Mesa-dev] [PATCH v2 22/23] mesa/main/pack_tmp.h: Add float conversion support

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com We will use this in a later patch to refactor _mesa_pack_rgba_span_float. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/pack_tmp.h | 75 +++- 1 file changed, 74

[Mesa-dev] [PATCH v2 19/23] mesa/formats: add new mesa formats and their pack/unpack functions.

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com 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. v2: - Fix autogeneration of MESA_FORMAT_A2R10G10B10_UNORM pack/unpack functions Signed-off-by:

[Mesa-dev] [PATCH v2 16/29] swrast: Use _mesa_format_convert to implement draw_rgba_pixels.

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

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

2014-12-01 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

[Mesa-dev] [PATCH v2 17/29] gallium: Use _mesa_format_convert to implement st_GetTexImage.

2014-12-01 Thread Iago Toral Quiroga
Instead of using _mesa_pack_rgba_span_float. This should allow us to remove that function in a later patch. --- src/mesa/state_tracker/st_cb_texture.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c

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

2014-12-01 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 1a07a81..1f6da70 100644 --- a/src/mesa/main/pack.c +++

[Mesa-dev] [PATCH v2 07/23] mesa/format_utils: Prefix and expose the conversion helper functions

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com Signed-off-by: Jason Ekstrand jason.ekstr...@intel.com v2 by Samuel Iglesias sigles...@igalia.com: - Fix compilation errors Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/format_utils.c | 215

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

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com These are no longer used. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/format_pack.c.mako | 121 --- src/mesa/main/format_pack.h | 4 -- 2 files changed, 125

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

2014-12-01 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 +++---

[Mesa-dev] [PATCH v2 29/29] mesa: restrict use of GL_ABGR_EXT format to allowed data types

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_10_10_10_2, GL_UNSIGNED_INT_2_10_10_10_REV data types are not explicitly allowed to work with GL_ABGR_EXT format neither in GL nor GL_EXT_abgr specs. Removed the

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

2014-12-01 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

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

2014-12-01 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

[Mesa-dev] [PATCH v2 16/23] mesa: Add _mesa_pack_uint_rgba_row() format conversion function

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com We will use this later on to handle uint conversion scenarios in a master convert function. v2: - Modify pack_uint_*() function generation to use c.datatype() and f.datatype(). - Remove UINT_TO_FLOAT() macro usage from pack_uint*() - Remove

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

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com We had previously added the needed mesa formats, so we can simplify the code further. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- src/mesa/main/pack.c | 282 +-- 1 file

[Mesa-dev] [PATCH v2 21/23] mesa/pack: use autogenerated format_pack functions

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com 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 sigles...@igalia.com ---

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

2014-12-01 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

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

2014-12-01 Thread Iago Toral Quiroga
--- src/mesa/main/readpix.c | 321 +++- 1 file changed, 179 insertions(+), 142 deletions(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index b09cf54..31c0453 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@

[Mesa-dev] [PATCH v2 28/29] mesa: Remove _mesa_rebase_rgba_uint and _mesa_rebase_rgba_float

2014-12-01 Thread Iago Toral Quiroga
These are no longer used anywhere now that we have _mesa_format_convert. --- src/mesa/main/pack.c | 126 --- src/mesa/main/pack.h | 7 --- 2 files changed, 133 deletions(-) diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index

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

2014-12-01 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

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

2014-12-01 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 | 684

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

2014-12-01 Thread Iago Toral Quiroga
From: Eduardo Lima Mitev el...@igalia.com _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

[Mesa-dev] [PATCH v2 15/29] mesa: Use _mesa_format_convert to implement get_tex_rgba_compressed.

2014-12-01 Thread Iago Toral Quiroga
--- src/mesa/main/texgetimage.c | 73 + 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 024fb4d..f17bb6f 100644 --- a/src/mesa/main/texgetimage.c +++

[Mesa-dev] [PATCH v2 12/23] mesa: Add a _mesa_is_format_color_format helper

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com --- 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 05b6aea..8eb1838 100644 --- a/src/mesa/main/formats.c +++

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

2014-12-01 Thread Iago Toral Quiroga
v2 after review by Jason Ekstrand: - Move _mesa_format_from_format_and_type to glformats - Return a mesa_format for GL_UNSIGNED_INT_8_8_8_8(_REV) --- src/mesa/main/formats.c | 18 +++- src/mesa/main/formats.h | 7 ++ src/mesa/main/glformats.c | 259

[Mesa-dev] [PATCH v2 15/23] configure: require python mako module

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com It is now a hard dependency because of the autogeneration of format pack and unpack functions. Update the documentation to reflect this change. Signed-off-by: Samuel Iglesias Gonsalvez sigles...@igalia.com --- configure.ac

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

2014-12-01 Thread Iago Toral Quiroga
From: Jason Ekstrand jason.ekstr...@intel.com v2 by Iago Toral ito...@igalia.com: - 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

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

2014-12-01 Thread Iago Toral Quiroga
From: Samuel Iglesias Gonsalvez sigles...@igalia.com 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:

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

2014-12-01 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

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

2014-12-01 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

[Mesa-dev] [PATCH v2 05/29] mesa: Add a helper _mesa_compute_rgba2base2rgba_component_mapping

2014-12-01 Thread Iago Toral Quiroga
This will come in handy when callers of _mesa_format_convert need to compute the rebase swizzle parameter to use. --- src/mesa/main/format_utils.c | 55 src/mesa/main/format_utils.h | 3 +++ 2 files changed, 58 insertions(+) diff --git

[Mesa-dev] [PATCH v2 04/29] mesa: Add a rebase_swizzle parameter to _mesa_format_convert

2014-12-01 Thread Iago Toral Quiroga
The new parameter allows callers to provide a rebase swizzle that the function needs to use to match the requirements of the base internal format involved. This is necessary when the source or destination internal formats (depending on whether we are doing the conversion for a pixel download or a

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

2014-12-01 Thread Iago Toral Quiroga
--- src/mesa/main/texgetimage.c | 250 +++- 1 file changed, 133 insertions(+), 117 deletions(-) diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index cb5f793..024fb4d 100644 --- a/src/mesa/main/texgetimage.c +++

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

2014-12-01 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 b46a6fb..cb0956c 100644 --- a/src/mesa/main/pack.c

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

2014-12-01 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 6a32820..6baa36e

Re: [Mesa-dev] sampler types in tgsi

2014-12-01 Thread Roland Scheidegger
IIRC there were some brief plans to actually deprecate the tex opcodes at some point and just use the sample ones, which would clean up tgsi a bit (having both isn't terribly nice, you can't actually mix them in the same shader etc.). But I think that idea was quickly dropped and not really

Re: [Mesa-dev] sampler types in tgsi

2014-12-01 Thread Marek Olšák
I've got no problem with that if somebody wants to do it. Marek On Mon, Dec 1, 2014 at 1:18 PM, Roland Scheidegger srol...@vmware.com wrote: IIRC there were some brief plans to actually deprecate the tex opcodes at some point and just use the sample ones, which would clean up tgsi a bit

[Mesa-dev] [PATCH] i965: Make validate_reg tables constant

2014-12-01 Thread Juha-Pekka Heikkila
Declare local tables constant. Also added extra '32' at end of width_for_reg to be future proof, cvt function which give indexes to access here could already give index to reach place number five now containing '32'. Signed-off-by: Juha-Pekka Heikkila juhapekka.heikk...@gmail.com ---

[Mesa-dev] [PATCH 03/10] mesa: Returns zero samples when querying GL_NUM_SAMPLE_COUNTS when internal format is integer

2014-12-01 Thread Eduardo Lima Mitev
In GLES3, multisampling is not supported for signed and unsigned integer internal formats. See https://www.khronos.org/opengles/sdk/docs/man3/docbook4/xhtml/glGetInternalformativ.xml. Fixes 19 dEQP tests under 'dEQP-GLES3.functional.state_query.internal_format.*'. ---

[Mesa-dev] [PATCH 05/10] glsl: Don't allow gl_FragData[i], with i0 in GLES shaders

2014-12-01 Thread Eduardo Lima Mitev
The OpenGL ES Shading Language specification describes the values that may be output by a fragment shader. These are gl_FragColor and gl_FragData[0]. Multiple render targets are not supported in GLES. Fixes dEQP test: * dEQP-GLES3.functional.shaders.fragdata.invalid_assign_to_1 ---

[Mesa-dev] [PATCH 01/10] mesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO invalidation under GLES3

2014-12-01 Thread Eduardo Lima Mitev
In OpenGL and OpenGL-Es 3+, GL_DEPTH_STENCIL_ATTACHMENT is a valid attachment point for the family of functions that invalidate a framebuffer object (e.g, glInvalidateFramebuffer, glInvalidateSubFramebuffer, etc). Currently, a GL_INVALID_ENUM error is emitted for this attachment point. Fixes 21

[Mesa-dev] [PATCH 02/10] mesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0

2014-12-01 Thread Eduardo Lima Mitev
GL_RGB and GL_RGBA are valid internal formats on a GLES3 profile. See Table 1. Unsized Internal Formats at https://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage2D.xhtml. Fixes 2 dEQP tests: - dEQP-GLES3.functional.state_query.internal_format.rgb_samples -

[Mesa-dev] [PATCH 08/10] glsl: A shader cannot redefine or overload built-in functions in GLSL ES 3.00

2014-12-01 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com Create a new search function to look for matching built-in functions by name and use it for built-in function redefinition or overload in GLSL ES 3.00. GLSL ES 3.0 spec, chapter 6.1 Function Definitions, page 71 A shader cannot redefine or

[Mesa-dev] [PATCH 06/10] glsl: invariant qualifier is not valid for shader inputs in GLSL ES 3.00

2014-12-01 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com GLSL ES 3.00 spec, chapter 4.6.1 The Invariant Qualifier, Only variables output from a shader can be candidates for invariance. This includes user-defined output variables and the built-in output variables. As only outputs can be

[Mesa-dev] [PATCH 00/10] Various fixes for dEQP failing tests

2014-12-01 Thread Eduardo Lima Mitev
This set of (unrelated) patches fixes over 230 tests from the dEQP test suite [1]. While the tests failures were gathered on i965 (gen8) against 10.3.3, there are several driver and version agnostic fixes. There is one piglit regression brought by patch 10 glsl: fail when a shader's input var

[Mesa-dev] [PATCH 04/10] mesa: Recompute LegalTypesMask if the GL API has changed

2014-12-01 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com The current code computes ctx-Array.LegalTypesMask just once, however, computing this needs to consider ctx-API so we need to make sure that the API for that context has not changed if we intend to reuse the result. The context API can change, at least,

[Mesa-dev] [PATCH 07/10] glsl: don't allow invariant qualifiers for interface blocks in GLSL ES

2014-12-01 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com From GLSL ES 3.0, chapter 4.3.7 Interface Blocks, page 38: GLSL ES 3.0 does not support interface blocks for shader inputs or outputs. and from GLSL ES 3.0, chapter 4.6.1 The invariant qualifier, page 52. Only variables output from a shader

[Mesa-dev] [PATCH 10/10] glsl: fail when a shader's input var has not an equivalent out var in previous

2014-12-01 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com GLSL ES 3.00 spec, 4.3.10 (Linking of Vertex Outputs and Fragment Inputs), page 45 says the following: The type of vertex outputs and fragment input with the same name must match, otherwise the link command will fail. The precision does not

[Mesa-dev] [PATCH 09/10] main/glsles: return two minor digits for SHADING_LANGUAGE_VERSION

2014-12-01 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com For OpenGL ES 3.0 spec, the minor number for SHADING_LANGUAGE_VERSION is always two digits, matching the OpenGL ES Shading Language Specification release number. For example, this query might return the string 3.00. This patch fixes the

Re: [Mesa-dev] [PATCH] ir_to_mesa: Don't optimize clamp into saturate when target is GL_VERTEX_PROGRAM_ARB

2014-12-01 Thread Abdiel Janulgue
On 11/29/2014 12:10 PM, Kenneth Graunke wrote: On Thursday, November 27, 2014 10:45:00 AM Abdiel Janulgue wrote: Add the the same restriction as in the previous try_emit_sat when trying to optimize clamp. Fixes an infinite loop in swrast where the lowering pass unpacks saturate into clamp

[Mesa-dev] [PATCH v2 1/7] ir_to_mesa: Only lower saturate to clamp when EmitNoSat is set

2014-12-01 Thread Abdiel Janulgue
Fixes an infinite loop in swrast where the lowering pass unpacks saturate into clamp but the opt_algebraic pass tries to do the opposite. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83463 Signed-off-by: Abdiel Janulgue abdiel.janul...@linux.intel.com --- src/mesa/main/mtypes.h

[Mesa-dev] [PATCH v2 4/7] dri/radeon: Don't emit saturate for vertex shaders

2014-12-01 Thread Abdiel Janulgue
Signed-off-by: Abdiel Janulgue abdiel.janul...@linux.intel.com --- src/mesa/drivers/dri/r200/r200_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 931f437..8533123 100644 ---

[Mesa-dev] [PATCH v2 6/7] i915: Don't emit saturate for vertex shaders

2014-12-01 Thread Abdiel Janulgue
Signed-off-by: Abdiel Janulgue abdiel.janul...@linux.intel.com --- src/mesa/drivers/dri/i915/i915_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 42ea54e..847105a 100644 ---

[Mesa-dev] [PATCH v2 3/7] swrast: Don't emit saturate for vertex shaders

2014-12-01 Thread Abdiel Janulgue
Signed-off-by: Abdiel Janulgue abdiel.janul...@linux.intel.com --- src/mesa/drivers/dri/swrast/swrast.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index e8a2c12..5bd8a9b 100644 ---

[Mesa-dev] [PATCH v2 2/7] glsl: Don't optimize min/max into saturate when EmitNoSat is set

2014-12-01 Thread Abdiel Janulgue
Signed-off-by: Abdiel Janulgue abdiel.janul...@linux.intel.com --- src/glsl/opt_algebraic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp index 430f5cb..89fc0de 100644 --- a/src/glsl/opt_algebraic.cpp +++

[Mesa-dev] [PATCH v2 5/7] st/mesa: For vertex shaders, don't emit saturate when SM 3.0 is unsupported

2014-12-01 Thread Abdiel Janulgue
There is a bug in the current lowering pass implementation where we lower saturate to clamp only for vertex shaders on drivers supporting SM 3.0. The correct behavior is to actually lower to clamp only when we don't support saturate which happens on drivers that don't support SM 3.0

[Mesa-dev] [PATCH v2 7/7] i965: Don't emit saturate for vertex shaders

2014-12-01 Thread Abdiel Janulgue
Signed-off-by: Abdiel Janulgue abdiel.janul...@linux.intel.com --- src/mesa/drivers/dri/i965/brw_context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 8b0f391..660e856 100644 ---

[Mesa-dev] [PATCH] mesa: removed reference to unused header

2014-12-01 Thread Albert Freeman
Removed reference to unused header file to reduce src/mesa/main dependency on src/mesa/drivers. Signed-off-by: Albert Freeman albertwdfree...@gmail.com --- I do not have commit access! No regressions with piglit (tests/quick.py). src/mesa/main/enable.c | 3 --- 1 file changed, 3 deletions(-)

Re: [Mesa-dev] [Patch v2] Mesa: Add support for GL_OES_texture_*float* extensions.

2014-12-01 Thread Brian Paul
Thanks for the updates. A few more nitpicks... On 11/27/2014 11:56 AM, Kalyan Kondapally wrote: This patch adds support for following GLES2 Texture Float extensions: 1)GL_OES_texture_float, 2)GL_OES_texture_half_float, 3)GL_OES_texture_float_linear, 4)GL_OES_texture_half_float_linear.

Re: [Mesa-dev] [PATCH 01/13] mesa/meta: Don't free meta if it was never initialized

2014-12-01 Thread Brian Paul
On 11/28/2014 04:25 AM, Juha-Pekka Heikkila wrote: Signed-off-by: Juha-Pekka Heikkila juhapekka.heikk...@gmail.com --- src/mesa/drivers/common/meta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 87532c1..fab360d

Re: [Mesa-dev] [PATCH 03/13] mesa/main: Don't go freeing texture data which was never allocated

2014-12-01 Thread Brian Paul
On 11/28/2014 04:25 AM, Juha-Pekka Heikkila wrote: Signed-off-by: Juha-Pekka Heikkila juhapekka.heikk...@gmail.com --- src/mesa/main/texstate.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index

Re: [Mesa-dev] [PATCH 13/13] mesa/main: Verify context creation on progress

2014-12-01 Thread Brian Paul
On 11/28/2014 04:25 AM, Juha-Pekka Heikkila wrote: Stop context creation if something failed. If something errored during context creation we'd segfault. Now will clean up and return error. Signed-off-by: Juha-Pekka Heikkila juhapekka.heikk...@gmail.com --- src/mesa/main/shared.c | 66

Re: [Mesa-dev] [PATCH 05/10] glsl: Don't allow gl_FragData[i], with i0 in GLES shaders

2014-12-01 Thread Matteo Bruni
2014-12-01 14:04 GMT+01:00 Eduardo Lima Mitev el...@igalia.com: The OpenGL ES Shading Language specification describes the values that may be output by a fragment shader. These are gl_FragColor and gl_FragData[0]. Multiple render targets are not supported in GLES. Fixes dEQP test: *

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

2014-12-01 Thread Brian Paul
On 12/01/2014 04:05 AM, Iago Toral Quiroga wrote: 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

Re: [Mesa-dev] [PATCH 04/10] mesa: Recompute LegalTypesMask if the GL API has changed

2014-12-01 Thread Brian Paul
On 12/01/2014 06:04 AM, Eduardo Lima Mitev wrote: From: Iago Toral Quiroga ito...@igalia.com The current code computes ctx-Array.LegalTypesMask just once, however, computing this needs to consider ctx-API so we need to make sure that the API for that context has not changed if we intend to

Re: [Mesa-dev] [PATCH 09/10] main/glsles: return two minor digits for SHADING_LANGUAGE_VERSION

2014-12-01 Thread Brian Paul
I'd change the subject to main: return two minor digits for ES shading language version On 12/01/2014 06:04 AM, Eduardo Lima Mitev wrote: From: Samuel Iglesias Gonsalvez sigles...@igalia.com For OpenGL ES 3.0 spec, the minor number for SHADING_LANGUAGE_VERSION is always two digits, matching

Re: [Mesa-dev] [PATCH 00/10] Various fixes for dEQP failing tests

2014-12-01 Thread Brian Paul
On 12/01/2014 06:04 AM, Eduardo Lima Mitev wrote: This set of (unrelated) patches fixes over 230 tests from the dEQP test suite [1]. While the tests failures were gathered on i965 (gen8) against 10.3.3, there are several driver and version agnostic fixes. There is one piglit regression

Re: [Mesa-dev] [Patch v2] Mesa: Add support for GL_OES_texture_*float* extensions.

2014-12-01 Thread kalyan kondapally
I think this would be nicer as: if (ctx-API == API_OPENGLES2) { ctx-Extensions.OES_texture_fl The indentation of the new lines there looks inconsistent. I sent v3 which already has the fixes. On Mon, Dec 1, 2014 at 7:34 AM, Brian Paul bri...@vmware.com wrote: Thanks for the

Re: [Mesa-dev] [PATCH 2/2] st/nine: Fix vertex declarations for non-standard (usage/index)

2014-12-01 Thread Ilia Mirkin
On Thu, Nov 27, 2014 at 5:13 AM, Axel Davy axel.d...@ens.fr wrote: Nine code to match vertex declaration to vs inputs was limiting the number of possible combinations. Some sm3 games have issues with that, because arbitrary (usage/index) can be used. This patch does the following changes to

[Mesa-dev] [PATCH 1/2] i965: Don't treat IF or WHILE with cmod as writing the flag.

2014-12-01 Thread Matt Turner
--- These are a couple of fixes from a Jenkins run of my flagdce branch. src/mesa/drivers/dri/i965/brw_fs.cpp | 4 +++- src/mesa/drivers/dri/i965/brw_vec4.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp

[Mesa-dev] [PATCH 2/2] i965/fs: Treat the FB_WRITE as predicated if we're discarding.

2014-12-01 Thread Matt Turner
Pre-Haswell hardware couldn't actually predicate it, but it's easier to pretend as if it's predicated in the visitor since it will generate a MOV from f0.1. --- src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 4 src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 2 +- 2 files changed, 5

Re: [Mesa-dev] [PATCH v2 08/23] mesa: Fix _mesa_swizzle_and_convert integer conversions to clamp properly

2014-12-01 Thread Jason Ekstrand
This looks much better. Two comments though. First, I think we need to tweak the float_to_uint function to clamp above. I don't know that it properly handles values larger than MAX_UINT right now. Second, I think we may want a MIN_INT macro for this. In particular, I don't know that this is

Re: [Mesa-dev] [PATCH v2 06/23] mesa: Fix incorrect assertion in init_teximage_fields_ms

2014-12-01 Thread Jason Ekstrand
On Mon, Dec 1, 2014 at 3:04 AM, Iago Toral Quiroga ito...@igalia.com wrote: _BaseFormat is a GLenum (unsigned int) so testing if its value is greater than 0 to detect the cases where _mesa_base_tex_format returns -1 doesn't work. Fixing the assertion breaks the

Re: [Mesa-dev] [PATCH v2 11/23] mesa: Let _mesa_get_format_base_format also handle mesa_array_format.

2014-12-01 Thread Jason Ekstrand
On Mon, Dec 1, 2014 at 3:04 AM, Iago Toral Quiroga ito...@igalia.com wrote: If we need the base format for a mesa_array_format we have 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

Re: [Mesa-dev] [PATCH] i965: Make validate_reg tables constant

2014-12-01 Thread Matt Turner
On Mon, Dec 1, 2014 at 4:59 AM, Juha-Pekka Heikkila juhapekka.heikk...@gmail.com wrote: Declare local tables constant. Also added extra '32' at end of width_for_reg to be future proof, cvt function which give indexes to access here could already give index to reach place number five now

Re: [Mesa-dev] [PATCH v2 06/23] mesa: Fix incorrect assertion in init_teximage_fields_ms

2014-12-01 Thread Ilia Mirkin
On Mon, Dec 1, 2014 at 6:04 AM, Iago Toral Quiroga ito...@igalia.com wrote: _BaseFormat is a GLenum (unsigned int) so testing if its value is greater than 0 to detect the cases where _mesa_base_tex_format returns -1 doesn't work. Fixing the assertion breaks the

  1   2   >