summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/program_resource.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-11-10 19:46:11 +1100
committerTimothy Arceri <[email protected]>2017-01-19 15:55:02 +1100
commit90d950038f801551cc5b939ef31c379bccf96f5f (patch)
treebf03d13a1e15f49de1fdf31bc1341f586f31a2f0 /src/mesa/main/program_resource.c
parent62f718bfcb75ab6f8e7276d1acdea767e55feac9 (diff)
mesa/glsl: move ProgramResourceList to gl_shader_program_data
We also move NumProgramResourceList at the same time. GLES does interface validation on SSO at runtime so we need to move this to be able to switch to storing gl_program pointers in CurrentProgram. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/mesa/main/program_resource.c')
-rw-r--r--src/mesa/main/program_resource.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
index 5461c4e3f32..4b5be6f52d8 100644
--- a/src/mesa/main/program_resource.c
+++ b/src/mesa/main/program_resource.c
@@ -119,8 +119,8 @@ _mesa_GetProgramInterfaceiv(GLuint program, GLenum programInterface,
/* Validate pname against interface. */
switch(pname) {
case GL_ACTIVE_RESOURCES:
- for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++)
- if (shProg->ProgramResourceList[i].Type == programInterface)
+ for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++)
+ if (shProg->data->ProgramResourceList[i].Type == programInterface)
(*params)++;
break;
case GL_MAX_NAME_LENGTH:
@@ -135,32 +135,32 @@ _mesa_GetProgramInterfaceiv(GLuint program, GLenum programInterface,
/* Name length consists of base name, 3 additional chars '[0]' if
* resource is an array and finally 1 char for string terminator.
*/
- for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) {
- if (shProg->ProgramResourceList[i].Type != programInterface)
+ for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
+ if (shProg->data->ProgramResourceList[i].Type != programInterface)
continue;
unsigned len =
- _mesa_program_resource_name_len(&shProg->ProgramResourceList[i]);
+ _mesa_program_resource_name_len(&shProg->data->ProgramResourceList[i]);
*params = MAX2(*params, len + 1);
}
break;
case GL_MAX_NUM_ACTIVE_VARIABLES:
switch (programInterface) {
case GL_UNIFORM_BLOCK:
- for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) {
- if (shProg->ProgramResourceList[i].Type == programInterface) {
+ for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
+ if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_block *block =
(struct gl_uniform_block *)
- shProg->ProgramResourceList[i].Data;
+ shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, block->NumUniforms);
}
}
break;
case GL_SHADER_STORAGE_BLOCK:
- for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) {
- if (shProg->ProgramResourceList[i].Type == programInterface) {
+ for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
+ if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_block *block =
(struct gl_uniform_block *)
- shProg->ProgramResourceList[i].Data;
+ shProg->data->ProgramResourceList[i].Data;
GLint block_params = 0;
for (unsigned j = 0; j < block->NumUniforms; j++) {
const char *iname = block->Uniforms[j].IndexName;
@@ -176,21 +176,21 @@ _mesa_GetProgramInterfaceiv(GLuint program, GLenum programInterface,
}
break;
case GL_ATOMIC_COUNTER_BUFFER:
- for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) {
- if (shProg->ProgramResourceList[i].Type == programInterface) {
+ for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
+ if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_active_atomic_buffer *buffer =
(struct gl_active_atomic_buffer *)
- shProg->ProgramResourceList[i].Data;
+ shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, buffer->NumUniforms);
}
}
break;
case GL_TRANSFORM_FEEDBACK_BUFFER:
- for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) {
- if (shProg->ProgramResourceList[i].Type == programInterface) {
+ for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
+ if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_transform_feedback_buffer *buffer =
(struct gl_transform_feedback_buffer *)
- shProg->ProgramResourceList[i].Data;
+ shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, buffer->NumVaryings);
}
}
@@ -210,11 +210,11 @@ _mesa_GetProgramInterfaceiv(GLuint program, GLenum programInterface,
case GL_COMPUTE_SUBROUTINE_UNIFORM:
case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM: {
- for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) {
- if (shProg->ProgramResourceList[i].Type == programInterface) {
+ for (i = 0, *params = 0; i < shProg->data->NumProgramResourceList; i++) {
+ if (shProg->data->ProgramResourceList[i].Type == programInterface) {
struct gl_uniform_storage *uni =
(struct gl_uniform_storage *)
- shProg->ProgramResourceList[i].Data;
+ shProg->data->ProgramResourceList[i].Data;
*params = MAX2(*params, uni->num_compatible_subroutines);
}
}