On Tue, 2015-07-21 at 15:19 +1000, Dave Airlie wrote: > From: Dave Airlie <airl...@redhat.com> > > This fleshes out the ARB_program_query support for the > APIs that ARB_shader_subroutine introduces, leaving > some TODOs for later addition. > > v2: reworked for lots of the ARB_program_interface_query > entry points and tests > > Signed-off-by: Dave Airlie <airl...@redhat.com> > --- > src/mesa/main/program_resource.c | 88 ++++++++++++++++++++++++++++++++----- > --- > src/mesa/main/shader_query.cpp | 82 ++++++++++++++++++++++++++++++++++++- >
snip > @@ -740,6 +773,8 @@ program_resource_location(struct gl_shader_program > *shProg, > { > unsigned index, offset; > int array_index = -1; > + long offset_ret; > + const GLchar *base_name_end; > > if (res->Type == GL_PROGRAM_INPUT || res->Type == GL_PROGRAM_OUTPUT) { > array_index = array_index_of_resource(res, name); > @@ -780,6 +815,14 @@ program_resource_location(struct gl_shader_program > *shProg, > /* location in remap table + array element offset */ > return RESOURCE_UNI(res)->remap_location + offset; > > + case GL_VERTEX_SUBROUTINE_UNIFORM: > + case GL_GEOMETRY_SUBROUTINE_UNIFORM: > + case GL_FRAGMENT_SUBROUTINE_UNIFORM: > + case GL_COMPUTE_SUBROUTINE_UNIFORM: > + case GL_TESS_CONTROL_SUBROUTINE_UNIFORM: > + case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM: > + offset_ret = parse_program_resource_name(name, &base_name_end); > + return RESOURCE_UNI(res)->remap_location + ((offset_ret != -1) ? > offset_ret : 0); Sorry for commenting after this has already landed. But shouldn't this just return -1 if the subscript is invalid? _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev