From 51142e7705a5e0c28de9fc097fa7c8446ba0cffe Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 10 Mar 2016 11:40:37 +1100 Subject: mesa: add support to query GL_OFFSET for GL_TRANSFORM_FEEDBACK_VARYING Reviewed-by: Dave Airlie --- src/mesa/main/mtypes.h | 1 + src/mesa/main/shader_query.cpp | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 1e15b69ab70..320297cdfe9 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1619,6 +1619,7 @@ struct gl_transform_feedback_varying_info char *Name; GLenum Type; GLint Size; + GLint Offset; }; diff --git a/src/mesa/main/shader_query.cpp b/src/mesa/main/shader_query.cpp index 247a26d4fda..15cc49afbfc 100644 --- a/src/mesa/main/shader_query.cpp +++ b/src/mesa/main/shader_query.cpp @@ -1186,9 +1186,17 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg, goto invalid_operation; } case GL_OFFSET: - VALIDATE_TYPE_2(GL_UNIFORM, GL_BUFFER_VARIABLE); - *val = RESOURCE_UNI(res)->offset; - return 1; + switch (res->Type) { + case GL_UNIFORM: + case GL_BUFFER_VARIABLE: + *val = RESOURCE_UNI(res)->offset; + return 1; + case GL_TRANSFORM_FEEDBACK_VARYING: + *val = RESOURCE_XFV(res)->Offset; + return 1; + default: + goto invalid_operation; + } case GL_BLOCK_INDEX: VALIDATE_TYPE_2(GL_UNIFORM, GL_BUFFER_VARIABLE); *val = RESOURCE_UNI(res)->block_index; -- cgit v1.2.3