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 <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
/**
* \file ir_set_program_inouts.cpp
*
- * Sets the InputsRead and OutputsWritten of Mesa programs.
+ * Sets the inputs_read and OutputsWritten of Mesa programs.
*
* Mesa programs (gl_program, not gl_shader_program) have a set of
* flags indicating which varyings are read and written. Computing
* which are actually read from some sort of backend code can be
* tricky when variable array indexing involved. So this pass
- * provides support for setting InputsRead and OutputsWritten right
+ * provides support for setting inputs_read and OutputsWritten right
* from the GLSL IR.
*/
{
/* As of GLSL 1.20, varyings can only be floats, floating-point
* vectors or matrices, or arrays of them. For Mesa programs using
- * InputsRead/OutputsWritten, everything but matrices uses one
+ * inputs_read/OutputsWritten, everything but matrices uses one
* slot, while matrices use a slot per column. Presumably
* something doing a more clever packing would use something other
- * than InputsRead/OutputsWritten.
+ * than inputs_read/OutputsWritten.
*/
for (int i = 0; i < len; i++) {
if (is_patch_generic)
prog->PatchInputsRead |= bitfield;
else
- prog->InputsRead |= bitfield;
+ prog->info.inputs_read |= bitfield;
/* double inputs read is only for vertex inputs */
if (stage == MESA_SHADER_VERTEX &&
{
ir_set_program_inouts_visitor v(prog, shader_stage);
- prog->InputsRead = 0;
+ prog->info.inputs_read = 0;
prog->OutputsWritten = 0;
prog->SecondaryOutputsWritten = 0;
prog->OutputsRead = 0;
{
shader_info *info = &sh->Program->info;
- info->inputs_read = sh->Program->InputsRead;
info->double_inputs_read = sh->Program->DoubleInputsRead;
info->outputs_written = sh->Program->OutputsWritten;
info->outputs_read = sh->Program->OutputsRead;
static void
check_texcoord_mapping(struct i915_fragment_program *p)
{
- GLbitfield64 inputs = p->FragProg.InputsRead;
+ GLbitfield64 inputs = p->FragProg.info.inputs_read;
unsigned unit = 0;
for (unsigned i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
static void
check_wpos(struct i915_fragment_program *p)
{
- GLbitfield64 inputs = p->FragProg.InputsRead;
+ GLbitfield64 inputs = p->FragProg.info.inputs_read;
GLint i;
unsigned unit = 0;
struct i915_fragment_program *p =
(struct i915_fragment_program *) ctx->FragmentProgram._Current;
- const GLbitfield64 inputsRead = p->FragProg.InputsRead;
+ const GLbitfield64 inputsRead = p->FragProg.info.inputs_read;
GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
GLuint s2 = S2_TEXCOORD_NONE;
int i, offset = 0;
/* _NEW_PROGRAM */
struct i915_fragment_program *p =
(struct i915_fragment_program *) ctx->FragmentProgram._Current;
- const GLbitfield64 inputsRead = p->FragProg.InputsRead;
+ const GLbitfield64 inputsRead = p->FragProg.info.inputs_read;
struct i915_context *i915 = i915_context(ctx);
GLuint s4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_VFMT_MASK;
GLuint coord_replace_bits = 0x0;
***********************************************************************/
/* Currently not working - VERT_ATTRIB_POINTSIZE isn't correctly
- * represented in the fragment program InputsRead field.
+ * represented in the fragment program info.inputs_read field.
*/
static void
intel_atten_point(struct intel_context *intel, intelVertexPtr v0)
(ctx->Line.StippleFlag ? DD_LINE_STIPPLE : 0) |
(ctx->Point._Attenuated ? DD_POINT_ATTEN : 0);
const struct gl_program *fprog = ctx->FragmentProgram._Current;
- bool have_wpos = (fprog && (fprog->InputsRead & VARYING_BIT_POS));
+ bool have_wpos = (fprog && (fprog->info.inputs_read & VARYING_BIT_POS));
GLuint index = 0;
if (INTEL_DEBUG & DEBUG_STATE)
return GL_FALSE;
#if 0
- if ((mesa_vp->InputsRead &
+ if ((mesa_vp->info.inputs_read &
~(VERT_BIT_POS | VERT_BIT_NORMAL | VERT_BIT_COLOR0 | VERT_BIT_COLOR1 |
VERT_BIT_FOG | VERT_BIT_TEX0 | VERT_BIT_TEX1 | VERT_BIT_TEX2 |
VERT_BIT_TEX3 | VERT_BIT_TEX4 | VERT_BIT_TEX5)) != 0) {
if (R200_DEBUG & RADEON_FALLBACKS) {
fprintf(stderr, "can't handle vert prog inputs 0x%x\n",
- mesa_vp->InputsRead);
+ mesa_vp->info.inputs_read);
}
return GL_FALSE;
}
Haven't seen attr 14 used, maybe that's for the hw pointsize vec1 (which is
not possibe to use with vertex progs as it is lacking in vert prog specification) */
/* may look different when using idx buf / input_route instead of se_vtx_fmt? */
- if (mesa_vp->InputsRead & VERT_BIT_POS) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_POS) {
vp->inputs[VERT_ATTRIB_POS] = 0;
vp->inputmap_rev[0] = VERT_ATTRIB_POS;
free_inputs &= ~(1 << 0);
array_count++;
}
- if (mesa_vp->InputsRead & VERT_BIT_WEIGHT) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_WEIGHT) {
vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
vp->inputmap_rev[1] = VERT_ATTRIB_WEIGHT;
array_count++;
}
- if (mesa_vp->InputsRead & VERT_BIT_NORMAL) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_NORMAL) {
vp->inputs[VERT_ATTRIB_NORMAL] = 1;
vp->inputmap_rev[2] = VERT_ATTRIB_NORMAL;
array_count++;
}
- if (mesa_vp->InputsRead & VERT_BIT_COLOR0) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_COLOR0) {
vp->inputs[VERT_ATTRIB_COLOR0] = 2;
vp->inputmap_rev[4] = VERT_ATTRIB_COLOR0;
free_inputs &= ~(1 << 2);
array_count++;
}
- if (mesa_vp->InputsRead & VERT_BIT_COLOR1) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_COLOR1) {
vp->inputs[VERT_ATTRIB_COLOR1] = 3;
vp->inputmap_rev[5] = VERT_ATTRIB_COLOR1;
free_inputs &= ~(1 << 3);
array_count++;
}
- if (mesa_vp->InputsRead & VERT_BIT_FOG) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_FOG) {
vp->inputs[VERT_ATTRIB_FOG] = 15; array_count++;
vp->inputmap_rev[3] = VERT_ATTRIB_FOG;
array_count++;
}
/* VERT_ATTRIB_TEX0-5 */
for (i = 0; i <= 5; i++) {
- if (mesa_vp->InputsRead & VERT_BIT_TEX(i)) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_TEX(i)) {
vp->inputs[VERT_ATTRIB_TEX(i)] = i + 6;
vp->inputmap_rev[8 + i] = VERT_ATTRIB_TEX(i);
free_inputs &= ~(1 << (i + 6));
}
/* using VERT_ATTRIB_TEX6/7 would be illegal */
for (; i < VERT_ATTRIB_TEX_MAX; i++) {
- if (mesa_vp->InputsRead & VERT_BIT_TEX(i)) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_TEX(i)) {
if (R200_DEBUG & RADEON_FALLBACKS) {
fprintf(stderr, "texture attribute %d in vert prog\n", i);
}
for (i = 0; i < VERT_ATTRIB_GENERIC_MAX; i++) {
int j;
/* completely ignore aliasing? */
- if (mesa_vp->InputsRead & VERT_BIT_GENERIC(i)) {
+ if (mesa_vp->info.inputs_read & VERT_BIT_GENERIC(i)) {
array_count++;
if (array_count > 12) {
if (R200_DEBUG & RADEON_FALLBACKS) {
assert(VARYING_SLOT_MAX <=
(8 * sizeof(ctx->VertexProgram._Current->OutputsWritten)));
assert(VARYING_SLOT_MAX <=
- (8 * sizeof(ctx->FragmentProgram._Current->InputsRead)));
+ (8 * sizeof(ctx->FragmentProgram._Current->info.inputs_read)));
/* shader-related checks */
assert(ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxLocalParams <= MAX_PROGRAM_LOCAL_PARAMS);
key->need_eye_coords = ctx->_NeedEyeCoords;
- key->fragprog_inputs_read = fp->InputsRead;
+ key->fragprog_inputs_read = fp->info.inputs_read;
key->varying_vp_inputs = ctx->varying_vp_inputs;
if (ctx->RenderMode == GL_FEEDBACK) {
assert(input < VERT_ATTRIB_MAX);
if (p->state->varying_vp_inputs & VERT_BIT(input)) {
- p->program->InputsRead |= VERT_BIT(input);
+ p->program->info.inputs_read |= VERT_BIT(input);
return make_ureg(PROGRAM_INPUT, input);
}
else {
p.program->NumParameters =
p.program->NumAttributes = p.program->NumAddressRegs = 0;
p.program->Parameters = _mesa_new_parameter_list();
- p.program->InputsRead = 0;
+ p.program->info.inputs_read = 0;
p.program->OutputsWritten = 0;
build_tnl_program( &p );
struct shader_info info;
- GLbitfield64 InputsRead; /**< Bitmask of which input regs are read */
GLbitfield64 DoubleInputsRead; /**< Bitmask of which input regs are read and are doubles */
GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */
GLbitfield64 SecondaryOutputsWritten; /**< Subset of OutputsWritten outputs written with non-zero index. */
if (ctx->VertexProgram._Current &&
(ctx->VertexProgram._Current != ctx->VertexProgram._TnlProgram) &&
- (ctx->VertexProgram._Current->InputsRead & VERT_BIT_COLOR1))
+ (ctx->VertexProgram._Current->info.inputs_read & VERT_BIT_COLOR1))
return GL_TRUE;
if (ctx->FragmentProgram._Current &&
(ctx->FragmentProgram._Current != ctx->FragmentProgram._TexEnvProgram) &&
- (ctx->FragmentProgram._Current->InputsRead & VARYING_BIT_COL1))
+ (ctx->FragmentProgram._Current->info.inputs_read & VARYING_BIT_COL1))
return GL_TRUE;
return GL_FALSE;
if (prog[MESA_SHADER_FRAGMENT]) {
const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
ctx->Texture._EnabledCoordUnits |=
- (prog[MESA_SHADER_FRAGMENT]->InputsRead >> VARYING_SLOT_TEX0) &
+ (prog[MESA_SHADER_FRAGMENT]->info.inputs_read >> VARYING_SLOT_TEX0) &
coordMask;
}
}
program->NumNativeAluInstructions = prog.NumAluInstructions;
program->NumNativeTexInstructions = prog.NumTexInstructions;
program->NumNativeTexIndirections = prog.NumTexIndirections;
- program->InputsRead = prog.InputsRead;
+ program->info.inputs_read = prog.info.inputs_read;
program->OutputsWritten = prog.OutputsWritten;
program->IndirectRegisterFiles = prog.IndirectRegisterFiles;
for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) {
program->NumNativeParameters = prog.NumNativeParameters;
program->NumNativeAttributes = prog.NumNativeAttributes;
program->NumNativeAddressRegs = prog.NumNativeAddressRegs;
- program->InputsRead = prog.InputsRead;
+ program->info.inputs_read = prog.info.inputs_read;
program->OutputsWritten = prog.OutputsWritten;
program->IndirectRegisterFiles = prog.IndirectRegisterFiles;
program->IsPositionInvariant = (state.option.PositionInvariant)
/**
- * Print a vertex program's InputsRead field in human-readable format.
+ * Print a vertex program's inputs_read field in human-readable format.
* For debugging.
*/
void
/**
- * Print a fragment program's InputsRead field in human-readable format.
+ * Print a fragment program's inputs_read field in human-readable format.
* For debugging.
*/
void
GLuint i;
fprintf(f, "InputsRead: %" PRIx64 " (0b%s)\n",
- (uint64_t) prog->InputsRead, binary(prog->InputsRead));
+ (uint64_t) prog->info.inputs_read, binary(prog->info.inputs_read));
fprintf(f, "OutputsWritten: %" PRIx64 " (0b%s)\n",
(uint64_t) prog->OutputsWritten, binary(prog->OutputsWritten));
fprintf(f, "NumInstructions=%d\n", prog->NumInstructions);
struct nir_shader *shader = b->shader;
/* Create input variables. */
- const int num_inputs = util_last_bit64(c->prog->InputsRead);
+ const int num_inputs = util_last_bit64(c->prog->info.inputs_read);
for (int i = 0; i < num_inputs; i++) {
- if (!(c->prog->InputsRead & BITFIELD64_BIT(i)))
+ if (!(c->prog->info.inputs_read & BITFIELD64_BIT(i)))
continue;
nir_variable *var =
s->info->num_abos = 0;
s->info->num_ssbos = 0;
s->info->num_images = 0;
- s->info->inputs_read = prog->InputsRead;
s->info->outputs_written = prog->OutputsWritten;
s->info->system_values_read = prog->SystemValuesRead;
s->info->uses_texture_gather = false;
break;
case at_attrib:
set_src_reg(& $$, PROGRAM_INPUT, s->attrib_binding);
- state->prog->InputsRead |= BITFIELD64_BIT($$.Base.Index);
+ state->prog->info.inputs_read |= BITFIELD64_BIT($$.Base.Index);
if (!validate_inputs(& @1, state)) {
YYERROR;
| attribBinding
{
set_src_reg(& $$, PROGRAM_INPUT, $1);
- state->prog->InputsRead |= BITFIELD64_BIT($$.Base.Index);
+ state->prog->info.inputs_read |= BITFIELD64_BIT($$.Base.Index);
if (!validate_inputs(& @1, state)) {
YYERROR;
int
validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state)
{
- const GLbitfield64 inputs = state->prog->InputsRead | state->InputsBound;
+ const GLbitfield64 inputs = state->prog->info.inputs_read | state->InputsBound;
if (((inputs & VERT_BIT_FF_ALL) & (inputs >> VERT_ATTRIB_GENERIC0)) != 0) {
yyerror(locp, state, "illegal use of generic attribute and name attribute");
state->prog->NumInstructions++;
state->prog->NumParameters = state->prog->Parameters->NumParameters;
- state->prog->NumAttributes = _mesa_bitcount_64(state->prog->InputsRead);
+ state->prog->NumAttributes =
+ _mesa_bitcount_64(state->prog->info.inputs_read);
/*
* Initialize native counts to logical counts. The device driver may
/* install new instructions */
vprog->Instructions = newInst;
vprog->NumInstructions = newLen;
- vprog->InputsRead |= VERT_BIT_POS;
+ vprog->info.inputs_read |= VERT_BIT_POS;
vprog->OutputsWritten |= BITFIELD64_BIT(VARYING_SLOT_POS);
}
/* install new instructions */
vprog->Instructions = newInst;
vprog->NumInstructions = newLen;
- vprog->InputsRead |= VERT_BIT_POS;
+ vprog->info.inputs_read |= VERT_BIT_POS;
vprog->OutputsWritten |= BITFIELD64_BIT(VARYING_SLOT_POS);
}
* \param saturate True if writes to color outputs should be clamped to [0, 1]
*
* \note
- * This function sets \c VARYING_BIT_FOGC in \c fprog->Base.InputsRead.
+ * This function sets \c VARYING_BIT_FOGC in \c fprog->info.inputs_read.
*
* \todo With a little work, this function could be adapted to add fog code
* to vertex programs too.
/* install new instructions */
fprog->Instructions = newInst;
fprog->NumInstructions = inst - newInst;
- fprog->InputsRead |= VARYING_BIT_FOGC;
+ fprog->info.inputs_read |= VARYING_BIT_FOGC;
assert(fprog->OutputsWritten & (1 << FRAG_RESULT_COLOR));
}
GLuint i;
if (prog->Target != GL_FRAGMENT_PROGRAM_ARB ||
- !(prog->InputsRead & BITFIELD64_BIT(VARYING_SLOT_POS)))
+ !(prog->info.inputs_read & BITFIELD64_BIT(VARYING_SLOT_POS)))
return;
- prog->InputsRead &= ~BITFIELD64_BIT(VARYING_SLOT_POS);
+ prog->info.inputs_read &= ~BITFIELD64_BIT(VARYING_SLOT_POS);
prog->SystemValuesRead |= 1 << SYSTEM_VALUE_FRAG_COORD;
for (i = 0; i < prog->NumInstructions; i++) {
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];
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);
}
}
}
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);
}
}
}
}
}
/* 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++) {
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);
}
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;
/* 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) {
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++) {
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);
/* 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
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:
*/
* 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++;
/*
* 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++;
* 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;
*/
if (_swrast_use_fragment_program(ctx)) {
/* fragment program/shader */
- attribsMask = ctx->FragmentProgram._Current->InputsRead;
+ attribsMask = ctx->FragmentProgram._Current->info.inputs_read;
attribsMask &= ~VARYING_BIT_POS; /* WPOS is always handled specially */
}
else if (ctx->ATIFragmentShader._Enabled) {
const struct gl_program *program = ctx->FragmentProgram._Current;
/* incoming colors should be floats */
- if (program->InputsRead & VARYING_BIT_COL0) {
+ if (program->info.inputs_read & VARYING_BIT_COL0) {
assert(span->array->ChanType == GL_FLOAT);
}
*/
tnl->render_inputs_bitset = BITFIELD64_BIT(_TNL_ATTRIB_POS);
- if (!fp || (fp->InputsRead & VARYING_BIT_COL0)) {
+ if (!fp || (fp->info.inputs_read & VARYING_BIT_COL0)) {
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR0);
}
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
if (ctx->Texture._EnabledCoordUnits & (1 << i) ||
- (fp && fp->InputsRead & VARYING_BIT_TEX(i))) {
+ (fp && fp->info.inputs_read & VARYING_BIT_TEX(i))) {
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX(i));
}
}
if (ctx->Fog.Enabled
- || (fp != NULL && (fp->InputsRead & VARYING_BIT_FOGC) != 0)) {
+ || (fp != NULL && (fp->info.inputs_read & VARYING_BIT_FOGC) != 0)) {
/* Either fixed-function fog or a fragment program needs fog coord.
*/
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_FOG);
/* the vertex array case */
for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
- if (program->InputsRead & BITFIELD64_BIT(attr)) {
+ if (program->info.inputs_read & BITFIELD64_BIT(attr)) {
const GLubyte *ptr = (const GLubyte*) VB->AttribPtr[attr]->data;
const GLuint size = VB->AttribPtr[attr]->size;
const GLuint stride = VB->AttribPtr[attr]->stride;
VBO_ATTRIB_GENERIC14 = 31,
VBO_ATTRIB_GENERIC15 = 32,
- /* XXX: in the vertex program InputsRead flag, we alias
+ /* XXX: in the vertex program inputs_read flag, we alias
* materials and generics and use knowledge about the program
* (whether it is a fixed-function emulation) to
* differentiate. Here we must keep them apart instead.
* glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
* The original state gets essentially restored below.
*/
- if ((ctx->VertexProgram._Current->InputsRead & VERT_BIT_POS) == 0 &&
- (ctx->VertexProgram._Current->InputsRead & VERT_BIT_GENERIC0)) {
+ if ((ctx->VertexProgram._Current->info.inputs_read &
+ VERT_BIT_POS) == 0 &&
+ (ctx->VertexProgram._Current->info.inputs_read &
+ VERT_BIT_GENERIC0)) {
swap_pos = true;
exec->vtx.inputs[VERT_ATTRIB_GENERIC0] = exec->vtx.inputs[0];
exec->vtx.attrsz[VERT_ATTRIB_GENERIC0] = exec->vtx.attrsz[0];
* In that case we effectively need to route the data from
* glVertexAttrib(0, val) calls to feed into the GENERIC0 input.
*/
- if ((ctx->VertexProgram._Current->InputsRead & VERT_BIT_POS) == 0 &&
- (ctx->VertexProgram._Current->InputsRead & VERT_BIT_GENERIC0)) {
+ if ((ctx->VertexProgram._Current->info.inputs_read &
+ VERT_BIT_POS) == 0 &&
+ (ctx->VertexProgram._Current->info.inputs_read &
+ VERT_BIT_GENERIC0)) {
save->inputs[VERT_ATTRIB_GENERIC0] = save->inputs[0];
node_attrsz[VERT_ATTRIB_GENERIC0] = node_attrsz[0];
node_attrtype[VERT_ATTRIB_GENERIC0] = node_attrtype[0];