diff options
author | Timothy Arceri <[email protected]> | 2016-10-20 14:24:03 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-10-26 14:29:36 +1100 |
commit | e81aaeba37f5419323d8f88bc10943c77e25ed14 (patch) | |
tree | 3dc9c65fd0984128fb559aa71ed4ae4c7493995e /src/mesa/state_tracker | |
parent | dfcbdba47119de6c1d81a869f8625bcc3d7560a2 (diff) |
r200/i915/st/mesa/compiler: use common inputs read field
And set set inputs_read directly in shader_info.
To avoid regressions between changes this change is a squashed
version of the following patches.
st/mesa changes where:
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atifs_to_tgsi.c | 14 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawtex.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 6 |
7 files changed, 18 insertions, 18 deletions
diff --git a/src/mesa/state_tracker/st_atifs_to_tgsi.c b/src/mesa/state_tracker/st_atifs_to_tgsi.c index ae08796dd51..2f2876b9a63 100644 --- a/src/mesa/state_tracker/st_atifs_to_tgsi.c +++ b/src/mesa/state_tracker/st_atifs_to_tgsi.c @@ -547,12 +547,12 @@ st_init_atifs_prog(struct gl_context *ctx, struct gl_program *prog) static const gl_state_index fog_color[STATE_LENGTH] = {STATE_FOG_COLOR, 0, 0, 0, 0}; - prog->InputsRead = 0; + prog->info.inputs_read = 0; prog->OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR); prog->SamplersUsed = 0; prog->Parameters = _mesa_new_parameter_list(); - /* fill in InputsRead, SamplersUsed, TexturesUsed */ + /* fill in inputs_read, SamplersUsed, TexturesUsed */ for (pass = 0; pass < atifs->NumPasses; pass++) { for (r = 0; r < MAX_NUM_FRAGMENT_REGISTERS_ATI; r++) { struct atifs_setupinst *texinst = &atifs->SetupInst[pass][r]; @@ -560,14 +560,14 @@ st_init_atifs_prog(struct gl_context *ctx, struct gl_program *prog) if (texinst->Opcode == ATI_FRAGMENT_SHADER_SAMPLE_OP) { /* mark which texcoords are used */ - prog->InputsRead |= BITFIELD64_BIT(VARYING_SLOT_TEX0 + pass_tex - GL_TEXTURE0_ARB); + prog->info.inputs_read |= BITFIELD64_BIT(VARYING_SLOT_TEX0 + pass_tex - GL_TEXTURE0_ARB); /* by default there is 1:1 mapping between samplers and textures */ prog->SamplersUsed |= (1 << r); /* the target is unknown here, it will be fixed in the draw call */ prog->TexturesUsed[r] = TEXTURE_2D_BIT; } else if (texinst->Opcode == ATI_FRAGMENT_SHADER_PASS_OP) { if (pass_tex >= GL_TEXTURE0_ARB && pass_tex <= GL_TEXTURE7_ARB) { - prog->InputsRead |= BITFIELD64_BIT(VARYING_SLOT_TEX0 + pass_tex - GL_TEXTURE0_ARB); + prog->info.inputs_read |= BITFIELD64_BIT(VARYING_SLOT_TEX0 + pass_tex - GL_TEXTURE0_ARB); } } } @@ -581,12 +581,12 @@ st_init_atifs_prog(struct gl_context *ctx, struct gl_program *prog) for (arg = 0; arg < inst->ArgCount[optype]; arg++) { GLint index = inst->SrcReg[optype][arg].Index; if (index == GL_PRIMARY_COLOR_EXT) { - prog->InputsRead |= BITFIELD64_BIT(VARYING_SLOT_COL0); + prog->info.inputs_read |= BITFIELD64_BIT(VARYING_SLOT_COL0); } else if (index == GL_SECONDARY_INTERPOLATOR_ATI) { /* note: ATI_fragment_shader.txt never specifies what * GL_SECONDARY_INTERPOLATOR_ATI is, swrast uses * VARYING_SLOT_COL1 for this input */ - prog->InputsRead |= BITFIELD64_BIT(VARYING_SLOT_COL1); + prog->info.inputs_read |= BITFIELD64_BIT(VARYING_SLOT_COL1); } } } @@ -594,7 +594,7 @@ st_init_atifs_prog(struct gl_context *ctx, struct gl_program *prog) } } /* we may need fog */ - prog->InputsRead |= BITFIELD64_BIT(VARYING_SLOT_FOGC); + prog->info.inputs_read |= BITFIELD64_BIT(VARYING_SLOT_FOGC); /* we always have the ATI_fs constants, and the fog params */ for (i = 0; i < MAX_NUM_FRAGMENT_CONSTANTS_ATI; i++) { diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index 7f58c8b8a09..a97a5ac5bc3 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -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->InputsRead & VARYING_BIT_PNTC) { + fragProg->info.inputs_read & 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_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c index 2991a09f7de..85f9a5390a5 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->InputsRead & VARYING_BIT_COL0) + if (ctx->FragmentProgram._Current->info.inputs_read & VARYING_BIT_COL0) emitColor = GL_TRUE; else emitColor = GL_FALSE; diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 303b36e9467..ef491941a29 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -80,7 +80,7 @@ st_nir_assign_vs_in_locations(struct gl_program *prog, nir_shader *nir) /* TODO de-duplicate w/ similar code in st_translate_vertex_program()? */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - if ((prog->InputsRead & BITFIELD64_BIT(attr)) != 0) { + if ((prog->info.inputs_read & BITFIELD64_BIT(attr)) != 0) { input_to_index[attr] = num_inputs; num_inputs++; if ((prog->DoubleInputsRead & BITFIELD64_BIT(attr)) != 0) { diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index ff48f9935c9..dabd97fd84a 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -6099,13 +6099,13 @@ st_translate_program( if (program->shader->info.EarlyFragmentTests) ureg_property(ureg, TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL, 1); - if (proginfo->InputsRead & VARYING_BIT_POS) { + if (proginfo->info.inputs_read & VARYING_BIT_POS) { /* Must do this after setting up t->inputs. */ emit_wpos(st_context(ctx), t, proginfo, ureg, program->wpos_transform_const); } - if (proginfo->InputsRead & VARYING_BIT_FACE) + if (proginfo->info.inputs_read & VARYING_BIT_FACE) emit_face_var(ctx, t); for (i = 0; i < numOutputs; i++) { @@ -6505,7 +6505,7 @@ get_mesa_program_tgsi(struct gl_context *ctx, do_set_program_inouts(shader->ir, prog, shader->Stage); _mesa_copy_linked_program_data(shader_program, shader); shrink_array_declarations(v->inputs, v->num_inputs, - &prog->InputsRead, prog->DoubleInputsRead, &prog->PatchInputsRead); + &prog->info.inputs_read, prog->DoubleInputsRead, &prog->PatchInputsRead); shrink_array_declarations(v->outputs, v->num_outputs, &prog->OutputsWritten, 0ULL, &prog->PatchOutputsWritten); count_resources(v, prog); @@ -6516,7 +6516,7 @@ get_mesa_program_tgsi(struct gl_context *ctx, /* This must be done before the uniform storage is associated. */ if (shader->Stage == MESA_SHADER_FRAGMENT && - (prog->InputsRead & VARYING_BIT_POS || + (prog->info.inputs_read & VARYING_BIT_POS || prog->SystemValuesRead & (1 << SYSTEM_VALUE_FRAG_COORD))) { static const gl_state_index wposTransformState[STATE_LENGTH] = { STATE_INTERNAL, STATE_FB_WPOS_Y_TRANSFORM diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 9e3dd9c331a..18948d6a2c1 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -832,7 +832,7 @@ st_translate_mesa_program( interpMode[i]); } - if (program->InputsRead & VARYING_BIT_POS) { + if (program->info.inputs_read & VARYING_BIT_POS) { /* Must do this after setting up t->inputs, and before * emitting constant references, below: */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 09e8d43479d..5922e7ae7ad 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -250,7 +250,7 @@ st_translate_vertex_program(struct st_context *st, * and TGSI generic input indexes, plus input attrib semantic info. */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - if ((stvp->Base.InputsRead & BITFIELD64_BIT(attr)) != 0) { + if ((stvp->Base.info.inputs_read & BITFIELD64_BIT(attr)) != 0) { input_to_index[attr] = stvp->num_inputs; stvp->index_to_input[stvp->num_inputs] = attr; stvp->num_inputs++; @@ -614,7 +614,7 @@ st_translate_fragment_program(struct st_context *st, /* * Convert Mesa program inputs to TGSI input register semantics. */ - inputsRead = stfp->Base.InputsRead; + inputsRead = stfp->Base.info.inputs_read; for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { if ((inputsRead & BITFIELD64_BIT(attr)) != 0) { const GLuint slot = fs_num_inputs++; @@ -1225,7 +1225,7 @@ st_translate_program_common(struct st_context *st, * Convert Mesa program inputs to TGSI input register semantics. */ for (attr = 0; attr < VARYING_SLOT_MAX; attr++) { - if ((prog->InputsRead & BITFIELD64_BIT(attr)) != 0) { + if ((prog->info.inputs_read & BITFIELD64_BIT(attr)) != 0) { const GLuint slot = num_inputs++; inputMapping[attr] = slot; |