diff options
author | Timothy Arceri <[email protected]> | 2016-10-19 13:23:37 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-10-26 14:29:36 +1100 |
commit | 3423488d55b9c483fcdb3996eb89b424c1031d24 (patch) | |
tree | 270d90fe3fd4c090f2c8e59a3b20d0afe7d98e72 /src/mesa/state_tracker | |
parent | 17e28a1571b6141368fefc84cc8b0a3b4e52f8ee (diff) |
st/mesa/r200/i915/i965: eliminate gl_fragment_program
Here we move OriginUpperLeft and PixelCenterInteger into gl_program
all other fields have been replace by shader_info.
V2: Don't use anonymous union/structs to hold vertex/fragment fields
suggested by Ian.
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_constbuf.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_sampler.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_texture.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bitmap.h | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawtex.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_program.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_debug.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 12 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.c | 6 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 47 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.h | 8 |
17 files changed, 50 insertions, 60 deletions
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index a86cffc4c65..6f06d64d202 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -73,7 +73,7 @@ static void check_program_state( struct st_context *st ) struct gl_program *new_tcp = ctx->TessCtrlProgram._Current; struct gl_program *new_tep = ctx->TessEvalProgram._Current; struct gl_program *new_gp = ctx->GeometryProgram._Current; - struct gl_fragment_program *new_fp = ctx->FragmentProgram._Current; + struct gl_program *new_fp = ctx->FragmentProgram._Current; uint64_t dirty = 0; /* Flag states used by both new and old shaders to unbind shader resources diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 31d1ef49ab4..3b5031dcf20 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -160,7 +160,7 @@ const struct st_tracked_state st_update_vs_constants = { static void update_fs_constants(struct st_context *st ) { struct st_fragment_program *fp = st->fp; - struct gl_program_parameter_list *params = fp->Base.Base.Parameters; + struct gl_program_parameter_list *params = fp->Base.Parameters; st_upload_constants( st, params, MESA_SHADER_FRAGMENT ); } diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index e365a45fca2..7f58c8b8a09 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -63,7 +63,7 @@ static void update_raster_state( struct st_context *st ) struct gl_context *ctx = st->ctx; struct pipe_rasterizer_state *raster = &st->state.rasterizer; const struct gl_program *vertProg = ctx->VertexProgram._Current; - const struct gl_fragment_program *fragProg = ctx->FragmentProgram._Current; + const struct gl_program *fragProg = ctx->FragmentProgram._Current; memset(raster, 0, sizeof(*raster)); @@ -183,7 +183,7 @@ static void update_raster_state( struct st_context *st ) raster->sprite_coord_enable = ctx->Point.CoordReplace & ((1u << MAX_TEXTURE_COORD_UNITS) - 1); if (!st->needs_texcoord_semantic && - fragProg->Base.InputsRead & VARYING_BIT_PNTC) { + fragProg->InputsRead & VARYING_BIT_PNTC) { raster->sprite_coord_enable |= 1 << st_get_generic_varying_index(st, VARYING_SLOT_PNTC); } diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index a7174f882b6..4568630fd2c 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -321,7 +321,7 @@ update_samplers(struct st_context *st) update_shader_samplers(st, PIPE_SHADER_FRAGMENT, - &ctx->FragmentProgram._Current->Base, + ctx->FragmentProgram._Current, ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, st->state.samplers[PIPE_SHADER_FRAGMENT], &st->state.num_samplers[PIPE_SHADER_FRAGMENT]); diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 1c3be08de7a..b77000e38be 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -114,7 +114,7 @@ update_fp( struct st_context *st ) assert(st->ctx->FragmentProgram._Current); stfp = st_fragment_program(st->ctx->FragmentProgram._Current); - assert(stfp->Base.Base.Target == GL_FRAGMENT_PROGRAM_ARB); + assert(stfp->Base.Target == GL_FRAGMENT_PROGRAM_ARB); memset(&key, 0, sizeof(key)); key.st = st->has_shareable_shaders ? NULL : st; @@ -143,7 +143,7 @@ update_fp( struct st_context *st ) } } - key.external = st_get_external_sampler_key(st, &stfp->Base.Base); + key.external = st_get_external_sampler_key(st, &stfp->Base); st->fp_variant = st_get_fp_variant(st, stfp, &key); diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index ea263ab43d8..a1b1b889554 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -222,7 +222,7 @@ update_fragment_textures(struct st_context *st) update_textures(st, MESA_SHADER_FRAGMENT, - &ctx->FragmentProgram._Current->Base, + ctx->FragmentProgram._Current, ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, st->state.sampler_views[PIPE_SHADER_FRAGMENT], &st->state.num_sampler_views[PIPE_SHADER_FRAGMENT]); diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 1e4becd10bd..457c41632ca 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -212,8 +212,7 @@ setup_render_state(struct gl_context *ctx, GLfloat colorSave[4]; COPY_4V(colorSave, ctx->Current.Attrib[VERT_ATTRIB_COLOR0]); COPY_4V(ctx->Current.Attrib[VERT_ATTRIB_COLOR0], color); - st_upload_constants(st, st->fp->Base.Base.Parameters, - MESA_SHADER_FRAGMENT); + st_upload_constants(st, st->fp->Base.Parameters, MESA_SHADER_FRAGMENT); COPY_4V(ctx->Current.Attrib[VERT_ATTRIB_COLOR0], colorSave); } diff --git a/src/mesa/state_tracker/st_cb_bitmap.h b/src/mesa/state_tracker/st_cb_bitmap.h index 323158ea11d..d1b102ece24 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.h +++ b/src/mesa/state_tracker/st_cb_bitmap.h @@ -35,7 +35,7 @@ struct dd_function_table; struct st_context; -struct gl_fragment_program; +struct gl_program; struct st_fragment_program; extern void diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 7f92e02dc5e..bc4e5338fda 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1123,8 +1123,7 @@ st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, /* compiling a new fragment shader variant added new state constants * into the constant buffer, we need to update them */ - st_upload_constants(st, st->fp->Base.Base.Parameters, - MESA_SHADER_FRAGMENT); + st_upload_constants(st, st->fp->Base.Parameters, MESA_SHADER_FRAGMENT); } /* Put glDrawPixels image into a texture */ @@ -1487,8 +1486,7 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, /* compiling a new fragment shader variant added new state constants * into the constant buffer, we need to update them */ - st_upload_constants(st, st->fp->Base.Base.Parameters, - MESA_SHADER_FRAGMENT); + st_upload_constants(st, st->fp->Base.Parameters, MESA_SHADER_FRAGMENT); } else { assert(type == GL_DEPTH); diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index 3321e15bdd3..2991a09f7de 100644 --- a/src/mesa/state_tracker/st_cb_drawtex.c +++ b/src/mesa/state_tracker/st_cb_drawtex.c @@ -123,7 +123,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z, st_validate_state(st, ST_PIPELINE_RENDER); /* determine if we need vertex color */ - if (ctx->FragmentProgram._Current->Base.InputsRead & VARYING_BIT_COL0) + if (ctx->FragmentProgram._Current->InputsRead & VARYING_BIT_COL0) emitColor = GL_TRUE; else emitColor = GL_FALSE; diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index d0478ca2ea9..48720a3656e 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -63,7 +63,7 @@ st_new_program(struct gl_context *ctx, GLenum target, GLuint id) } case GL_FRAGMENT_PROGRAM_ARB: { struct st_fragment_program *prog = ST_CALLOC_STRUCT(st_fragment_program); - return _mesa_init_gl_program(&prog->Base.Base, target, id); + return _mesa_init_gl_program(&prog->Base, target, id); } case GL_GEOMETRY_PROGRAM_NV: { struct st_geometry_program *prog = ST_CALLOC_STRUCT(st_geometry_program); diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 174503f80ff..0eae971143b 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -262,7 +262,7 @@ void st_invalidate_state(struct gl_context * ctx, GLbitfield new_state) ST_NEW_SAMPLERS | ST_NEW_IMAGE_UNITS); if (ctx->FragmentProgram._Current && - ctx->FragmentProgram._Current->Base.ExternalSamplersUsed) { + ctx->FragmentProgram._Current->ExternalSamplersUsed) { st->dirty |= ST_NEW_FS_STATE; } } diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index 1e5bbba95a7..d6cb5cd57d8 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -102,8 +102,8 @@ st_print_current(void) _mesa_print_parameter_list(st->vp->Base.Parameters); tgsi_dump(st->fp->tgsi.tokens, 0); - if (st->fp->Base.Base.Parameters) - _mesa_print_parameter_list(st->fp->Base.Base.Parameters); + if (st->fp->Base.Parameters) + _mesa_print_parameter_list(st->fp->Base.Parameters); } diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index a58bedc4974..ff48f9935c9 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -1270,10 +1270,8 @@ void glsl_to_tgsi_visitor::visit(ir_variable *ir) { if (strcmp(ir->name, "gl_FragCoord") == 0) { - struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog; - - fp->OriginUpperLeft = ir->data.origin_upper_left; - fp->PixelCenterInteger = ir->data.pixel_center_integer; + this->prog->OriginUpperLeft = ir->data.origin_upper_left; + this->prog->PixelCenterInteger = ir->data.pixel_center_integer; } if (ir->data.mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) { @@ -5752,8 +5750,6 @@ emit_wpos(struct st_context *st, struct ureg_program *ureg, int wpos_transform_const) { - const struct gl_fragment_program *fp = - (const struct gl_fragment_program *) program; struct pipe_screen *pscreen = st->pipe->screen; GLfloat adjX = 0.0f; GLfloat adjY[2] = { 0.0f, 0.0f }; @@ -5786,7 +5782,7 @@ emit_wpos(struct st_context *st, * u,i -> l,h: (99.0 + 0.5) * -1 + 100 = 0.5 * u,h -> l,i: (99.5 + 0.5) * -1 + 100 = 0 */ - if (fp->OriginUpperLeft) { + if (program->OriginUpperLeft) { /* Fragment shader wants origin in upper-left */ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT)) { /* the driver supports upper-left origin */ @@ -5813,7 +5809,7 @@ emit_wpos(struct st_context *st, assert(0); } - if (fp->PixelCenterInteger) { + if (program->PixelCenterInteger) { /* Fragment shader wants pixel center integer */ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) { /* the driver supports pixel center integer */ diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 4c26d92d452..9e3dd9c331a 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -672,8 +672,6 @@ emit_wpos(struct st_context *st, const struct gl_program *program, struct ureg_program *ureg) { - const struct gl_fragment_program *fp = - (const struct gl_fragment_program *) program; struct pipe_screen *pscreen = st->pipe->screen; GLfloat adjX = 0.0f; GLfloat adjY[2] = { 0.0f, 0.0f }; @@ -706,7 +704,7 @@ emit_wpos(struct st_context *st, * u,i -> l,h: (99.0 + 0.5) * -1 + 100 = 0.5 * u,h -> l,i: (99.5 + 0.5) * -1 + 100 = 0 */ - if (fp->OriginUpperLeft) { + if (program->OriginUpperLeft) { /* Fragment shader wants origin in upper-left */ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT)) { /* the driver supports upper-left origin */ @@ -733,7 +731,7 @@ emit_wpos(struct st_context *st, assert(0); } - if (fp->PixelCenterInteger) { + if (program->PixelCenterInteger) { /* Fragment shader wants pixel center integer */ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER)) { /* the driver supports pixel center integer */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 31cfbca9eac..09e8d43479d 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -586,9 +586,9 @@ st_translate_fragment_program(struct st_context *st, /* Non-GLSL programs: */ if (!stfp->glsl_to_tgsi && !stfp->shader_program) { - _mesa_remove_output_reads(&stfp->Base.Base, PROGRAM_OUTPUT); + _mesa_remove_output_reads(&stfp->Base, PROGRAM_OUTPUT); if (st->ctx->Const.GLSLFragCoordIsSysVal) - _mesa_program_fragment_position_to_sysval(&stfp->Base.Base); + _mesa_program_fragment_position_to_sysval(&stfp->Base); /* This determines which states will be updated when the assembly * shader is bound. @@ -605,7 +605,7 @@ st_translate_fragment_program(struct st_context *st, ST_NEW_RENDER_SAMPLERS; } else { /* ARB_fp */ - if (stfp->Base.Base.SamplersUsed) + if (stfp->Base.SamplersUsed) stfp->affected_states |= ST_NEW_FS_SAMPLER_VIEWS | ST_NEW_RENDER_SAMPLERS; } @@ -614,7 +614,7 @@ st_translate_fragment_program(struct st_context *st, /* * Convert Mesa program inputs to TGSI input register semantics. */ - inputsRead = stfp->Base.Base.InputsRead; + inputsRead = stfp->Base.InputsRead; for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { if ((inputsRead & BITFIELD64_BIT(attr)) != 0) { const GLuint slot = fs_num_inputs++; @@ -753,7 +753,7 @@ st_translate_fragment_program(struct st_context *st, * Semantics and mapping for outputs */ { - GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten; + GLbitfield64 outputsWritten = stfp->Base.OutputsWritten; /* if z is written, emit that first */ if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { @@ -783,7 +783,7 @@ st_translate_fragment_program(struct st_context *st, /* handle remaining outputs (color) */ for (attr = 0; attr < ARRAY_SIZE(outputMapping); attr++) { const GLbitfield64 written = attr < FRAG_RESULT_MAX ? outputsWritten : - stfp->Base.Base.SecondaryOutputsWritten; + stfp->Base.SecondaryOutputsWritten; const unsigned loc = attr % FRAG_RESULT_MAX; if (written & BITFIELD64_BIT(loc)) { @@ -822,8 +822,7 @@ st_translate_fragment_program(struct st_context *st, } if (stfp->shader_program) { - nir_shader *nir = st_glsl_to_nir(st, &stfp->Base.Base, - stfp->shader_program, + nir_shader *nir = st_glsl_to_nir(st, &stfp->Base, stfp->shader_program, MESA_SHADER_FRAGMENT); stfp->tgsi.type = PIPE_SHADER_IR_NIR; @@ -837,15 +836,15 @@ st_translate_fragment_program(struct st_context *st, return false; if (ST_DEBUG & DEBUG_MESA) { - _mesa_print_program(&stfp->Base.Base); - _mesa_print_program_parameters(st->ctx, &stfp->Base.Base); + _mesa_print_program(&stfp->Base); + _mesa_print_program_parameters(st->ctx, &stfp->Base); debug_printf("\n"); } if (write_all == GL_TRUE) ureg_property(ureg, TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS, 1); - if (stfp->Base.Base.info.fs.depth_layout != FRAG_DEPTH_LAYOUT_NONE) { - switch (stfp->Base.Base.info.fs.depth_layout) { + if (stfp->Base.info.fs.depth_layout != FRAG_DEPTH_LAYOUT_NONE) { + switch (stfp->Base.info.fs.depth_layout) { case FRAG_DEPTH_LAYOUT_ANY: ureg_property(ureg, TGSI_PROPERTY_FS_DEPTH_LAYOUT, TGSI_FS_DEPTH_LAYOUT_ANY); @@ -872,7 +871,7 @@ st_translate_fragment_program(struct st_context *st, PIPE_SHADER_FRAGMENT, ureg, stfp->glsl_to_tgsi, - &stfp->Base.Base, + &stfp->Base, /* inputs */ fs_num_inputs, inputMapping, @@ -892,7 +891,7 @@ st_translate_fragment_program(struct st_context *st, } else if (stfp->ati_fs) st_translate_atifs_program(ureg, stfp->ati_fs, - &stfp->Base.Base, + &stfp->Base, /* inputs */ fs_num_inputs, inputMapping, @@ -908,7 +907,7 @@ st_translate_fragment_program(struct st_context *st, st_translate_mesa_program(st->ctx, PIPE_SHADER_FRAGMENT, ureg, - &stfp->Base.Base, + &stfp->Base, /* inputs */ fs_num_inputs, inputMapping, @@ -934,7 +933,7 @@ st_create_fp_variant(struct st_context *st, struct pipe_context *pipe = st->pipe; struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant); struct pipe_shader_state tgsi = {0}; - struct gl_program_parameter_list *params = stfp->Base.Base.Parameters; + struct gl_program_parameter_list *params = stfp->Base.Parameters; static const gl_state_index texcoord_state[STATE_LENGTH] = { STATE_INTERNAL, STATE_CURRENT_ATTRIB, VERT_ATTRIB_TEX0 }; static const gl_state_index scale_state[STATE_LENGTH] = @@ -964,7 +963,7 @@ st_create_fp_variant(struct st_context *st, if (key->bitmap) { nir_lower_bitmap_options options = {0}; - variant->bitmap_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1; + variant->bitmap_sampler = ffs(~stfp->Base.SamplersUsed) - 1; options.sampler = variant->bitmap_sampler; options.swizzle_xxxx = (st->bitmap.tex_format == PIPE_FORMAT_L8_UNORM); @@ -974,7 +973,7 @@ st_create_fp_variant(struct st_context *st, /* glDrawPixels (color only) */ if (key->drawpixels) { nir_lower_drawpixels_options options = {{0}}; - unsigned samplers_used = stfp->Base.Base.SamplersUsed; + unsigned samplers_used = stfp->Base.SamplersUsed; /* Find the first unused slot. */ variant->drawpix_sampler = ffs(~samplers_used) - 1; @@ -1011,12 +1010,12 @@ st_create_fp_variant(struct st_context *st, NIR_PASS_V(tgsi.ir.nir, nir_lower_tex, &options); } - st_finalize_nir(st, &stfp->Base.Base, tgsi.ir.nir); + st_finalize_nir(st, &stfp->Base, tgsi.ir.nir); if (unlikely(key->external.lower_nv12 || key->external.lower_iyuv)) { /* This pass needs to happen *after* nir_lower_sampler */ NIR_PASS_V(tgsi.ir.nir, st_nir_lower_tex_src_plane, - ~stfp->Base.Base.SamplersUsed, + ~stfp->Base.SamplersUsed, key->external.lower_nv12, key->external.lower_iyuv); } @@ -1062,7 +1061,7 @@ st_create_fp_variant(struct st_context *st, if (key->bitmap) { const struct tgsi_token *tokens; - variant->bitmap_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1; + variant->bitmap_sampler = ffs(~stfp->Base.SamplersUsed) - 1; tokens = st_get_bitmap_shader(tgsi.tokens, st->internal_target, @@ -1085,10 +1084,10 @@ st_create_fp_variant(struct st_context *st, unsigned scale_const = 0, bias_const = 0, texcoord_const = 0; /* Find the first unused slot. */ - variant->drawpix_sampler = ffs(~stfp->Base.Base.SamplersUsed) - 1; + variant->drawpix_sampler = ffs(~stfp->Base.SamplersUsed) - 1; if (key->pixelMaps) { - unsigned samplers_used = stfp->Base.Base.SamplersUsed | + unsigned samplers_used = stfp->Base.SamplersUsed | (1 << variant->drawpix_sampler); variant->pixelmap_sampler = ffs(~samplers_used) - 1; @@ -1124,7 +1123,7 @@ st_create_fp_variant(struct st_context *st, assert(!(key->bitmap || key->drawpixels)); tokens = st_tgsi_lower_yuv(tgsi.tokens, - ~stfp->Base.Base.SamplersUsed, + ~stfp->Base.SamplersUsed, key->external.lower_nv12, key->external.lower_iyuv); if (tokens) { diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index deb7009bfac..eb36ac32825 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -136,11 +136,11 @@ struct st_fp_variant /** - * Derived from Mesa gl_fragment_program: + * Derived from Mesa gl_program: */ struct st_fragment_program { - struct gl_fragment_program Base; + struct gl_program Base; struct pipe_shader_state tgsi; struct glsl_to_tgsi_visitor* glsl_to_tgsi; struct ati_fragment_shader *ati_fs; @@ -197,7 +197,7 @@ struct st_vp_variant /** - * Derived from Mesa gl_fragment_program: + * Derived from Mesa gl_program: */ struct st_vertex_program { @@ -302,7 +302,7 @@ struct st_compute_program static inline struct st_fragment_program * -st_fragment_program( struct gl_fragment_program *fp ) +st_fragment_program( struct gl_program *fp ) { return (struct st_fragment_program *)fp; } |