diff options
author | Timothy Arceri <[email protected]> | 2015-11-28 09:16:45 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-05-01 23:13:36 +1000 |
commit | f982e2434b0b30db9401a4db62868dd357eec041 (patch) | |
tree | 3f6cd03feccee4f4dd419605a5f63f88600147c3 /src/mesa/main/shader_query.cpp | |
parent | b1c872a81e061101a69ee7054321cb5140cf2748 (diff) |
mesa: add LOCATION_COMPONENT support to GetProgramResourceiv
From Section 7.3.1.1 (Naming Active Resources) of the OpenGL 4.5 spec:
"For the property LOCATION_COMPONENT, a single integer indicating the first
component of the location assigned to an active input or output variable is
written to params. For input and output variables with a component specified
by a layout qualifier, the specified component is written. For all other
input and output variables, the value zero is written."
Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/main/shader_query.cpp')
-rw-r--r-- | src/mesa/main/shader_query.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index 2c1a6ee3505..020990ae9bf 100644 --- a/src/mesa/main/shader_query.cpp +++ b/src/mesa/main/shader_query.cpp @@ -1216,6 +1216,15 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg, default: goto invalid_operation; } + case GL_LOCATION_COMPONENT: + switch (res->Type) { + case GL_PROGRAM_INPUT: + case GL_PROGRAM_OUTPUT: + *val = RESOURCE_VAR(res)->component; + return 1; + default: + goto invalid_operation; + } case GL_LOCATION_INDEX: if (res->Type != GL_PROGRAM_OUTPUT) goto invalid_operation; |