summaryrefslogtreecommitdiff
path: root/src/mesa/main/program_resource.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-01mesa: Add MESA_VERBOSE=api for GL_ARB_program_interface_queryJordan Justen1-0/+39
v2: * Add braces '{}' when the _mesa_debug call spans multiple lines (Ken) Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-28main: fix GL_MAX_NUM_ACTIVE_VARIABLES value for shader storage blocksSamuel Iglesias Gonsalvez1-1/+20
The maximum number of active variables for shader storage blocks should take into account the specific rules for shader storage blocks, i.e. for an active shader storage block member declared as an array, an entry will be generated only for the first array element, regardless of its type. Fixes 3 dEQP-GLES31.functional.* tests: dEQP-GLES31.functional.program_interface_query.shader_storage_block.active_variables.named_block dEQP-GLES31.functional.program_interface_query.shader_storage_block.active_variables.unnamed_block dEQP-GLES31.functional.program_interface_query.shader_storage_block.active_variables.block_array Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-09-29mesa: fix ARRAY_SIZE query for GetProgramResourceivTapani Pälli1-5/+3
Patch also refactors name length queries which were using array size in computation, this has to be done in same time to avoid regression in arb_program_interface_query-resource-query Piglit test. Fixes rest of the failures with ES31-CTS.program_interface_query.no-locations v2: make additional check only for GS inputs v3: create helper function for resource name length so that it gets calculated only in one place Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2015-09-25main: Add SHADER_STORAGE_BLOCK and BUFFER_VARIABLE support for ↵Samuel Iglesias Gonsalvez1-2/+5
ARB_program_interface_query Including TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE queries. v2: - Use std430_array_stride() to get top level array stride following std430's rules. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2015-08-05mesa: do not modify args when errors with GetProgramResourceNameTapani Pälli1-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 <tapani.palli@intel.com> Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2015-07-30mesa: remove now unused subscript validationsTimothy Arceri1-51/+0
Cc: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-07-30mesa: fix and simplify resource query for arraysTimothy Arceri1-8/+6
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 <tapani.palli@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-07-23program_resource: add subroutine support (v3.1)Dave Airlie1-22/+78
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 <kenneth@whitecape.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-07-20mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke1-10/+10
Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com>
2015-05-20mesa/main: validate name syntax for array variables onlySamuel Iglesias Gonsalvez1-3/+3
From ARB_program_interface_query: "Note that if an interface enumerates a single active resource list entry for an array variable (e.g., "a[0]"), a <name> identifying any array element other than the first (e.g., "a[1]") is not considered to match." It doesn't apply to arrays of interface blocks but just to array variables. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-04-16mesa: implementation of glGetProgramResourceivTapani Pälli1-0/+22
Patch adds required helper functions to shaderapi.h and the actual implementation. The property query functionality can be tested with tests for following functions that are refactored by later patches: GetActiveAtomicCounterBufferiv GetActiveUniformBlockiv GetActiveUniformsiv v2: code cleanup (Ilia Mirkin) add bufSize < 0 check and error out fix is_resource_referenced to return bool check for propCount and bufSize, fixes in buffer_prop Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2015-04-16mesa: glGetProgramResourceLocationIndexTapani Pälli1-1/+24
Patch adds required helper functions to shaderapi.h and the actual implementation. The added functionality can be tested by tests for following functions that are refactored by later patches: GetFragDataIndex v2: return -1 if output not referenced by fragment stage (Ilia Mirkin) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2015-04-16mesa: glGetProgramResourceLocationTapani Pälli1-1/+80
Patch adds required helper functions to shaderapi.h and the actual implementation. corresponding Piglit test: arb_program_interface_query-resource-location The added functionality can be tested by tests for following functions that are refactored by later patches: GetAttribLocation GetUniformLocation GetFragDataLocation v2: code cleanup, changes to array element syntax checking (Ilia Mirkin) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2015-04-16mesa: glGetProgramResourceNameTapani Pälli1-0/+23
Patch adds required helper functions to shaderapi.h and the actual implementation. Name generation copied from '_mesa_get_uniform_name' which can be removed later by refactoring functions to use resource list. The added functionality can be tested by tests for following functions that are refactored by later patches: GetActiveUniformName GetActiveUniformBlockName v2: no index for geometry shader inputs (Ilia Mirkin) add bufSize < 0 check and error out validate enum corresponding Piglit test: arb_program_interface_query-getprogramresourcename Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.org>
2015-04-16mesa: glGetProgramResourceIndexTapani Pälli1-1/+84
Patch adds required helper functions to shaderapi.h and the actual implementation. v2: code cleanup (Ilia Mirkin) corresponding Piglit test: arb_program_interface_query-getprogramresourceindex Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.org>
2015-04-16mesa: glGetProgramInterfaceivTapani Pälli1-0/+119
Patch adds required helper functions to shaderapi.h and the actual implementation. v2: code cleanup (Ilia Mirkin) fix array size fo xfb varyings validate programInterface and throw error v3: put GL_MAX_NUM_COMPATIBLE_SUBROUTINES where it belongs corresponding Piglit test: arb_program_interface_query-getprograminterfaceiv Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2015-04-16glapi: add GL_ARB_program_interface_query skeletonTapani Pälli1-0/+68
v2: update dispatch_sanity test (Jason Ekstrand) + small code cleanups v3: xml and Makefile fixes (Ilia Mirkin, Matt Turner) Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>