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 <anuj.phogat@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user