struct gl_transform_feedback_object *xfb_obj =
ctx->TransformFeedback.CurrentObject;
const struct gl_transform_feedback_info *linked_xfb_info =
- xfb_obj->shader_program->xfb_program->sh.LinkedTransformFeedback;
+ xfb_obj->program->sh.LinkedTransformFeedback;
int i;
/* Set up the up to 4 output buffers. These are the ranges defined in the
struct gl_transform_feedback_object *xfb_obj =
ctx->TransformFeedback.CurrentObject;
const struct gl_transform_feedback_info *linked_xfb_info =
- xfb_obj->shader_program->xfb_program->sh.LinkedTransformFeedback;
+ xfb_obj->program->sh.LinkedTransformFeedback;
uint16_t so_decl[MAX_VERTEX_STREAMS][128];
int buffer_mask[MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
int next_offset[MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
struct gl_transform_feedback_object *xfb_obj =
ctx->TransformFeedback.CurrentObject;
const struct gl_transform_feedback_info *linked_xfb_info =
- xfb_obj->shader_program->xfb_program->sh.LinkedTransformFeedback;
+ xfb_obj->program->sh.LinkedTransformFeedback;
uint32_t dw1 = 0, dw2 = 0, dw3 = 0, dw4 = 0;
int i;
struct using_program_tuple
{
- struct gl_shader_program *shProg;
+ struct gl_program *prog;
bool found;
};
{
struct using_program_tuple *callback_data = user_data;
struct gl_transform_feedback_object *obj = data;
- if (obj->Active && obj->shader_program == callback_data->shProg)
+ if (obj->Active && obj->program == callback_data->prog)
callback_data->found = true;
}
struct gl_shader_program *shProg)
{
struct using_program_tuple callback_data;
- callback_data.shProg = shProg;
callback_data.found = false;
+ callback_data.prog = shProg->xfb_program;
_mesa_HashWalk(ctx->TransformFeedback.Objects,
active_xfb_object_references_program, &callback_data);
/**
* Figure out which stage of the pipeline is the source of transform feedback
- * data given the current context state, and return its gl_shader_program.
+ * data given the current context state, and return its gl_program.
*
* If no active program can generate transform feedback data (i.e. no vertex
* shader is active), returns NULL.
*/
-static struct gl_shader_program *
+static struct gl_program *
get_xfb_source(struct gl_context *ctx)
{
int i;
for (i = MESA_SHADER_GEOMETRY; i >= MESA_SHADER_VERTEX; i--) {
if (ctx->_Shader->CurrentProgram[i] != NULL)
- return ctx->_Shader->CurrentProgram[i];
+ return ctx->_Shader->CurrentProgram[i]->_LinkedShaders[i]->Program;
}
return NULL;
}
{
struct gl_transform_feedback_object *obj;
struct gl_transform_feedback_info *info = NULL;
- struct gl_shader_program *source;
GLuint i;
unsigned vertices_per_prim;
GET_CURRENT_CONTEXT(ctx);
/* Figure out what pipeline stage is the source of data for transform
* feedback.
*/
- source = get_xfb_source(ctx);
+ struct gl_program *source = get_xfb_source(ctx);
if (source == NULL) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBeginTransformFeedback(no program active)");
return;
}
- info = source->xfb_program->sh.LinkedTransformFeedback;
+ info = source->sh.LinkedTransformFeedback;
if (info->NumOutputs == 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
obj->GlesRemainingPrims = max_vertices / vertices_per_prim;
}
- if (obj->shader_program != source) {
+ if (obj->program != source) {
ctx->NewDriverState |= ctx->DriverFlags.NewTransformFeedbackProg;
- obj->shader_program = source;
+ obj->program = source;
}
assert(ctx->Driver.BeginTransformFeedback);
* the program object being used by the current transform feedback object
* is not active."
*/
- if (obj->shader_program != get_xfb_source(ctx)) {
+ if (obj->program != get_xfb_source(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glResumeTransformFeedback(wrong program bound)");
return;
struct st_buffer_object *bo = st_buffer_object(sobj->base.Buffers[i]);
if (bo && bo->buffer) {
- unsigned stream = obj->shader_program->xfb_program->
- sh.LinkedTransformFeedback->Buffers[i].Stream;
+ unsigned stream = obj->program->sh.LinkedTransformFeedback->
+ Buffers[i].Stream;
/* Check whether we need to recreate the target. */
if (!sobj->targets[i] ||
pipe_so_target_reference(&sobj->draw_count[i], NULL);
for (i = 0; i < ARRAY_SIZE(sobj->targets); i++) {
- unsigned stream = obj->shader_program->xfb_program->
- sh.LinkedTransformFeedback->Buffers[i].Stream;
+ unsigned stream = obj->program->sh.LinkedTransformFeedback->
+ Buffers[i].Stream;
/* Is it not bound or already set for this stream? */
if (!sobj->targets[i] || sobj->draw_count[stream])