aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/mtypes.h6
-rw-r--r--src/mesa/main/shader_query.cpp9
2 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 46b1543b56c..62838542920 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2571,6 +2571,12 @@ struct gl_shader_variable
int location;
/**
+ * Specifies the first component the variable is stored in as per
+ * ARB_enhanced_layouts.
+ */
+ unsigned component:2;
+
+ /**
* Output index for dual source blending.
*
* \note
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;