[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
://android.googlesource.com/platform/external/deqp/ Patch summary: Eduardo Lima Mitev (4): mesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO invalidation under GLES3 mesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0 mesa: Returns zero samples when

[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 00/10] Various fixes for dEQP failing tests

2014-12-02 Thread Eduardo Lima Mitev
On 12/01/2014 05:29 PM, Brian Paul wrote: 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]. [...] The non-GLSL changes look good to me and are: Reviewed-by: Brian Paul bri...@vmware.com The GLSL changes

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

2014-12-02 Thread Eduardo Lima Mitev
On 12/02/2014 01:31 PM, Tapani Pälli wrote: AFAICS this restriction is lifted in ES 3.0+ (e.g. see section 3.9.2 in the OpenGL ES 3.0 spec). Yep, it seems this check should be against earlier versions and only when not having extensions that allow MRT enabled (NV_draw_buffers). Hi, Yes,

[Mesa-dev] [PATCH] glsl: don't allow invariant qualifiers for interface blocks

2014-12-09 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com GLSL 1.50 and GLSL 4.40 specs, they both say the same in Interface Blocks section: If no optional qualifier is used in a member-declaration, the qualification of the member includes all in, out, patch, uniform, or buffer as determined by

[Mesa-dev] [PATCH 00/16] More fixes for dEQP failing tests

2014-12-11 Thread Eduardo Lima Mitev
://github.com/Igalia/mesa/tree/deqp-fixes-batch2-rebased There are not known piglit regressions with this series. cheers, Eduardo Lima Patch summary: Eduardo Lima Mitev (9): i965: Sets missing vertex shader constant values for HighInt format mesa: Check first that draw buffers are valid

[Mesa-dev] [PATCH 01/16] i965: Sets missing vertex shader constant values for HighInt format

2014-12-11 Thread Eduardo Lima Mitev
The range's min and max, and the precision value are not set correctly for the vertex shader constants. Fixes 1 dEQP test: dEQP-GLES3.functional.state_query.shader.precision_vertex_highp_int --- src/mesa/drivers/dri/i965/brw_context.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[Mesa-dev] [PATCH 00/16] More fixes for dEQP failing tests

2014-12-11 Thread Eduardo Lima Mitev
://github.com/Igalia/mesa/tree/deqp-fixes-batch2-rebased There are not known piglit regressions with this series. cheers, Eduardo Lima Patch summary: Eduardo Lima Mitev (9): i965: Sets missing vertex shader constant values for HighInt format mesa: Check first that draw buffers are valid

[Mesa-dev] [PATCH 06/16] glsl: fix assignment of multiple scalar and vecs to matrices.

2014-12-11 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com When a vec has more elements than row components in a matrix, the code could end up failing an assert inside assign_to_matrix_column(). This patch makes sure that when there is still room in the matrix for more elements (but in other columns

[Mesa-dev] [PATCH 05/16] i965: Fix bitcast operations with negate

2014-12-11 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com For code such as this in a vertex or fragment shader: uniform float in0; flat out float out0; ... out0 = ceil(in0) We generate this IR: (assign (x) (var_ref packed:out0) (expression int bitcast_f2i (expression float ceil (var_ref in0) ) ) )

[Mesa-dev] [PATCH 03/16] mesa: Clamps the stencil value masks to GLint when queried

2014-12-11 Thread Eduardo Lima Mitev
Stencil value masks values (ctx-Stencil.ValueMask[]) stores GLuint values which are initialized with max unsigned integer (~0u). When these values are queried by glGet* (GL_STENCIL_VALUE_MASK or GL_STENCIL_BACK_VALUE_MASK), they are converted to a signed integer. Currently, these values overflow

[Mesa-dev] [PATCH 04/16] mesa: Depth ans stencil attachments must be the same in OpenGL ES3

2014-12-11 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com From the OpenGL ES3 spec: 9.4. FRAMEBUFFER COMPLETENESS ... Depth and stencil attachments, if present, are the same image. ... Notice that this restriction is not included in the OpenGL ES2 spec. Fixes 18 dEQP tests in:

[Mesa-dev] [PATCH 12/16] mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteRenderbuffers is negative

2014-12-11 Thread Eduardo Lima Mitev
Per GLES3 manual for glDeleteRenderbuffers https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteRenderbuffers.xhtml, GL_INVALID_VALUE is generated if n is negative. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.delete_renderbuffers --- src/mesa/main/fbobject.c | 5 +

[Mesa-dev] [PATCH 08/16] main: round floating-point value to nearest integer in glGetTexParameteriv()

2014-12-11 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com Previously, a cast was done to convert from float to int but there were rounding errors. The spec specificies in Data Conversion chapter that Floating-point values are rounded to the nearest integer. This patch fixes the following 8 dEQP

[Mesa-dev] [PATCH 15/16] mesa: Fix error reporting for some cases of incomplete FBO attachments

2014-12-11 Thread Eduardo Lima Mitev
From: Iago Toral Quiroga ito...@igalia.com According to the OpenGL and OpenGL ES specs (sections FRAMEBUFFER COMPLETENESS and Whole Framebuffer Completeness), the image for color, depth or stencil attachments must be renderable, otherwise the attachment is considered incomplete and we should

[Mesa-dev] [PATCH 09/16] main: round floating-point value to nearest integer in glGetSamplerParameteriv()

2014-12-11 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com Previously, a cast was done to convert from float to int but there were rounding errors. The spec specificies in Data Conversion chapter that Floating-point values are rounded to the nearest integer. This patch fixes the following 2 dEQP

[Mesa-dev] [PATCH 07/16] main: fix return GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL value

2014-12-11 Thread Eduardo Lima Mitev
From: Samuel Iglesias Gonsalvez sigles...@igalia.com Return the proper value for two-dimensional array texture and three-dimensional textures. From OpenGL ES 3.0 spec, chapter 6.1.13 Framebuffer Object Queries, page 234: If pname is FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER and the texture object

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

2014-12-11 Thread Eduardo Lima Mitev
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, then the error INVALID_OPERATION is generated.. Fixes 1 dEQP test: *

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

2014-12-11 Thread Eduardo Lima Mitev
Fixes 1 dEQP test: dEQP-GLES3.functional.negative_api.buffer.draw_buffers --- src/mesa/main/buffers.c | 31 +++ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 1ee2009..0f40739 100644 ---

[Mesa-dev] [PATCH 10/16] mesa: Allows querying GL_SAMPLER_BINDING on GLES3 profile

2014-12-11 Thread Eduardo Lima Mitev
From GLES3 specification (page 123), The currently bound sampler may be queried by calling GetIntegerv with pname set to SAMPLER_BINDINGGL_SAMPLER_BINDING. Fixes 4 dEQP tests: * dEQP-GLES3.functional.state_query.integers.sampler_binding_getboolean *

[Mesa-dev] [PATCH 11/16] mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteFramebuffers is negative

2014-12-11 Thread Eduardo Lima Mitev
Per GLES3 manual for glDeleteFramebuffers https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteFramebuffers.xhtml, GL_INVALID_VALUE is generated if n is negative. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.delete_framebuffers --- src/mesa/main/fbobject.c | 5 + 1

[Mesa-dev] [PATCH 14/16] mesa: Returns a GL_INVALID_VALUE error if num of texs in glDeleteTextures is negative

2014-12-11 Thread Eduardo Lima Mitev
Per GLES3 manual for glDeleteTextures https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTextures.xhtml, GL_INVALID_VALUE is generated if n is negative. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.texture.deletetextures --- src/mesa/main/texobj.c | 5 + 1 file changed, 5

[Mesa-dev] [PATCH 16/16] mesa: Returns correct error values from gl(Get)SamplerParameter*() in GLES3

2014-12-11 Thread Eduardo Lima Mitev
Per GLES specification, the family of functions glGetSamplerParameter(iv/fv) and glSamplerParameter(i/f/iv/fv) return an INVALID_OPERATION error if sampler is not the name of a sampler object previously returned from a call to GenSamplers. In desktop GL, an GL_INVALID_VALUE is returned instead.

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

2014-12-15 Thread Eduardo Lima Mitev
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, then the error INVALID_OPERATION is generated.. Fixes 1 dEQP test: *

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

2014-12-15 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). This patch adds this check before previous other, more complex validation steps. Fixes 1 dEQP test:

Re: [Mesa-dev] [PATCH 00/16] More fixes for dEQP failing tests

2014-12-15 Thread Eduardo Lima Mitev
On 12/15/2014 12:21 PM, Emil Velikov wrote: Above you've mentioned test failures were gathered ... against 10.3.3, which brings the question: Should we include those in either one of the 10.3 and 10.4 stable branches ? Or are they so insignificant/trivial that we don't expect (m)any

Re: [Mesa-dev] [PATCH 03/16] mesa: Clamps the stencil value masks to GLint when queried

2014-12-15 Thread Eduardo Lima Mitev
On 12/12/2014 03:18 AM, Ian Romanick wrote: On 12/11/2014 02:34 PM, Eduardo Lima Mitev wrote: Stencil value masks values (ctx-Stencil.ValueMask[]) stores GLuint values which are initialized with max unsigned integer (~0u). When these values are queried by glGet* (GL_STENCIL_VALUE_MASK

[Mesa-dev] [PATCH v2] mesa: Initializes the stencil value masks to 0xFF instead of ~0u

2014-12-15 Thread Eduardo Lima Mitev
4.1.4 Stencil Test section of the GLES3 spec says: In the initial state, [...] the front and back stencil mask are both set to the value 2 s − 1, where s is greater than or equal to the number of bits in the deepest stencil buffer* supported by the GL implementation. Since the maximum supported

Re: [Mesa-dev] [PATCH v2] mesa: Initializes the stencil value masks to 0xFF instead of ~0u

2014-12-15 Thread Eduardo Lima Mitev
On 12/15/2014 08:30 PM, Ian Romanick wrote: On 12/15/2014 08:04 AM, Eduardo Lima Mitev wrote: Since the maximum supported precision for stencil buffers is 8 bits, mask values should be initialized to 2^8 - 1 = 0xFF. Currently, these masks are initialized to max unsigned integer (~0u), which

[Mesa-dev] [PATCH] mesa: Returns correct error values from gl(Get)SamplerParameter*() on GL-ES 3.0+

2014-12-16 Thread Eduardo Lima Mitev
'3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states: An INVALID_OPERATION error is generated if sampler is not the name of a sampler object previously returned from a call to GenSamplers. In desktop GL, an GL_INVALID_VALUE is returned instead. Fixes 6 dEQP failing

Re: [Mesa-dev] [PATCH v2] mesa: Initializes the stencil value masks to 0xFF instead of ~0u

2014-12-16 Thread Eduardo Lima Mitev
On 12/16/2014 01:18 PM, Olivier Galibert wrote: Note that ~0U is perfectly correct w.r.t the GLES3 spec. It just means that s=32, which happens to be greater or equal to 8. True, it doesn't violate the spec. But since that causes the overflow (which is the original problem we are trying to

Re: [Mesa-dev] [PATCH 00/16] More fixes for dEQP failing tests

2014-12-17 Thread Eduardo Lima Mitev
On 12/11/2014 11:34 PM, Eduardo Lima Mitev wrote: This is the second series of patches fixing over 90 (unrelated) dEQP failing tests. Again, the test failures were gathered on i965 (gen8) against 10.3.3, but there are several driver and version agnostic fixes. A GIT tree with these patches

Re: [Mesa-dev] [PATCH 03/16] mesa: Clamps the stencil value masks to GLint when queried

2014-12-18 Thread Eduardo Lima Mitev
On 12/18/2014 09:55 AM, Olivier Galibert wrote: Something is not clear to me: In which way -1 is incorrect? Hi Olivier, The values being queried are the front and back stencil masks. Masks are (conceptually?) an unsigned integer, AFAIU. Also, the test I'm trying to fix fails precisely because

Re: [Mesa-dev] [PATCH 03/16] mesa: Clamps the stencil value masks to GLint when queried

2014-12-18 Thread Eduardo Lima Mitev
On 12/18/2014 10:28 AM, Eduardo Lima Mitev wrote: On 12/18/2014 09:55 AM, Olivier Galibert wrote: Something is not clear to me: In which way -1 is incorrect? Hi Olivier, The values being queried are the front and back stencil masks. Masks are (conceptually?) an unsigned integer, AFAIU

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 *

[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

[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 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

[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] [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

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

Re: [Mesa-dev] [PATCH] mesa: Returns correct error values from gl(Get)SamplerParameter*() on GL-ES 3.0+

2015-01-05 Thread Eduardo Lima Mitev
On 12/16/2014 09:15 AM, Eduardo Lima Mitev wrote: '3.8.2 Sampler Objects' section of the GL-ES 3.0 specification states: An INVALID_OPERATION error is generated if sampler is not the name of a sampler object previously returned from a call to GenSamplers. In desktop GL

Re: [Mesa-dev] [PATCH] mesa: Accepts GL_RGB and GL_RGBA as valid internal formats only when querying

2015-01-12 Thread Eduardo Lima Mitev
On 01/09/2015 04:50 PM, Eduardo Lima Mitev wrote: Previous patch 78942787170615c9333810cf3a4819a13c9eb8e8 globally introduced GL_RGB and GL_RGBA as valid internal formats on GLES 3.0.4, as the spec implies (page 112). However, page 205 of the spec states

[Mesa-dev] [PATCH] mesa: Accepts GL_RGB and GL_RGBA as valid internal formats only when querying

2015-01-09 Thread Eduardo Lima Mitev
Previous patch 78942787170615c9333810cf3a4819a13c9eb8e8 globally introduced GL_RGB and GL_RGBA as valid internal formats on GLES 3.0.4, as the spec implies (page 112). However, page 205 of the spec states that for RenderbufferStorageMultisample, internal format must be a sized internal format. For

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

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

[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

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 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

[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

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

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

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 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: *

[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

  1   2   3   4   5   6   7   8   9   >