summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Add missing check of format and type in glTexSubImageXD on GLES 3.0Eduardo Lima Mitev2015-08-051-47/+69
| | | | | | | | | | | | | | | | 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 on GLES into a new function texture_format_error_check_gles(), to factorize similar code in texture_format_error_check(). Fixes 2 dEQP tests: * dEQP-GLES3.functional.negative_api.texture.texsubimage2d * dEQP-GLES3.functional.negative_api.texture.texsubimage3d Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix error returned by glCopyTexImage2D() upon an invalid internal formatEduardo Lima Mitev2015-08-051-9/+9
| | | | | | | | | | | | | | | | | | | | | | | Page 161 of the OpenGL-ES 3.1 (PDF) spec, and page 207 of the OpenGL 4.5 (PDF), both on section '8.6. ALTERNATE TEXTURE IMAGE SPECIFICATION COMMANDS', states: "An INVALID_ENUM error is generated if an invalid value is specified for internalformat". It is currently returning INVALID_OPERATION error because _mesa_get_read_renderbuffer_for_format() is called before the internalformat argument has been validated. To fix this, we move this call down the validation process, after _mesa_base_tex_format() has been called. _mesa_base_tex_format() effectively serves as a validator for the internal format. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.texture.copyteximage2d_invalid_format Fixes 1 piglit test: * spec@oes_compressed_etc1_rgb8_texture@basic Reviewed-by: Ian Romanick <[email protected]> Cc: 10.6 <[email protected]>
* mesa: Validate target before resolving tex obj in glTex(ture)SubImageXDEduardo Lima Mitev2015-08-051-15/+14
| | | | | | | | | | | | | | | 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 occurs later when texsubimage_error_check() is called. This patch reorganizes target validation, taking it out from the error check function and into a point before the texture object is resolved. Reviewed-by: Ian Romanick <[email protected]> Cc: 10.6 <[email protected]>
* mesa: Fix errors values returned by glShaderBinary()Eduardo Lima Mitev2015-08-051-3/+14
| | | | | | | | | | | | | | | | | 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 SHADER_BINARY_FORMATS." Currently, an INVALID_OPERATION error is returned for all cases. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.shader.shader_binary Reviewed-by: Ian Romanick <[email protected]> Cc: 10.6 <[email protected]>
* mesa: do not modify args when errors with GetProgramResourceNameTapani Pälli2015-08-051-6/+0
| | | | | | | | | | | | Original purpose of these lines was to be more friendly against GUI tools using the extension. However conformance suite explicitly checks that buffers are not modified in error conditions. Fixes: ES31-CTS.program_interface_query.buff-length Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Use _mesa_lroundevenf() in some more places.Matt Turner2015-08-041-2/+2
|
* mesa: Replace F_TO_I() with _mesa_lroundevenf().Matt Turner2015-08-035-42/+17
| | | | | | | | | | | I'm not sure what the true meaning of "The rounding mode may vary." is, but it is the case that the IROUND() path rounds differently than the other paths (and does it wrong, at that). Like _mesa_roundeven{f,}(), just add an use _mesa_lroundeven{f,}() that has known semantics. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: fix type for array indexing validationTimothy Arceri2015-08-031-1/+1
| | | | | | | | | | | | | parse_program_resource_name returns -1 when the index is invalid this needs to be tested before assigning the value to the unsigned array_index. In link_varyings.cpp (the other place parse_program_resource_name is used) after the -1 check is done the value is just assigned to an unsigned variable so it seems long is just used so we can return the -1 rather than actually expecting index values to be ridiculously large. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow multisampled textures for GLES 3.1Marta Lofstedt2015-08-031-2/+2
| | | | | | | GLES 3.1 must be allowed to create multisampled textures. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow query of GL_TEXTURE_MULTISAMPLEMarta Lofstedt2015-08-031-1/+3
| | | | | | | GLES 3.1 must allow a query for GL_TEXTURE_MULTISAMPLE. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow enable of GL_SAMPLE_MASKMarta Lofstedt2015-08-031-1/+1
| | | | | | | GLES 3.1 must be able to enable GL_SAMPLE_MASK. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow textures with target GL_TEXTURE_2D_MULTISAMPLEMarta Lofstedt2015-08-032-3/+3
| | | | | | | | GLES 3.1 should be able to bind a texture with the target GL_TEXTURE_2D_MULTISAMPLE. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow GL_DEPTH_STENCIL_TEXTURE_MODEMarta Lofstedt2015-08-031-1/+3
| | | | | | | GLES 3.1 must support the parameter GL_DEPTH_STENCIL_TEXTURE_MODE. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow GL_SAMPLE_MASKMarta Lofstedt2015-08-031-1/+1
| | | | | | | GLES 3.1 should be allowed to enable GL_SAMPLE_MASK. Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Allow binding GL_DRAW_INDIRECT_BUFFER with gles 3.1Marta Lofstedt2015-08-031-2/+3
| | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: remove now unused _mesa_get_uniform_locationTimothy Arceri2015-07-302-79/+0
| | | | | Cc: Tapani Pälli <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: remove now unused subscript validationsTimothy Arceri2015-07-302-108/+0
| | | | | Cc: Tapani Pälli <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: fix and simplify resource query for arraysTimothy Arceri2015-07-305-92/+106
| | | | | | | | | | | | | | | | | | | | | | This removes the need for multiple functions designed to validate an array subscript and replaces them with a call to a single function. The change also means that validation is now only done once and the index is retrived at the same time, as a result the getUniformLocation code can be simplified saving an extra hash table lookup (and yet another validation call). This chage also fixes some tests in: ES31-CTS.program_interface_query.uniform V3: rebase on subroutines, and move the resource index array == 0 check into _mesa_GetProgramResourceIndex() to simplify things further V2: Fix bounds checks for program input/output, split unrelated comment fix and _mesa_get_uniform_location() removal into their own patch. Cc: Tapani Pälli <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* Delete unused functions in format parserAnuj Phogat2015-07-291-7/+0
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
* Delete duplicate function is_power_of_two() and use _mesa_is_pow_two()Anuj Phogat2015-07-291-11/+0
| | | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Avoid double promotion.Matt Turner2015-07-2913-47/+47
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Use floats for viewport bounds.Matt Turner2015-07-292-8/+8
| | | | | | | | | | | | | | | | | | ARB_viewport_array specifies that DEPTH_RANGE consists of double- precision parameters (corresponding commit d4dc35987), and a preparatory commit (6340e609a) added _mesa_get_viewport_xform() which returned double-precision scale[3] and translate[3] vectors, even though X, Y, Width, and Height were still floats. All users of _mesa_get_viewport_xform() immediately convert the double scale and translation vectors into floats (which were floats originally, but were converted to doubles in _mesa_get_viewport_xform(), sigh). i965 at least cannot consume doubles (see SF_CLIP_VIEWPORT). If we want to pass doubles to hardware, we should have a different function that does that. Acked-by: Mathias Froehlich <[email protected]>
* mesa/es3.1: enable GL_ARB_explicit_uniform_location for GLES 3.1Marta Lofstedt2015-07-292-1/+9
| | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa/es3.1: enable GL_ARB_compute_shader for GLES 3.1Marta Lofstedt2015-07-292-10/+16
| | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa/es3.1: enable GL_ARB_texture_gather for GLES 3.1Marta Lofstedt2015-07-292-2/+10
| | | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: enable GL_ARB_texture_multisample for GLES 3.1Marta Lofstedt2015-07-292-6/+14
| | | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: enable GL_ARB_shader_atomic_counters for GLES 3.1Marta Lofstedt2015-07-292-9/+17
| | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa/es3.1: enable GL_ARB_shader_image_load_store for GLES 3.1Marta Lofstedt2015-07-292-6/+17
| | | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/es3.1: Add ES 3.1 handling to get.c and get_hash_generator.pyMarta Lofstedt2015-07-292-5/+12
| | | | | Signed-off-by: Marta Lofstedt <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: Return INVALID_ENUM in glClearBufferiv() when buffer is not color or ↵Eduardo Lima Mitev2015-07-291-0/+12
| | | | | | | | | | | | | | | stencil Page 497 of the PDF, section '17.4.3.1 Clearing Individual Buffers' of the OpenGL 4.5 spec states: "An INVALID_ENUM error is generated by ClearBufferiv and ClearNamedFramebufferiv if buffer is not COLOR or STENCIL." Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.buffer.clear_bufferiv Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix error checking for getting zero-sized texture imagesIlia Mirkin2015-07-241-9/+9
| | | | | | | | | | | | | | | | | | Commit 17f714836 (mesa: rearrange texture error checking order) moved the width/height/depth == 0 allowance before checking if the image was there. This was in part due to depth having to be == 1 for 2D images and width having to be == 1 for 1D images. Instead relax the height/depth checks to also accept 0 as valid. With this change, bin/arb_direct_state_access-get-textures starts passing again. Fixes: 17f714836 (mesa: rearrange texture error checking order) Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix typo in a commentAnuj Phogat2015-07-241-1/+1
| | | | Signed-off-by: Anuj Phogat <[email protected]>
* mesa: Change the signature of _mesa_need_rgb_to_luminance_conversion()Anuj Phogat2015-07-242-14/+17
| | | | | | | | | This allows us to handle cases when texImage->_BaseFormat doesn't match _mesa_format_get_base_format(texImage->Format). _BaseFormat is what we care about in this function. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Add a helper function _mesa_need_luminance_to_rgb_conversion()Anuj Phogat2015-07-242-0/+22
| | | | | | Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Add a helper function _mesa_unpack_format_to_base_format()Anuj Phogat2015-07-242-0/+47
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Turn get_readpixels_transfer_ops() in to a global functionAnuj Phogat2015-07-242-7/+15
| | | | | | | | This utility function is utilized in a later patch. Cc: <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: minor clean-ups in shaderapi.cBrian Paul2015-07-231-7/+10
| | | | 80-column wrapping. Move break statements. Indentation fixes.
* mesa: fix _mesa_error() compiler warnings in shaderapi.cBrian Paul2015-07-231-33/+33
| | | | | | | | | | | | | | Fix many instances of: main/shaderapi.c: In function '_mesa_GetSubroutineUniformLocation': main/shaderapi.c:2176:7: warning: format not a string literal and no format arguments [-Wformat-security] _mesa_error(ctx, GL_INVALID_OPERATION, api_name); ^ Ideally, many of these error messages should be improved to indicate which argument is incorrect as we do in other parts of Mesa. Reviewed-by: Kai Wasserbäch <[email protected]> Tested-by: Kai Wasserbäch <[email protected]>
* mesa: do more thorough target checking in compressed_subtexture_target_check()Brian Paul2015-07-231-26/+40
| | | | | | | When we're error-checking the target, we also need to check if the corresponding extension is supported. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: another target fix in compressed_subtexture_target_check()Brian Paul2015-07-231-1/+8
| | | | | | | | | | | | | The previous fix added GL_TEXTURE_CUBE_MAP_ARRAY but we also need to support GL_TEXTURE_CUBE_MAP (via DSA). So in the end, GL_TEXTURE_3D is the only (legal) target for glCompressedTex*SubImage3D() which needs additional compression format checking. GL_TEXTURE_2D_ARRAY, GL_TEXTURE_CUBE_MAP_ARRAY and GL_TEXTURE_CUBE_MAP are basically 2D images which support all compressed formats. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: simplify format check in compressed_subtexture_target_check()Brian Paul2015-07-231-14/+10
| | | | | | Lose the invalidformat local variable. Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: initialize variables to silence compiler warningsBrian Paul2015-07-232-3/+3
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* mesa: rearrange texture error checking orderIlia Mirkin2015-07-231-13/+13
| | | | | | | | | | | | | This moves the width/height/depth == 0 check to the front and avoids doing any other checking when that is the case. Also moves the dimensions check after the format/type checks so that we don't bail out with success on a width/height/depth == 0 request when the format/type don't match. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91425 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: adjust error message when there's a missing teximageIlia Mirkin2015-07-231-2/+1
| | | | | | | The current message makes it seem like the zoffset is invalid. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fix error in target validation of glCompressedTex(ture)SubImage3D() callsEduardo Lima Mitev2015-07-231-1/+2
| | | | | | | | | | | | | | 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 successful pass of the first one. Fixes 1 dEQP test: * dEQP-GLES3.functional.negative_api.texture.compressedtexsubimage3d Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: fill out the ARB_shader_subroutine APIsDave Airlie2015-07-232-3/+451
| | | | | | | | | | This fleshes out the APIs, using the program resource APIs where they should match. It also sets the default values to valid subroutines. Acked-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* program_resource: add subroutine support (v3.1)Dave Airlie2015-07-232-22/+179
| | | | | | | | | | | | | | This fleshes out the ARB_program_query support for the APIs that ARB_shader_subroutine introduces, leaving some TODOs for later addition. v2: reworked for lots of the ARB_program_interface_query entry points and tests v3: use common function to test for subroutine support v3.1: add tess, fix missing breaks Acked-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/mtypes: add gl_subroutine_function and uniform storage to shader (v2)Dave Airlie2015-07-231-0/+28
| | | | | | | | This adds the necessary storage for subroutine info to gl_shader. v2: add comments, rename one member Acked-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add function to check if shader subroutines are enabled.Dave Airlie2015-07-231-0/+9
| | | | | | | | This checks if core profile and shader subroutine extension is enabled. Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: add inline conversion functions for ARB_shader_subroutine (v2)Dave Airlie2015-07-231-0/+101
| | | | | | | | | | | This handles converting the shader stages to the internal prefix along with the program resource interfaces. v2: add tess support Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Signed-off-by: Dave Airlie <[email protected]>