[Mesa-dev] [PATCH 44/78] i965/nir/vec4: noise ops should already be lowered

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Marked them as unreachable. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

[Mesa-dev] [PATCH 45/78] i965/nir/vec4: Implement pack/unpack operations

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com * Lowered floating-point pack and unpack operations are not valid in VS. * Pack and unpack 2x16 operations should be handled by lower_packing_builtins. * Adds NIR ALU operations: * nir_op_pack_half_2x16 * nir_op_unpack_half_2x16 *

[Mesa-dev] [PATCH 32/78] i965/nir/vec4: Implement carry/borrow for addition/subtraction

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_uadd_carry * nir_op_usub_borrow Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 16 1 file changed, 16 insertions(+) diff --git

[Mesa-dev] [PATCH 39/78] i965/nir/vec4: Add swizzle utility method for vector ops

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com For operations that have a predefined operand size 0, defined in glsl/nir/nir_opcodes.c, NIR returns a swizzle containing zeros in the components from outside the source vector. However, the driver expects those components to have a swizzle value equal to

[Mesa-dev] [PATCH 41/78] i965/nir/vec4: Implement non-equality ops on vectors

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_bany_fnequal2 * nir_op_bany_inequal2 * nir_op_bany_fnequal3 * nir_op_bany_inequal3 * nir_op_bany_fnequal4 * nir_op_bany_inequal4 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 ---

[Mesa-dev] [PATCH 46/78] i965/nir/vec4: Implement bit operations

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Same implementation than the IR case. Adds NIR ALU operations: * nir_op_bitfield_reverse * nir_op_bit_count * nir_op_ufind_msb * nir_op_ifind_msb * nir_op_find_lsb * nir_op_ubitfield_extract * nir_op_ibitfield_extract * nir_op_bfm

[Mesa-dev] [PATCH 33/78] i965/nir/vec4: Implement float-related functions

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_ftrunc * nir_op_fceil * nir_op_ffloor * nir_op_ffrac * nir_op_fround_even Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 40

[Mesa-dev] [PATCH 49/78] i965/nir/vec4: Implement floating-point fused multiply-add

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operation: * nir_op_ffma Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 9 + 1 file changed, 9 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

[Mesa-dev] [PATCH 42/78] i965/nir/vec4: Implement logical operators

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_inot * nir_op_ixor * nir_op_ior * nir_op_iand Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 16 1 file changed, 16 insertions(+)

[Mesa-dev] [PATCH 27/78] i965/nir/vec4: Implement int-float format conversion ops

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_f2i * nir_op_f2u * nir_op_i2f * nir_op_u2f Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 11 +++ 1 file changed, 11 insertions(+) diff

[Mesa-dev] [PATCH 34/78] i965/vec4: Return the emitted instruction in emit_minmax()

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Needed in the NIR backend to set the saturate value of the instruction. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4.h | 4 ++-- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 4 +++- 2

[Mesa-dev] [PATCH 31/78] i965/nir/vec4: Implement more math operations

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_frcp * nir_op_fexp2 * nir_op_flog2 * nir_op_fexp * nir_op_flog * nir_op_fsin * nir_op_fcos * nir_op_idiv * nir_op_udiv * nir_op_umod * nir_op_ldexp * nir_op_fsqrt * nir_op_frsq *

[Mesa-dev] [PATCH 53/78] i965/nir/vec4: Implement the dot product operation

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_fdot2 * nir_op_fdot3 * nir_op_fdot4 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 15 +++ 1 file changed, 15 insertions(+) diff --git

[Mesa-dev] [PATCH 52/78] i965/nir/vec4: Implement conditional select

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_bcsel Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

[Mesa-dev] [PATCH 40/78] i965/nir/vec4: Implement equality ops on vectors

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_ball_fequal2 * nir_op_ball_iequal2 * nir_op_ball_fequal3 * nir_op_ball_iequal3 * nir_op_ball_fequal4 * nir_op_ball_iequal4 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 ---

[Mesa-dev] [PATCH 36/78] i965/nir/vec4: Derivatives are not allowed in VS

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 8 1 file changed, 8 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp

[Mesa-dev] [PATCH 25/78] i965/nir/vec4: Implement single-element mov operations

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Adds NIR ALU operations: * nir_op_imov * nir_op_fmov Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 13 + 1 file changed, 13 insertions(+) diff --git

[Mesa-dev] [PATCH 30/78] i965/vec4: Return the last emitted instruction in emit_math()

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Needed in the NIR backend to set the saturate value of the instruction. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4.h | 5 +++-- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 6 -- 2

[Mesa-dev] [PATCH 23/78] i965/nir/vec4: Prepare source and destination registers for ALU operations

2015-06-26 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com This patch resolves and initializes the destination and the source registers that are common to most ALU operations. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89580 --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 19 ++- 1

Re: [Mesa-dev] [PATCH 2/5] mesa: Fix error returned by glCopyTexImage2D() upon an invalid internal format

2015-06-25 Thread Eduardo Lima Mitev
On 06/05/2015 03:43 AM, Ben Widawsky wrote: On Wed, Mar 11, 2015 at 10:01:25AM +0100, Eduardo Lima Mitev wrote: Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.texture.copyteximage2d_invalid_format --- src/mesa/main/teximage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [Mesa-dev] [PATCH 1/5] mesa: Fix errors values returned by glShaderBinary()

2015-06-25 Thread Eduardo Lima Mitev
On 06/09/2015 07:41 PM, Ian Romanick wrote: On 06/04/2015 06:38 PM, Ben Widawsky wrote: On Wed, Mar 11, 2015 at 10:01:24AM +0100, Eduardo Lima Mitev wrote: Page 68, section 7.2 'Shader Binaries of the of the OpenGL ES 3.1, and page 88 of the OpenGL 4.5 specs state: An INVALID_VALUE error

Re: [Mesa-dev] [PATCH 1/5] mesa: Fix errors values returned by glShaderBinary()

2015-06-08 Thread Eduardo Lima Mitev
On 06/05/2015 03:38 AM, Ben Widawsky wrote: On Wed, Mar 11, 2015 at 10:01:24AM +0100, Eduardo Lima Mitev wrote: Page 68, section 7.2 'Shader Binaries of the of the OpenGL ES 3.1, and page 88 of the OpenGL 4.5 specs state: An INVALID_VALUE error is generated if count or length is negative

[Mesa-dev] [PATCH] nir: prevent use-after-free condition in should_lower_phi()

2015-06-02 Thread Eduardo Lima Mitev
lower_phis_to_scalar() pass recurses the instruction dependence graph to determine if all the sources of a given instruction are scalarizable. To prevent cycles, it temporary marks the phi instruction before recursing in, then updates the entry with the resulting value. However, it does not

Re: [Mesa-dev] [PATCH] nir: prevent use-after-free condition in should_lower_phi()

2015-06-02 Thread Eduardo Lima Mitev
On 06/02/2015 01:42 PM, Eduardo Lima Mitev wrote: lower_phis_to_scalar() pass recurses the instruction dependence graph to determine if all the sources of a given instruction are scalarizable. To prevent cycles, it temporary marks the phi instruction before recursing in, then updates the entry

Re: [Mesa-dev] [PATCH 1/3] mesa: Improve validation of target, format and type of glTexSubImage[2, 3]D

2015-03-25 Thread Eduardo Lima Mitev
On 03/25/2015 12:02 AM, Laura Ekstrand wrote: + if (_mesa_is_gles3(ctx)) { + /* Validation of format and type for ES3 has to be done here + * after the texture image is resolved, because the internal + * format is needed for the

[Mesa-dev] [PATCH 1/2 v2] mesa: Validate target before resolving tex obj in glTex(ture)SubImageXD

2015-03-25 Thread Eduardo Lima Mitev
Currently, glTexSubImageXD attempt to resolve the texture object (by calling _mesa_get_current_tex_object()) before validating the given target. However, that method explicitly states that target must have been validated before calling it, so it never returns a user error. The target validation

[Mesa-dev] [PATCH 2/2 v2] mesa: Add missing check of format and type in glTexSubImageXD on GLES 3.0

2015-03-25 Thread Eduardo Lima Mitev
Argument validation for glTexSubImageXD is missing a check of format and type against texture object's internal format when profile is OpenGL-ES 3.0+. This patch also groups together all format and type checks into a single block of code for clarity. Fixes 2 dEQP tests: *

Re: [Mesa-dev] [PATCH 1/3] mesa: Improve validation of target, format and type of glTexSubImage[2, 3]D

2015-03-24 Thread Eduardo Lima Mitev
Thanks for the review! Please see some comments inline: On 03/23/2015 06:53 PM, Laura Ekstrand wrote: I'm glad you found this target checking problem. I have come across the same problem in other texture functions, but I have been too busy to find all instances of this. It's kind of a

[Mesa-dev] [PATCH 2/3] mesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() calls

2015-03-23 Thread Eduardo Lima Mitev
Basically, two different target error checks are chained consecutively, and the second one is executed regardless the result of the first one. This produces an incorrect error if the first check fails but is overrided by the second. This patch conditions the execution of the second check to a

[Mesa-dev] [PATCH 1/3] mesa: Improve validation of target, format and type of glTexSubImage[2, 3]D

2015-03-23 Thread Eduardo Lima Mitev
Currently, glTexSubImage[2,3]D attempt to resolve the texture object (by calling _mesa_get_current_tex_object()) before validating the given target. However, that method explicitly states that target must have been validated before calling it, so it never returns a user error. The target

[Mesa-dev] [PATCH 3/3] mesa: Validate the target argument earlier in glGenerateMipmap()

2015-03-23 Thread Eduardo Lima Mitev
glGenerateMipmap() queries the current texture object corresponding to the target argument before ever validating it. It does so by calling _mesa_get_current_tex_object() which explicitly states that target must have been validated before. However, the target validation occurs later on in

[Mesa-dev] [PATCH 0/3] A few more fixes for dEQP failing tests

2015-03-23 Thread Eduardo Lima Mitev
This is a short series of patches fixing a total of 3 dEQP tests from the negative API set. As usual, a git tree with the series is accessible to help bulk testing: https://github.com/Igalia/mesa/commits/deqp-fixes-batch7 No piglit regressions observed. cheers, Eduardo Eduardo Lima Mitev (3

Re: [Mesa-dev] [PATCH 3/4 v3] mesa: Separate PBO validation checks from buffer mapping, to allow reuse

2015-03-13 Thread Eduardo Lima Mitev
Hi, I just merged the 4 patches after fixing your last comments. Thanks a lot for your reviews and patience. cheers, Eduardo On 03/12/2015 06:22 PM, Laura Ekstrand wrote: On Thu, Mar 12, 2015 at 12:14 AM, Eduardo Lima Mitev el...@igalia.com mailto:el...@igalia.com wrote

[Mesa-dev] [PATCH 3/4 v3] mesa: Separate PBO validation checks from buffer mapping, to allow reuse

2015-03-12 Thread Eduardo Lima Mitev
Internal PBO functions such as _mesa_map_validate_pbo_source() and _mesa_validate_pbo_compressed_teximage() perform validation and buffer mapping within the same call. This patch takes out the validation into separate functions to allow reuse of functionality by other code (i.e,

[Mesa-dev] [PATCH 4/4 v3] mesa: Check for valid PBO access in gl(Compressed)Tex(Sub)Image calls

2015-03-12 Thread Eduardo Lima Mitev
This patch adds two types of checks to the gl(Compressed)Tex(Sub)Imgage family of functions when a pixel buffer object is bound to GL_PIXEL_UNPACK_BUFFER: - That the buffer is not mapped. - The total data size is within the boundaries of the buffer size. It does so by calling auxiliary

[Mesa-dev] [PATCH 4/5] glsl: Consider active all elements of a shared/std140 block array

2015-03-11 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com Commmit 1ca25ab (glsl: Do not eliminate 'shared' or 'std140' blocks or block members) considers active 'shared' and 'std140' uniform blocks and uniform block arrays but did not include the block array elements. It was possible to have an active uniform

[Mesa-dev] [PATCH 3/5] glcpp: Allow arithmetic integer expressions in #line

2015-03-11 Thread Eduardo Lima Mitev
From: Antia Puentes apuen...@igalia.com From section 3.4 (Preprocessor) of the GLSL ES 3.00 specification: #line must have, after macro substitution, one of the following forms: #line line #line line source-string-number where line and source-string-number are constant integral

[Mesa-dev] [PATCH 5/5] glsl: Avoid buffer overflow when assigning attribute locations

2015-03-11 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Shaders with excessive number of attributes (16) can produce a crash due to buffer overflow in assign_attribute_or_color_locations. The overflow can happen because we declare a fixed size array that can hold up to 16 attributes and we don't check that we

[Mesa-dev] [PATCH 1/5] mesa: Fix errors values returned by glShaderBinary()

2015-03-11 Thread Eduardo Lima Mitev
Page 68, section 7.2 'Shader Binaries of the of the OpenGL ES 3.1, and page 88 of the OpenGL 4.5 specs state: An INVALID_VALUE error is generated if count or length is negative. An INVALID_ENUM error is generated if binaryformat is not a supported format returned in

[Mesa-dev] [PATCH 2/5] mesa: Fix error returned by glCopyTexImage2D() upon an invalid internal format

2015-03-11 Thread Eduardo Lima Mitev
Section '8.6 Alternate Texture Image Specification Commands', page 161 of the OpenGL ES 3.1 spec, and page 207 of the same section in the OpenGL 4.5 spec state in relation to CopyTexImage2D method: An INVALID_ENUM error is generated if an invalid value is specified for internalformat.

[Mesa-dev] [PATCH 0/5] Series fixing various dEQP failing tests

2015-03-11 Thread Eduardo Lima Mitev
rebased against current master to ease bulk testing: https://github.com/Igalia/mesa/commits/deqp-fixes-batch6-rebased cheers, Eduardo Antia Puentes (2): glcpp: Allow arithmetic integer expressions in #line glsl: Consider active all elements of a shared/std140 block array Eduardo Lima Mitev (2

[Mesa-dev] [PATCH 1/4 v2] meta: Remove error checks for texture - pixel-buffer transfers that don't belong in driver code

2015-03-10 Thread Eduardo Lima Mitev
The implementation of texture - pixel-buffer transfers in drivers common layer includes certain error checks and argument validation that don't belong there, considering how the Mesa codebase is laid out. These are higher level validations that, if necessary, should be performed earlier (i.e, in

[Mesa-dev] [PATCH 3/4 v2] mesa: Separate PBO validation checks from buffer mapping, to allow reuse

2015-03-10 Thread Eduardo Lima Mitev
Internal PBO functions such as _mesa_map_validate_pbo_source() and _mesa_validate_pbo_compressed_teximage() perform validation and buffer mapping within the same call. This patch takes out the validation into separate functions to allow reuse of functionality by other code (i.e,

[Mesa-dev] [PATCH 4/4 v2] mesa: Check for valid PBO access in gl(Compressed)Tex(Sub)Image calls

2015-03-10 Thread Eduardo Lima Mitev
This patch adds two types of checks to the gl(Compressed)Tex(Sub)Imgage family of functions when a pixel buffer object is bound to GL_PIXEL_UNPACK_BUFFER: - That the buffer is not mapped. - The total data size is within the boundaries of the buffer size. It does so by calling auxiliary

[Mesa-dev] [PATCH 4/4] mesa: Check for valid PBO access in gl(Compressed)Tex(Sub)Image calls

2015-03-05 Thread Eduardo Lima Mitev
This patch adds two types of checks to the gl(Compressed)Tex(Sub)Imgage family of functions when a pixel buffer object is bound to GL_PIXEL_UNPACK_BUFFER: - That the buffer is not mapped. - The total data size is within the boundaries of the buffer size. It does so by calling auxiliary

[Mesa-dev] [PATCH 2/4] mesa: Set the correct image size in _mesa_validate_pbo_access()

2015-03-05 Thread Eduardo Lima Mitev
_mesa_validate_pbo_access() provides a generic way to check that a requested pixel transfer operation on a PBO falls within the boundaries of the buffer. It is used in various other places, and depending on the caller, some arguments are used or not. In particular, the 'clientMemSize' argument is

[Mesa-dev] [PATCH 0/4] glCompressedTex(Sub)Image(2, 3) on mapped PBOs

2015-03-05 Thread Eduardo Lima Mitev
rather tackle those in a separate issue to avoid making this series more complex. cheers, Eduardo Eduardo Lima Mitev (4): meta: Remove error checks for texture - pixel-buffer transfers that don't belong in driver code mesa: Set the correct image size in _mesa_validate_pbo_access

[Mesa-dev] [PATCH 3/4] mesa: Separate PBO validation checks from buffer mapping, to allow reuse

2015-03-05 Thread Eduardo Lima Mitev
Internal PBO functions such as _mesa_map_validate_pbo_source() and _mesa_validate_pbo_compressed_teximage() perform validation and buffer mapping within the same call. This patch takes out the validation into separate functions to allow reuse of functionality by other code (i.e,

[Mesa-dev] [PATCH 1/4] meta: Remove error checks for texture - pixel-buffer transfers that don't belong in driver code

2015-03-05 Thread Eduardo Lima Mitev
The implementation of texture - pixel-buffer transfers in drivers common layer includes certain error checks and argument validation that don't belong there, considering how the Mesa codebase is laid out. These are higher level validations that, if necessary, should be performed earlier (i.e, in

Re: [Mesa-dev] [PATCH 1/4] meta: Remove error checks for texture - pixel-buffer transfers that don't belong in driver code

2015-03-05 Thread Eduardo Lima Mitev
On 03/05/2015 06:55 PM, Laura Ekstrand wrote: On Thu, Mar 5, 2015 at 12:20 AM, Eduardo Lima Mitev el...@igalia.com mailto:el...@igalia.com wrote: diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c index bba2b4f..34ef191

Re: [Mesa-dev] [PATCH 10/11] mesa: Return error if BeginQuery is called with an existing object of different type

2015-02-26 Thread Eduardo Lima Mitev
: http://lists.freedesktop.org/archives/piglit/2015-February/014789.html I will appreciate if someone can take a look. Eduardo On 02/10/2015 07:40 AM, Eduardo Lima Mitev wrote: Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 spec states: BeginQuery generates

Re: [Mesa-dev] glCompressedTex(Sub)Image(2,3) on mapped PBOs

2015-02-24 Thread Eduardo Lima Mitev
On 02/20/2015 08:12 PM, Ian Romanick wrote: On 02/20/2015 08:13 AM, Eduardo Lima Mitev wrote: In the spec GLES 3.1 spec, page 57, there is this: (and similar wording in GL 4.5 spec, page 76) 6.3.2 Effects of Mapping Buffers on Other GL Commands Any GL command which attempts to read from

[Mesa-dev] [PATCH 3/9] glsl: Add variables to symbol table also for single declarations

2015-02-24 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com We were doing this for all variables in a declaration list, but not when there was just a single declaration. As a consequence, when we used a single variable declaration to redeclare a type that existed in a previous scope we would get a parsing error,

[Mesa-dev] [PATCH 8/9] mesa: Fix GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE for default framebuffer.

2015-02-24 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com From section 9.2. Binding and Managing Framebuffer Objects: Upon successful return from Get*FramebufferAttachmentParameteriv, if pname is FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, then params will contain one of NONE, FRAMEBUFFER_DEFAULT, TEXTURE, or

[Mesa-dev] [PATCH 1/9] glsl: don't lower fragdata array if the output data types don't match

2015-02-24 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com Commit 7e414b58640aee6e243d337e72cea290c354f632 broke the gl_FragData array into separate gl_FragData[i] variables, so drivers can eliminate useless writes to gl_FragData improving their performance. The problem occurs when GLSL IR code is

[Mesa-dev] [PATCH 0/9] Another series fixing dEQP failing tests

2015-02-24 Thread Eduardo Lima Mitev
Hello, This is another set of patches fixing 274 dEQP failing tests from the GLES3 module. Patches were written against Mesa 10.4.4 and were tested on i965. No piglit regressions observed. There is a git tree with this series rebased against current master to ease bulk testing:

[Mesa-dev] [PATCH 7/9] i965/blorp: Improve precission of blitting coordinates when clipping

2015-02-24 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com We do this in two steps: first we clip the dst rect and adjust the src rect accordingly. Then we do it the other way around. In both passes the adjustment part involves multiplying by a scale factor that can lead to a small precision loss. This is

[Mesa-dev] [PATCH 4/9] glsl: Add function parameter declarations to the symbol table

2015-02-24 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com So they can hide declarations with the same name in other scopes. Otherwise we get a parsing error for things like: struct S { int val; }; int func (int S) { return S; } Fixes the following 2 dEQP tests:

Re: [Mesa-dev] [PATCH] mesa: Adds missing error condition in _mesa_check_sample_count()

2015-02-23 Thread Eduardo Lima Mitev
On 02/23/2015 12:41 PM, Martin Peres wrote: Section 4.4 (Framebuffer objects), page 198 of the OpenGL 3.0.0 specification says: If internalformat is a signed or unsigned integer format and samples is greater than zero, then the error INVALID_OPERATION is generated. See

Re: [Mesa-dev] [PATCH v2] mesa: Adds missing error condition in _mesa_check_sample_count()

2015-02-23 Thread Eduardo Lima Mitev
On 02/23/2015 02:37 PM, Martin Peres wrote: Looks better :) Indeed, this is only for OpenGLES 3. Reviewed-by: Martin Peres martin.pe...@linux.intel.com Thanks Martin! The patch was already pushed by Samuel Iglesias. cheers, Eduardo ___ mesa-dev

[Mesa-dev] [PATCH v2] mesa: Adds missing error condition in _mesa_check_sample_count()

2015-02-23 Thread Eduardo Lima Mitev
This corrects a trivial error introduced in commit 19252fee46b835cb4f6b1cce18d7737d62b64a2e. That patch was merged recently and omits one condition (that 'samples' is greater than zero) in one of the error checks. That error will definitely cause regressions. Also corrects the reference to the

Re: [Mesa-dev] [PATCH] mesa: Adds missing error condition in _mesa_check_sample_count()

2015-02-23 Thread Eduardo Lima Mitev
Hi, can someone take a look? It should be very straight forward. Eduardo On 02/20/2015 02:09 PM, Eduardo Lima Mitev wrote: This corrects a trivial error introduced in commit 19252fee46b835cb4f6b1cce18d7737d62b64a2e. That patch was merged recently and omits one condition (that 'samples

Re: [Mesa-dev] [PATCH] mesa: Adds missing error condition in _mesa_check_sample_count()

2015-02-23 Thread Eduardo Lima Mitev
On 02/23/2015 09:48 AM, Martin Peres wrote: On 23/02/15 10:33, Eduardo Lima Mitev wrote: Hi, can someone take a look? It should be very straight forward. Eduardo You are not supposed to return INVALID_OPERATION if samples 0. Also, samples == 0 is valid [0], so this is a NAK for me

[Mesa-dev] [PATCH] mesa: Adds missing error condition in _mesa_check_sample_count()

2015-02-20 Thread Eduardo Lima Mitev
This corrects a trivial error introduced in commit 19252fee46b835cb4f6b1cce18d7737d62b64a2e. That patch was merged recently and omits one condition (that 'samples' is greater than zero) in one of the error checks. That error will definitely cause regressions. --- src/mesa/main/multisample.c | 3

[Mesa-dev] glCompressedTex(Sub)Image(2,3) on mapped PBOs

2015-02-20 Thread Eduardo Lima Mitev
Hello, While working on the following dEQP failing tests I ran into an issue that I think deserves clarification from more experienced people: dEQP-GLES3.functional.negative_api.texture.compressedteximage2d_invalid_buffer_target

[Mesa-dev] [PATCH] mesa: Check that draw buffers are valid for glDrawBuffers on GLES3

2015-02-19 Thread Eduardo Lima Mitev
Section 4.2 (Whole Framebuffer Operations) of the OpenGL 3.0 specification says: Each buffer listed in bufs must be BACK, NONE, or one of the values from table 4.3 (NONE, COLOR_ATTACHMENTi). Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.draw_buffers ---

Re: [Mesa-dev] [PATCH v2] mesa: Check first that draw buffers are valid for glDrawBuffers on GLES3

2015-02-19 Thread Eduardo Lima Mitev
On 02/18/2015 09:09 PM, Matt Turner wrote: On Tue, Jan 13, 2015 at 3:29 AM, Eduardo Lima Mitev el...@igalia.com wrote: This patch was updated and is pending review. I think we're waiting on a new version with Tapani's comment addressed. The patch looks right, FWIW. Hi Matt, I

[Mesa-dev] [PATCH 1/8 v3] mesa: Add missing error checks to GetProgramInfoLog, GetShaderInfoLog and GetProgramiv

2015-02-14 Thread Eduardo Lima Mitev
Fixes 3 dEQP tests: * dEQP-GLES3.functional.negative_api.state.get_program_info_log * dEQP-GLES3.functional.negative_api.state.get_shader_info_log * dEQP-GLES3.functional.negative_api.state.get_programiv --- src/mesa/main/shaderapi.c | 38 -- 1 file changed, 32

[Mesa-dev] [PATCH 04/11 v2] mesa: Add missing error checks to GetProgramInfoLog, GetShaderInfoLog and GetProgramiv

2015-02-13 Thread Eduardo Lima Mitev
Fixes 3 dEQP tests: * dEQP-GLES3.functional.negative_api.state.get_program_info_log * dEQP-GLES3.functional.negative_api.state.get_shader_info_log * dEQP-GLES3.functional.negative_api.state.get_programiv --- src/mesa/main/shaderapi.c | 92 +++ 1 file

Re: [Mesa-dev] [PATCH] arb_occlusion_query2: expect an error when target mismatch in glBeginQuery()

2015-02-11 Thread Eduardo Lima Mitev
On 02/11/2015 12:28 AM, Emil Velikov wrote: I'm guessing that this was meant for the piglit ML - Cc-ing it :) Oh, sorry for the mistake and thank you Emil! cheers, Eduardo ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org

[Mesa-dev] [PATCH 08/11] mesa: Return INVALID_OPERATION when querying a never bound Query obj

2015-02-10 Thread Eduardo Lima Mitev
Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 states: The command void GenQueries( sizei n, uint *ids ); returns n previously unused query object names in ids. These names are marked as used, for the purposes of GenQueries only, but no object is associated with them until the

[Mesa-dev] [PATCH 07/11] i965: Make sure we always mark array surfaces as such

2015-02-10 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Even if they only have one slice, otherwise textureSize() won't produce correct results for the depth value. Fixes 10 dEQP tests in this category: dEQP-GLES3.functional.shaders.texture_functions.texturesize.sampler2darray* ---

[Mesa-dev] [PATCH 01/11] i965: Fix ctx-Texture.CubeMapSeamless

2015-02-10 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com The intel driver code, and apparently all other Mesa drivers, call _mesa_initialize_context early in the CreateContext hook. That function will end up calling _mesa_init_texture which will do: ctx-Texture.CubeMapSeamless = _mesa_is_gles3(ctx); But this

[Mesa-dev] [PATCH 05/11] mesa: Fix error validating args for TexSubImage3D

2015-02-10 Thread Eduardo Lima Mitev
The zoffset and depth values were not being considered when calling error_check_subtexture_dimensions(). Fixes 2 dEQP tests: * dEQP-GLES3.functional.negative_api.texture.texsubimage3d_neg_offset * dEQP-GLES3.functional.negative_api.texture.texsubimage3d_invalid_offset ---

[Mesa-dev] [PATCH 06/11] mesa: Add _mesa_is_array_texture helper

2015-02-10 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com --- src/mesa/main/teximage.c | 22 ++ src/mesa/main/teximage.h | 3 +++ 2 files changed, 25 insertions(+) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index c9c48bb..f0d0ef0 100644 --- a/src/mesa/main/teximage.c

[Mesa-dev] [PATCH 09/11] i965: Fix non-AA wide line rendering with fractional line widths

2015-02-10 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com From 14.5.2.2. Wide Lines of the OpenGL spec 4.5: (...)Let w be the width rounded to the nearest integer (...). If the line segment has endpoints given by (x0,y0) and (x1,y1) in window coordinates, the segment with endpoints (x0,y0-(w-1)/2) and

[Mesa-dev] [PATCH 10/11] mesa: Return error if BeginQuery is called with an existing object of different type

2015-02-10 Thread Eduardo Lima Mitev
Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 spec states: BeginQuery generates an INVALID_OPERATION error if any of the following conditions hold: [...] id is the name of an existing query object whose type does not match target; [...] Similar wording exists in the

[Mesa-dev] [PATCH 11/11] i965: Fix textureSize for Lod 0 with non-mipmap filters

2015-02-10 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Currently, when the MinFilter is GL_LINEAR or GL_NEAREST we hide the actual miplevel count from the hardware (and we avoid re-creating the miptree structure with all the levels), since we don't expect levels other than the base level to be needed.

[Mesa-dev] [PATCH 03/11] mesa: Return INVALID_ENUM in glClearBufferiv() when buffer is not color or stencil

2015-02-10 Thread Eduardo Lima Mitev
Section 4.2.3 Clearing the Buffers, page 190 of the OpenGL ES 3.0.4 spec says: ClearBufferiv generates an INVALID_ENUM error if buffer is not COLOR or STENCIL. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.clear_bufferiv --- src/mesa/main/clear.c | 13 + 1 file

[Mesa-dev] [PATCH 00/11] More patches fixing dEQP test fails

2015-02-10 Thread Eduardo Lima Mitev
/2015-February/076472.html Eduardo Lima Mitev (5): mesa: Return INVALID_ENUM in glClearBufferiv() when buffer is not color or stencil mesa: Add missing error checks to GetProgramInfoLog, GetShaderInfoLog and GetProgramiv mesa: Fix error validating args for TexSubImage3D mesa: Return

Re: [Mesa-dev] [PATCH] arb_occlusion_query2: expect an error when target mismatch in glBeginQuery()

2015-02-09 Thread Eduardo Lima Mitev
As a heads-up, with this patch piglit fails the test for current Mesa. But I'm about to send another series of patches for dEQP tests which include a fix in Mesa for this issue. The piglit test in question is: bin/arb_occlusion_query2-api -auto -fbo Eduardo On 02/10/2015 08:48 AM, Eduardo Lima

[Mesa-dev] [PATCH] arb_occlusion_query2: expect an error when target mismatch in glBeginQuery()

2015-02-09 Thread Eduardo Lima Mitev
From the OpenGL ES 3.0.0 spec, section 2.13. ASYNCHRONOUS QUERIES, page 82: BeginQuery generates an INVALID_OPERATION error if any of the following conditions hold: [...]; id is the name of an existing query object whose type does not match target; [...] OpenGL 3.3 spec has similar

Re: [Mesa-dev] [PATCH 05/11] mesa: Validate internal format and format type first to provide accurate error code

2015-01-27 Thread Eduardo Lima Mitev
On 01/21/2015 03:26 AM, Anuj Phogat wrote: On Mon, Jan 19, 2015 at 3:32 AM, Eduardo Lima Mitev el...@igalia.com wrote: The specification states that glTexImage2D and glTexImage3D should return GL_INVALID_VALUE if the internal format is invalid, and GL_INVALID_ENUM is the format type is invalid

[Mesa-dev] [PATCH 01/11 v2] mesa: Returns a GL_INVALID_VALUE error on several APIs when buffer size is negative

2015-01-21 Thread Eduardo Lima Mitev
Section 2.3.1 (Errors) of the OpenGL 4.5 spec says: If a negative number is provided where an argument of type sizei or sizeiptr is specified, an INVALID_VALUE error is generated. This patch adds checks for negative buffer size values passed to different APIs. It also moves up the check

Re: [Mesa-dev] [PATCH 01/11] mesa: Returns a GL_INVALID_VALUE error on several glGet* APIs when max length is negative

2015-01-20 Thread Eduardo Lima Mitev
Thank you Erik and Ian for taking a look to the patch. On 01/20/2015 03:52 AM, Ian Romanick wrote: On 01/19/2015 03:32 AM, Eduardo Lima Mitev wrote: The manual page for glGetAttachedShaders, glGetShaderSource, glGetActiveUniform and glGetActiveUniform state that a GL_INVALID_VALUE

[Mesa-dev] [PATCH 09/11 v2] mesa: Allow querying for GL_PRIMITIVE_RESTART_FIXED_INDEX under GLES 3

2015-01-20 Thread Eduardo Lima Mitev
GLES 3.0.0 spec introduces context state PRIMITIVE_RESTART_FIXED_INDEX (2.8.1 Transferring Array Elements, page 26) which is not currently possible to query using glGet*() funcs. Fixes 4 dEQP tests: * dEQP-GLES3.functional.state_query.boolean.primitive_restart_fixed_index_getboolean *

[Mesa-dev] [PATCH 05/11] mesa: Validate internal format and format type first to provide accurate error code

2015-01-19 Thread Eduardo Lima Mitev
The specification states that glTexImage2D and glTexImage3D should return GL_INVALID_VALUE if the internal format is invalid, and GL_INVALID_ENUM is the format type is invalid. However, current error check only considers the combination of format, type and internal format; which returns a

[Mesa-dev] [PATCH 10/11] glsl: Improve precision of mod(x,y)

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Currently, Mesa uses the lowering pass MOD_TO_FRACT to implement mod(x,y) as y * fract(x/y). This implementation has a down side though: it introduces precision errors due to the fract() operation. Even worse, since the result of fract() is multiplied by

[Mesa-dev] [PATCH 02/11] glsl: Add link time checks for GLSL precision qualifiers

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Currently, we only consider precision qualifiers at compile-time. This patch adds precision information to ir_variable so we can also do link time checks. Specifically, from the GLSL ES3 spec, 4.5.3 Precision Qualifiers: The same uniform declared in

[Mesa-dev] [PATCH 00/11] Another series of patches fixing dEQP failing tests

2015-01-19 Thread Eduardo Lima Mitev
Eduardo Lima Mitev (3): mesa: Returns a GL_INVALID_VALUE error on several glGet* APIs when max length is negative mesa: Validate internal format and format type first to provide accurate error code mesa: Allow querying for GL_PRIMITIVE_RESTART_FIXED_INDEX under GLES 3 Iago Toral

[Mesa-dev] [PATCH 01/11] mesa: Returns a GL_INVALID_VALUE error on several glGet* APIs when max length is negative

2015-01-19 Thread Eduardo Lima Mitev
The manual page for glGetAttachedShaders, glGetShaderSource, glGetActiveUniform and glGetActiveUniform state that a GL_INVALID_VALUE is returned if the maximum length argument is less than zero. For reference, see: https://www.opengl.org/sdk/docs/man3/xhtml/glGetAttachedShaders.xml,

[Mesa-dev] [PATCH 03/11] i965: Fix negate with unsigned integers

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com For code such as: uint tmp1 = uint(in0); uint tmp2 = -tmp1; float out0 = float(tmp2); We produce code like: mov(8)g51.xF-g94,4,1.xUD which does not produce correct results. This code produces the results we would expect if tmp1 and tmp2 were

[Mesa-dev] [PATCH 06/11] glsl: can't have 'const' qualifier used with struct or interface block members

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Fixes the following 2 dEQP tests: dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_const_vertex dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_const_fragment --- src/glsl/ast_to_hir.cpp | 7

[Mesa-dev] [PATCH 11/11] mesa: fix error value in GetFramebufferAttachmentParameteriv for OpenGL ES 3.0

2015-01-19 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com Section 6.1.13 Framebuffer Object Queries of OpenGL ES 3.0 spec: If the default framebuffer is bound to target, then attachment must be BACK, identifying the color buffer; DEPTH, identifying the depth buffer; or STENCIL, identifying the

[Mesa-dev] [PATCH 04/11] glsl: interface blocks must be declared at global scope

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Fixes the following 2 dEQP tests: dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_in_main_vertex dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_in_main_fragment --- src/glsl/ast_to_hir.cpp | 8

[Mesa-dev] [PATCH 07/11] glsl: error out on empty declarations

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com So far we have only been emitting a warning. Fixes the following 2 dEQP tests: dEQP-GLES3.functional.shaders.arrays.invalid.empty_declaration_without_var_name_vertex

[Mesa-dev] [PATCH 08/11] glsl: GLSL ES identifiers cannot exceed 1024 characters

2015-01-19 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com Fixes the following 2 dEQP tests: dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_vertex dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_fragment --- src/glsl/glsl_parser.yy | 7 +++ 1 file changed, 7

[Mesa-dev] [PATCH 09/11] mesa: Allow querying for GL_PRIMITIVE_RESTART_FIXED_INDEX under GLES 3

2015-01-19 Thread Eduardo Lima Mitev
GLES 3.0.0 spec introduces context state PRIMITIVE_RESTART_FIXED_INDEX (2.8.1 Transferring Array Elements, page 26) which is not currently possible to query using glGet*() funcs. Fixes 4 dEQP tests: * dEQP-GLES3.functional.state_query.boolean.primitive_restart_fixed_index_getboolean *

Re: [Mesa-dev] [PATCH] mesa: Adds check for integer internal formal and num samples in glRenderbufferStorageMultisample

2015-01-13 Thread Eduardo Lima Mitev
I updated this patch as commented and it is now pending review again. Thanks, Eduardo On 12/15/2014 11:30 AM, Eduardo Lima Mitev wrote: Per GLES3 specification, section 4.4 Framebuffer objects page 198, If internalformat is a signed or unsigned integer format and samples is greater than zero

Re: [Mesa-dev] [PATCH v2] mesa: Check first that draw buffers are valid for glDrawBuffers on GLES3

2015-01-13 Thread Eduardo Lima Mitev
This patch was updated and is pending review. Thanks, Eduardo On 12/15/2014 11:47 AM, Eduardo Lima Mitev wrote: Section 4.2 (Whole Framebuffer Operations) of the OpenGL 3.0 specification says Each buffer listed in bufs must be BACK, NONE, or one of the values from table 4.3 (NONE

<    3   4   5   6   7   8   9   >