case GL_UNIFORM_BLOCK:
case GL_PROGRAM_INPUT:
case GL_PROGRAM_OUTPUT:
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
case GL_TRANSFORM_FEEDBACK_VARYING:
case GL_ATOMIC_COUNTER_BUFFER:
case GL_BUFFER_VARIABLE:
(*params)++;
break;
case GL_MAX_NAME_LENGTH:
- if (programInterface == GL_ATOMIC_COUNTER_BUFFER) {
+ if (programInterface == GL_ATOMIC_COUNTER_BUFFER ||
+ programInterface == GL_TRANSFORM_FEEDBACK_BUFFER) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
_mesa_enum_to_string(programInterface),
}
}
break;
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
+ for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) {
+ if (shProg->ProgramResourceList[i].Type == programInterface) {
+ struct gl_transform_feedback_buffer *buffer =
+ (struct gl_transform_feedback_buffer *)
+ shProg->ProgramResourceList[i].Data;
+ *params = MAX2(*params, buffer->NumVaryings);
+ }
+ }
+ break;
default:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glGetProgramInterfaceiv(%s pname %s)",
return _mesa_program_resource_index(shProg, res);
case GL_ATOMIC_COUNTER_BUFFER:
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
default:
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramResourceIndex(%s)",
_mesa_enum_to_string(programInterface));
return;
if (programInterface == GL_ATOMIC_COUNTER_BUFFER ||
+ programInterface == GL_TRANSFORM_FEEDBACK_BUFFER ||
!supported_interface_enum(ctx, programInterface)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramResourceName(%s)",
_mesa_enum_to_string(programInterface));
DECL_RESOURCE_FUNC(UNI, gl_uniform_storage);
DECL_RESOURCE_FUNC(ATC, gl_active_atomic_buffer);
DECL_RESOURCE_FUNC(XFV, gl_transform_feedback_varying_info);
+DECL_RESOURCE_FUNC(XFB, gl_transform_feedback_buffer);
DECL_RESOURCE_FUNC(SUB, gl_subroutine_function);
void GLAPIENTRY
return RESOURCE_SUB(res)->index;
case GL_UNIFORM_BLOCK:
case GL_SHADER_STORAGE_BLOCK:
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
case GL_TRANSFORM_FEEDBACK_VARYING:
default:
return calc_resource_index(shProg, res);
case GL_UNIFORM_BLOCK:
case GL_ATOMIC_COUNTER_BUFFER:
case GL_SHADER_STORAGE_BLOCK:
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
if (_mesa_program_resource_index(shProg, res) == index)
return res;
break;
GET_CURRENT_CONTEXT(ctx);
if (res->Type != GL_UNIFORM_BLOCK &&
res->Type != GL_ATOMIC_COUNTER_BUFFER &&
- res->Type != GL_SHADER_STORAGE_BLOCK)
+ res->Type != GL_SHADER_STORAGE_BLOCK &&
+ res->Type != GL_TRANSFORM_FEEDBACK_BUFFER)
goto invalid_operation;
if (res->Type == GL_UNIFORM_BLOCK) {
}
return RESOURCE_ATC(res)->NumUniforms;
}
+ } else if (res->Type == GL_TRANSFORM_FEEDBACK_BUFFER) {
+ switch (prop) {
+ case GL_BUFFER_BINDING:
+ *val = RESOURCE_XFB(res)->Binding;
+ return 1;
+ case GL_NUM_ACTIVE_VARIABLES:
+ *val = RESOURCE_XFB(res)->NumVaryings;
+ return 1;
+ case GL_ACTIVE_VARIABLES:
+ int i = 0;
+ for ( ; i < shProg->LinkedTransformFeedback.NumVarying; i++) {
+ unsigned index =
+ shProg->LinkedTransformFeedback.Varyings[i].BufferIndex;
+ struct gl_program_resource *buf_res =
+ _mesa_program_resource_find_index(shProg,
+ GL_TRANSFORM_FEEDBACK_BUFFER,
+ index);
+ assert(buf_res);
+ if (res == buf_res) {
+ *val++ = i;
+ }
+ }
+ return RESOURCE_XFB(res)->NumVaryings;
+ }
}
assert(!"support for property type not implemented");
case GL_NAME_LENGTH:
switch (res->Type) {
case GL_ATOMIC_COUNTER_BUFFER:
+ case GL_TRANSFORM_FEEDBACK_BUFFER:
goto invalid_operation;
default:
/* Resource name length + terminator. */
VALIDATE_TYPE(GL_TRANSFORM_FEEDBACK_VARYING);
*val = RESOURCE_XFV(res)->BufferIndex;
return 1;
+ case GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE:
+ VALIDATE_TYPE(GL_TRANSFORM_FEEDBACK_BUFFER);
+ *val = RESOURCE_XFB(res)->Stride * 4;
+ return 1;
default:
goto invalid_enum;