Replace gl_frag_attrib enum with gl_varying_slot.

This patch makes the following search-and-replace changes:

gl_frag_attrib -> gl_varying_slot
FRAG_ATTRIB_* -> VARYING_SLOT_*
FRAG_BIT_* -> VARYING_BIT_*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Paul Berry 2013-02-23 09:00:58 -08:00
parent f117abe664
commit eed6baf762
72 changed files with 727 additions and 790 deletions

View file

@ -52,13 +52,13 @@ static const builtin_variable builtin_core_vs_variables[] = {
}; };
static const builtin_variable builtin_core_fs_variables[] = { static const builtin_variable builtin_core_fs_variables[] = {
{ ir_var_shader_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" }, { ir_var_shader_in, VARYING_SLOT_POS, "vec4", "gl_FragCoord" },
{ ir_var_shader_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" }, { ir_var_shader_in, VARYING_SLOT_FACE, "bool", "gl_FrontFacing" },
{ ir_var_shader_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" }, { ir_var_shader_out, FRAG_RESULT_COLOR, "vec4", "gl_FragColor" },
}; };
static const builtin_variable builtin_100ES_fs_variables[] = { static const builtin_variable builtin_100ES_fs_variables[] = {
{ ir_var_shader_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" }, { ir_var_shader_in, VARYING_SLOT_PNTC, "vec2", "gl_PointCoord" },
}; };
static const builtin_variable builtin_300ES_vs_variables[] = { static const builtin_variable builtin_300ES_vs_variables[] = {
@ -66,10 +66,10 @@ static const builtin_variable builtin_300ES_vs_variables[] = {
}; };
static const builtin_variable builtin_300ES_fs_variables[] = { static const builtin_variable builtin_300ES_fs_variables[] = {
{ ir_var_shader_in, FRAG_ATTRIB_WPOS, "vec4", "gl_FragCoord" }, { ir_var_shader_in, VARYING_SLOT_POS, "vec4", "gl_FragCoord" },
{ ir_var_shader_in, FRAG_ATTRIB_FACE, "bool", "gl_FrontFacing" }, { ir_var_shader_in, VARYING_SLOT_FACE, "bool", "gl_FrontFacing" },
{ ir_var_shader_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" }, { ir_var_shader_out, FRAG_RESULT_DEPTH, "float", "gl_FragDepth" },
{ ir_var_shader_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" }, { ir_var_shader_in, VARYING_SLOT_PNTC, "vec2", "gl_PointCoord" },
}; };
static const builtin_variable builtin_110_fs_variables[] = { static const builtin_variable builtin_110_fs_variables[] = {
@ -77,9 +77,9 @@ static const builtin_variable builtin_110_fs_variables[] = {
}; };
static const builtin_variable builtin_110_deprecated_fs_variables[] = { static const builtin_variable builtin_110_deprecated_fs_variables[] = {
{ ir_var_shader_in, FRAG_ATTRIB_COL0, "vec4", "gl_Color" }, { ir_var_shader_in, VARYING_SLOT_COL0, "vec4", "gl_Color" },
{ ir_var_shader_in, FRAG_ATTRIB_COL1, "vec4", "gl_SecondaryColor" }, { ir_var_shader_in, VARYING_SLOT_COL1, "vec4", "gl_SecondaryColor" },
{ ir_var_shader_in, FRAG_ATTRIB_FOGC, "float", "gl_FogFragCoord" }, { ir_var_shader_in, VARYING_SLOT_FOGC, "float", "gl_FogFragCoord" },
}; };
static const builtin_variable builtin_110_deprecated_vs_variables[] = { static const builtin_variable builtin_110_deprecated_vs_variables[] = {
@ -105,7 +105,7 @@ static const builtin_variable builtin_110_deprecated_vs_variables[] = {
}; };
static const builtin_variable builtin_120_fs_variables[] = { static const builtin_variable builtin_120_fs_variables[] = {
{ ir_var_shader_in, FRAG_ATTRIB_PNTC, "vec2", "gl_PointCoord" }, { ir_var_shader_in, VARYING_SLOT_PNTC, "vec2", "gl_PointCoord" },
}; };
static const builtin_variable builtin_130_vs_variables[] = { static const builtin_variable builtin_130_vs_variables[] = {
@ -681,7 +681,7 @@ generate_110_uniforms(exec_list *instructions,
glsl_type::get_array_instance(glsl_type::vec4_type, VERT_ATTRIB_MAX); glsl_type::get_array_instance(glsl_type::vec4_type, VERT_ATTRIB_MAX);
add_uniform(instructions, symtab, "gl_CurrentAttribVertMESA", vert_attribs); add_uniform(instructions, symtab, "gl_CurrentAttribVertMESA", vert_attribs);
const glsl_type *const frag_attribs = const glsl_type *const frag_attribs =
glsl_type::get_array_instance(glsl_type::vec4_type, FRAG_ATTRIB_MAX); glsl_type::get_array_instance(glsl_type::vec4_type, VARYING_SLOT_MAX);
add_uniform(instructions, symtab, "gl_CurrentAttribFragMESA", frag_attribs); add_uniform(instructions, symtab, "gl_CurrentAttribFragMESA", frag_attribs);
} }
@ -942,7 +942,7 @@ generate_110_fs_variables(exec_list *instructions,
add_variable(instructions, state->symbols, add_variable(instructions, state->symbols,
"gl_TexCoord", vec4_array_type, ir_var_shader_in, "gl_TexCoord", vec4_array_type, ir_var_shader_in,
FRAG_ATTRIB_TEX0); VARYING_SLOT_TEX0);
generate_ARB_draw_buffers_variables(instructions, state, false, generate_ARB_draw_buffers_variables(instructions, state, false,
fragment_shader); fragment_shader);
@ -1089,7 +1089,7 @@ generate_fs_clipdistance(exec_list *instructions,
add_variable(instructions, state->symbols, add_variable(instructions, state->symbols,
"gl_ClipDistance", clip_distance_array_type, ir_var_shader_in, "gl_ClipDistance", clip_distance_array_type, ir_var_shader_in,
FRAG_ATTRIB_CLIP_DIST0); VARYING_SLOT_CLIP_DIST0);
} }
static void static void

View file

@ -1553,7 +1553,7 @@ ir_variable::determine_interpolation_mode(bool flat_shade)
return (glsl_interp_qualifier) this->interpolation; return (glsl_interp_qualifier) this->interpolation;
int location = this->location; int location = this->location;
bool is_gl_Color = bool is_gl_Color =
location == FRAG_ATTRIB_COL0 || location == FRAG_ATTRIB_COL1; location == VARYING_SLOT_COL0 || location == VARYING_SLOT_COL1;
if (flat_shade && is_gl_Color) if (flat_shade && is_gl_Color)
return INTERP_QUALIFIER_FLAT; return INTERP_QUALIFIER_FLAT;
else else

View file

@ -506,7 +506,7 @@ public:
* *
* - Vertex shader input: one of the values from \c gl_vert_attrib. * - Vertex shader input: one of the values from \c gl_vert_attrib.
* - Vertex shader output: one of the values from \c gl_varying_slot. * - Vertex shader output: one of the values from \c gl_varying_slot.
* - Fragment shader input: one of the values from \c gl_frag_attrib. * - Fragment shader input: one of the values from \c gl_varying_slot.
* - Fragment shader output: one of the values from \c gl_frag_result. * - Fragment shader output: one of the values from \c gl_frag_result.
* - Uniforms: Per-stage uniform slot number for default uniform block. * - Uniforms: Per-stage uniform slot number for default uniform block.
* - Uniforms: Index within the uniform block definition for UBO members. * - Uniforms: Index within the uniform block definition for UBO members.

View file

@ -604,8 +604,8 @@ private:
/** /**
* The location which has been assigned for this varying. This is * The location which has been assigned for this varying. This is
* expressed in multiples of a float, with the first generic varying * expressed in multiples of a float, with the first generic varying
* (i.e. the one referred to by VARYING_SLOT_VAR0 or FRAG_ATTRIB_VAR0) * (i.e. the one referred to by VARYING_SLOT_VAR0) represented by the
* represented by the value 0. * value 0.
*/ */
unsigned generic_location; unsigned generic_location;
} *matches; } *matches;
@ -842,9 +842,9 @@ is_varying_var(GLenum shaderType, const ir_variable *var)
if (shaderType == GL_FRAGMENT_SHADER && if (shaderType == GL_FRAGMENT_SHADER &&
var->mode == ir_var_shader_in) { var->mode == ir_var_shader_in) {
switch (var->location) { switch (var->location) {
case FRAG_ATTRIB_WPOS: case VARYING_SLOT_POS:
case FRAG_ATTRIB_FACE: case VARYING_SLOT_FACE:
case FRAG_ATTRIB_PNTC: case VARYING_SLOT_PNTC:
return false; return false;
default: default:
return true; return true;
@ -958,9 +958,8 @@ assign_varying_locations(struct gl_context *ctx,
unsigned num_tfeedback_decls, unsigned num_tfeedback_decls,
tfeedback_decl *tfeedback_decls) tfeedback_decl *tfeedback_decls)
{ {
/* FINISHME: Set dynamically when geometry shader support is added. */
const unsigned producer_base = VARYING_SLOT_VAR0; const unsigned producer_base = VARYING_SLOT_VAR0;
const unsigned consumer_base = FRAG_ATTRIB_VAR0; const unsigned consumer_base = VARYING_SLOT_VAR0;
varying_matches matches(ctx->Const.DisableVaryingPacking); varying_matches matches(ctx->Const.DisableVaryingPacking);
hash_table *tfeedback_candidates hash_table *tfeedback_candidates
= hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare); = hash_table_ctor(0, hash_table_string_hash, hash_table_string_compare);

View file

@ -1783,7 +1783,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) { if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL) {
link_invalidate_variable_locations( link_invalidate_variable_locations(
prog->_LinkedShaders[MESA_SHADER_FRAGMENT], prog->_LinkedShaders[MESA_SHADER_FRAGMENT],
FRAG_ATTRIB_VAR0, FRAG_RESULT_DATA0); VARYING_SLOT_VAR0, FRAG_RESULT_DATA0);
} }
/* FINISHME: The value of the max_attribute_index parameter is /* FINISHME: The value of the max_attribute_index parameter is

View file

@ -97,43 +97,43 @@ src_vector(struct i915_fragment_program *p,
break; break;
case PROGRAM_INPUT: case PROGRAM_INPUT:
switch (source->Index) { switch (source->Index) {
case FRAG_ATTRIB_WPOS: case VARYING_SLOT_POS:
src = i915_emit_decl(p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL); src = i915_emit_decl(p, REG_TYPE_T, p->wpos_tex, D0_CHANNEL_ALL);
break; break;
case FRAG_ATTRIB_COL0: case VARYING_SLOT_COL0:
src = i915_emit_decl(p, REG_TYPE_T, T_DIFFUSE, D0_CHANNEL_ALL); src = i915_emit_decl(p, REG_TYPE_T, T_DIFFUSE, D0_CHANNEL_ALL);
break; break;
case FRAG_ATTRIB_COL1: case VARYING_SLOT_COL1:
src = i915_emit_decl(p, REG_TYPE_T, T_SPECULAR, D0_CHANNEL_XYZ); src = i915_emit_decl(p, REG_TYPE_T, T_SPECULAR, D0_CHANNEL_XYZ);
src = swizzle(src, X, Y, Z, ONE); src = swizzle(src, X, Y, Z, ONE);
break; break;
case FRAG_ATTRIB_FOGC: case VARYING_SLOT_FOGC:
src = i915_emit_decl(p, REG_TYPE_T, T_FOG_W, D0_CHANNEL_W); src = i915_emit_decl(p, REG_TYPE_T, T_FOG_W, D0_CHANNEL_W);
src = swizzle(src, W, ZERO, ZERO, ONE); src = swizzle(src, W, ZERO, ZERO, ONE);
break; break;
case FRAG_ATTRIB_TEX0: case VARYING_SLOT_TEX0:
case FRAG_ATTRIB_TEX1: case VARYING_SLOT_TEX1:
case FRAG_ATTRIB_TEX2: case VARYING_SLOT_TEX2:
case FRAG_ATTRIB_TEX3: case VARYING_SLOT_TEX3:
case FRAG_ATTRIB_TEX4: case VARYING_SLOT_TEX4:
case FRAG_ATTRIB_TEX5: case VARYING_SLOT_TEX5:
case FRAG_ATTRIB_TEX6: case VARYING_SLOT_TEX6:
case FRAG_ATTRIB_TEX7: case VARYING_SLOT_TEX7:
src = i915_emit_decl(p, REG_TYPE_T, src = i915_emit_decl(p, REG_TYPE_T,
T_TEX0 + (source->Index - FRAG_ATTRIB_TEX0), T_TEX0 + (source->Index - VARYING_SLOT_TEX0),
D0_CHANNEL_ALL); D0_CHANNEL_ALL);
break; break;
case FRAG_ATTRIB_VAR0: case VARYING_SLOT_VAR0:
case FRAG_ATTRIB_VAR0 + 1: case VARYING_SLOT_VAR0 + 1:
case FRAG_ATTRIB_VAR0 + 2: case VARYING_SLOT_VAR0 + 2:
case FRAG_ATTRIB_VAR0 + 3: case VARYING_SLOT_VAR0 + 3:
case FRAG_ATTRIB_VAR0 + 4: case VARYING_SLOT_VAR0 + 4:
case FRAG_ATTRIB_VAR0 + 5: case VARYING_SLOT_VAR0 + 5:
case FRAG_ATTRIB_VAR0 + 6: case VARYING_SLOT_VAR0 + 6:
case FRAG_ATTRIB_VAR0 + 7: case VARYING_SLOT_VAR0 + 7:
src = i915_emit_decl(p, REG_TYPE_T, src = i915_emit_decl(p, REG_TYPE_T,
T_TEX0 + (source->Index - FRAG_ATTRIB_VAR0), T_TEX0 + (source->Index - VARYING_SLOT_VAR0),
D0_CHANNEL_ALL); D0_CHANNEL_ALL);
break; break;
@ -1152,15 +1152,15 @@ check_wpos(struct i915_fragment_program *p)
p->wpos_tex = -1; p->wpos_tex = -1;
for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) { for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
if (inputs & (FRAG_BIT_TEX(i) | FRAG_BIT_VAR(i))) if (inputs & (VARYING_BIT_TEX(i) | VARYING_BIT_VAR(i)))
continue; continue;
else if (inputs & FRAG_BIT_WPOS) { else if (inputs & VARYING_BIT_POS) {
p->wpos_tex = i; p->wpos_tex = i;
inputs &= ~FRAG_BIT_WPOS; inputs &= ~VARYING_BIT_POS;
} }
} }
if (inputs & FRAG_BIT_WPOS) { if (inputs & VARYING_BIT_POS) {
i915_program_error(p, "No free texcoord for wpos value"); i915_program_error(p, "No free texcoord for wpos value");
} }
} }
@ -1359,7 +1359,7 @@ i915ValidateFragmentProgram(struct i915_context *i915)
intel->coloroffset = 0; intel->coloroffset = 0;
intel->specoffset = 0; intel->specoffset = 0;
if (inputsRead & FRAG_BITS_TEX_ANY || p->wpos_tex != -1) { if (inputsRead & VARYING_BITS_TEX_ANY || p->wpos_tex != -1) {
EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16); EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, S4_VFMT_XYZW, 16);
} }
else { else {
@ -1370,22 +1370,22 @@ i915ValidateFragmentProgram(struct i915_context *i915)
if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled)
EMIT_ATTR(_TNL_ATTRIB_POINTSIZE, EMIT_1F, S4_VFMT_POINT_WIDTH, 4); EMIT_ATTR(_TNL_ATTRIB_POINTSIZE, EMIT_1F, S4_VFMT_POINT_WIDTH, 4);
if (inputsRead & FRAG_BIT_COL0) { if (inputsRead & VARYING_BIT_COL0) {
intel->coloroffset = offset / 4; intel->coloroffset = offset / 4;
EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4); EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA, S4_VFMT_COLOR, 4);
} }
if (inputsRead & FRAG_BIT_COL1) { if (inputsRead & VARYING_BIT_COL1) {
intel->specoffset = offset / 4; intel->specoffset = offset / 4;
EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_4UB_4F_BGRA, S4_VFMT_SPEC_FOG, 4); EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_4UB_4F_BGRA, S4_VFMT_SPEC_FOG, 4);
} }
if ((inputsRead & FRAG_BIT_FOGC)) { if ((inputsRead & VARYING_BIT_FOGC)) {
EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4); EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1F, S4_VFMT_FOG_PARAM, 4);
} }
for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) { for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
if (inputsRead & FRAG_BIT_TEX(i)) { if (inputsRead & VARYING_BIT_TEX(i)) {
int sz = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size; int sz = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size;
s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK); s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK);
@ -1393,7 +1393,7 @@ i915ValidateFragmentProgram(struct i915_context *i915)
EMIT_ATTR(_TNL_ATTRIB_TEX0 + i, EMIT_SZ(sz), 0, sz * 4); EMIT_ATTR(_TNL_ATTRIB_TEX0 + i, EMIT_SZ(sz), 0, sz * 4);
} }
else if (inputsRead & FRAG_BIT_VAR(i)) { else if (inputsRead & VARYING_BIT_VAR(i)) {
int sz = VB->AttribPtr[_TNL_ATTRIB_GENERIC0 + i]->size; int sz = VB->AttribPtr[_TNL_ATTRIB_GENERIC0 + i]->size;
s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK); s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK);

View file

@ -671,7 +671,7 @@ i915_update_sprite_point_enable(struct gl_context *ctx)
/* _NEW_POINT */ /* _NEW_POINT */
if (ctx->Point.CoordReplace[i] && ctx->Point.PointSprite) if (ctx->Point.CoordReplace[i] && ctx->Point.PointSprite)
coord_replace_bits |= (1 << i); coord_replace_bits |= (1 << i);
if (inputsRead & FRAG_BIT_TEX(i)) if (inputsRead & VARYING_BIT_TEX(i))
tex_coord_unit_bits |= (1 << i); tex_coord_unit_bits |= (1 << i);
} }

View file

@ -955,7 +955,7 @@ intelChooseRenderState(struct gl_context * ctx)
struct intel_context *intel = intel_context(ctx); struct intel_context *intel = intel_context(ctx);
GLuint flags = ctx->_TriangleCaps; GLuint flags = ctx->_TriangleCaps;
const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current; const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current;
bool have_wpos = (fprog && (fprog->Base.InputsRead & FRAG_BIT_WPOS)); bool have_wpos = (fprog && (fprog->Base.InputsRead & VARYING_BIT_POS));
GLuint index = 0; GLuint index = 0;
if (INTEL_DEBUG & DEBUG_STATE) if (INTEL_DEBUG & DEBUG_STATE)

View file

@ -953,7 +953,7 @@ fs_visitor::emit_fragcoord_interpolation(ir_variable *ir)
emit(FS_OPCODE_LINTERP, wpos, emit(FS_OPCODE_LINTERP, wpos,
this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC], this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC],
this->delta_y[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC], this->delta_y[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC],
interp_reg(FRAG_ATTRIB_WPOS, 2)); interp_reg(VARYING_SLOT_POS, 2));
} }
wpos.reg_offset++; wpos.reg_offset++;
@ -1042,8 +1042,8 @@ fs_visitor::emit_general_interpolation(ir_variable *ir)
* attribute, as well as making brw_vs_constval.c * attribute, as well as making brw_vs_constval.c
* handle varyings other than gl_TexCoord. * handle varyings other than gl_TexCoord.
*/ */
if (location >= FRAG_ATTRIB_TEX0 && if (location >= VARYING_SLOT_TEX0 &&
location <= FRAG_ATTRIB_TEX7 && location <= VARYING_SLOT_TEX7 &&
k == 3 && !(c->key.proj_attrib_mask k == 3 && !(c->key.proj_attrib_mask
& BITFIELD64_BIT(location))) { & BITFIELD64_BIT(location))) {
emit(BRW_OPCODE_MOV, attr, fs_reg(1.0f)); emit(BRW_OPCODE_MOV, attr, fs_reg(1.0f));
@ -1245,14 +1245,14 @@ fs_visitor::assign_curb_setup()
void void
fs_visitor::calculate_urb_setup() fs_visitor::calculate_urb_setup()
{ {
for (unsigned int i = 0; i < FRAG_ATTRIB_MAX; i++) { for (unsigned int i = 0; i < VARYING_SLOT_MAX; i++) {
urb_setup[i] = -1; urb_setup[i] = -1;
} }
int urb_next = 0; int urb_next = 0;
/* Figure out where each of the incoming setup attributes lands. */ /* Figure out where each of the incoming setup attributes lands. */
if (intel->gen >= 6) { if (intel->gen >= 6) {
for (unsigned int i = 0; i < FRAG_ATTRIB_MAX; i++) { for (unsigned int i = 0; i < VARYING_SLOT_MAX; i++) {
if (fp->Base.InputsRead & BITFIELD64_BIT(i)) { if (fp->Base.InputsRead & BITFIELD64_BIT(i)) {
urb_setup[i] = urb_next++; urb_setup[i] = urb_next++;
} }
@ -1283,8 +1283,8 @@ fs_visitor::calculate_urb_setup()
* *
* See compile_sf_prog() for more info. * See compile_sf_prog() for more info.
*/ */
if (fp->Base.InputsRead & BITFIELD64_BIT(FRAG_ATTRIB_PNTC)) if (fp->Base.InputsRead & BITFIELD64_BIT(VARYING_SLOT_PNTC))
urb_setup[FRAG_ATTRIB_PNTC] = urb_next++; urb_setup[VARYING_SLOT_PNTC] = urb_next++;
} }
/* Each attribute is 4 setup channels, each of which is half a reg. */ /* Each attribute is 4 setup channels, each of which is half a reg. */
@ -2690,7 +2690,7 @@ fs_visitor::setup_payload_gen6()
{ {
struct intel_context *intel = &brw->intel; struct intel_context *intel = &brw->intel;
bool uses_depth = bool uses_depth =
(fp->Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0; (fp->Base.InputsRead & (1 << VARYING_SLOT_POS)) != 0;
unsigned barycentric_interp_modes = c->prog_data.barycentric_interp_modes; unsigned barycentric_interp_modes = c->prog_data.barycentric_interp_modes;
assert(intel->gen >= 6); assert(intel->gen >= 6);
@ -2989,9 +2989,9 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
key.proj_attrib_mask = ~(GLbitfield64) 0; key.proj_attrib_mask = ~(GLbitfield64) 0;
if (intel->gen < 6) if (intel->gen < 6)
key.vp_outputs_written |= BITFIELD64_BIT(FRAG_ATTRIB_WPOS); key.vp_outputs_written |= BITFIELD64_BIT(VARYING_SLOT_POS);
for (int i = 0; i < FRAG_ATTRIB_MAX; i++) { for (int i = 0; i < VARYING_SLOT_MAX; i++) {
if (!(fp->Base.InputsRead & BITFIELD64_BIT(i))) if (!(fp->Base.InputsRead & BITFIELD64_BIT(i)))
continue; continue;
@ -3017,11 +3017,11 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
} }
} }
if (fp->Base.InputsRead & FRAG_BIT_WPOS) { if (fp->Base.InputsRead & VARYING_BIT_POS) {
key.drawable_height = ctx->DrawBuffer->Height; key.drawable_height = ctx->DrawBuffer->Height;
} }
if ((fp->Base.InputsRead & FRAG_BIT_WPOS) || program_uses_dfdy) { if ((fp->Base.InputsRead & VARYING_BIT_POS) || program_uses_dfdy) {
key.render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer); key.render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
} }

View file

@ -452,7 +452,7 @@ public:
int first_non_payload_grf; int first_non_payload_grf;
/** Either BRW_MAX_GRF or GEN7_MRF_HACK_START */ /** Either BRW_MAX_GRF or GEN7_MRF_HACK_START */
int max_grf; int max_grf;
int urb_setup[FRAG_ATTRIB_MAX]; int urb_setup[VARYING_SLOT_MAX];
fs_reg *fp_temp_regs; fs_reg *fp_temp_regs;
fs_reg *fp_input_regs; fs_reg *fp_input_regs;

View file

@ -599,8 +599,8 @@ fs_visitor::setup_fp_regs()
} }
} }
fp_input_regs = rzalloc_array(mem_ctx, fs_reg, FRAG_ATTRIB_MAX); fp_input_regs = rzalloc_array(mem_ctx, fs_reg, VARYING_SLOT_MAX);
for (int i = 0; i < FRAG_ATTRIB_MAX; i++) { for (int i = 0; i < VARYING_SLOT_MAX; i++) {
if (fp->Base.InputsRead & BITFIELD64_BIT(i)) { if (fp->Base.InputsRead & BITFIELD64_BIT(i)) {
/* Make up a dummy instruction to reuse code for emitting /* Make up a dummy instruction to reuse code for emitting
* interpolation. * interpolation.
@ -614,18 +614,18 @@ fs_visitor::setup_fp_regs()
i); i);
switch (i) { switch (i) {
case FRAG_ATTRIB_WPOS: case VARYING_SLOT_POS:
ir->pixel_center_integer = fp->PixelCenterInteger; ir->pixel_center_integer = fp->PixelCenterInteger;
ir->origin_upper_left = fp->OriginUpperLeft; ir->origin_upper_left = fp->OriginUpperLeft;
fp_input_regs[i] = *emit_fragcoord_interpolation(ir); fp_input_regs[i] = *emit_fragcoord_interpolation(ir);
break; break;
case FRAG_ATTRIB_FACE: case VARYING_SLOT_FACE:
fp_input_regs[i] = *emit_frontfacing_interpolation(ir); fp_input_regs[i] = *emit_frontfacing_interpolation(ir);
break; break;
default: default:
fp_input_regs[i] = *emit_general_interpolation(ir); fp_input_regs[i] = *emit_general_interpolation(ir);
if (i == FRAG_ATTRIB_FOGC) { if (i == VARYING_SLOT_FOGC) {
emit(MOV(regoffset(fp_input_regs[i], 1), fs_reg(0.0f))); emit(MOV(regoffset(fp_input_regs[i], 1), fs_reg(0.0f)));
emit(MOV(regoffset(fp_input_regs[i], 2), fs_reg(0.0f))); emit(MOV(regoffset(fp_input_regs[i], 2), fs_reg(0.0f)));
emit(MOV(regoffset(fp_input_regs[i], 3), fs_reg(1.0f))); emit(MOV(regoffset(fp_input_regs[i], 3), fs_reg(1.0f)));

View file

@ -2034,7 +2034,7 @@ fs_visitor::emit_interpolation_setup_gen4()
emit(FS_OPCODE_LINTERP, wpos_w, emit(FS_OPCODE_LINTERP, wpos_w,
this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC], this->delta_x[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC],
this->delta_y[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC], this->delta_y[BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC],
interp_reg(FRAG_ATTRIB_WPOS, 3)); interp_reg(VARYING_SLOT_POS, 3));
/* Compute the pixel 1/W value from wpos.w. */ /* Compute the pixel 1/W value from wpos.w. */
this->pixel_w = fs_reg(this, glsl_type::float_type); this->pixel_w = fs_reg(this, glsl_type::float_type);
emit_math(SHADER_OPCODE_RCP, this->pixel_w, wpos_w); emit_math(SHADER_OPCODE_RCP, this->pixel_w, wpos_w);

View file

@ -181,7 +181,7 @@ brw_upload_sf_prog(struct brw_context *brw)
key.point_sprite_coord_replace |= (1 << i); key.point_sprite_coord_replace |= (1 << i);
} }
} }
if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(FRAG_ATTRIB_PNTC)) if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(VARYING_SLOT_PNTC))
key.do_point_coord = 1; key.do_point_coord = 1;
/* /*
* Window coordinates in a FBO are inverted, which means point * Window coordinates in a FBO are inverted, which means point

View file

@ -244,10 +244,10 @@ static void calc_wm_input_sizes( struct brw_context *brw )
if (ctx->Point.PointSprite) { if (ctx->Point.PointSprite) {
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
if (ctx->Point.CoordReplace[i]) { if (ctx->Point.CoordReplace[i]) {
t.size_masks[4-1] |= FRAG_BIT_TEX(i); t.size_masks[4-1] |= VARYING_BIT_TEX(i);
t.size_masks[3-1] |= FRAG_BIT_TEX(i); t.size_masks[3-1] |= VARYING_BIT_TEX(i);
t.size_masks[2-1] |= FRAG_BIT_TEX(i); t.size_masks[2-1] |= VARYING_BIT_TEX(i);
t.size_masks[1-1] |= FRAG_BIT_TEX(i); t.size_masks[1-1] |= VARYING_BIT_TEX(i);
} }
} }
} }

View file

@ -55,18 +55,18 @@ brw_compute_barycentric_interp_modes(struct brw_context *brw,
* modes are in use, and set the appropriate bits in * modes are in use, and set the appropriate bits in
* barycentric_interp_modes. * barycentric_interp_modes.
*/ */
for (attr = 0; attr < FRAG_ATTRIB_MAX; ++attr) { for (attr = 0; attr < VARYING_SLOT_MAX; ++attr) {
enum glsl_interp_qualifier interp_qualifier = enum glsl_interp_qualifier interp_qualifier =
fprog->InterpQualifier[attr]; fprog->InterpQualifier[attr];
bool is_centroid = fprog->IsCentroid & BITFIELD64_BIT(attr); bool is_centroid = fprog->IsCentroid & BITFIELD64_BIT(attr);
bool is_gl_Color = attr == FRAG_ATTRIB_COL0 || attr == FRAG_ATTRIB_COL1; bool is_gl_Color = attr == VARYING_SLOT_COL0 || attr == VARYING_SLOT_COL1;
/* Ignore unused inputs. */ /* Ignore unused inputs. */
if (!(fprog->Base.InputsRead & BITFIELD64_BIT(attr))) if (!(fprog->Base.InputsRead & BITFIELD64_BIT(attr)))
continue; continue;
/* Ignore WPOS and FACE, because they don't require interpolation. */ /* Ignore WPOS and FACE, because they don't require interpolation. */
if (attr == FRAG_ATTRIB_WPOS || attr == FRAG_ATTRIB_FACE) if (attr == VARYING_SLOT_POS || attr == VARYING_SLOT_FACE)
continue; continue;
/* Determine the set (or sets) of barycentric coordinates needed to /* Determine the set (or sets) of barycentric coordinates needed to
@ -462,11 +462,11 @@ static void brw_wm_populate_key( struct brw_context *brw,
* For DRI2 the origin_x/y will always be (0,0) but we still need the * For DRI2 the origin_x/y will always be (0,0) but we still need the
* drawable height in order to invert the Y axis. * drawable height in order to invert the Y axis.
*/ */
if (fp->program.Base.InputsRead & FRAG_BIT_WPOS) { if (fp->program.Base.InputsRead & VARYING_BIT_POS) {
key->drawable_height = ctx->DrawBuffer->Height; key->drawable_height = ctx->DrawBuffer->Height;
} }
if ((fp->program.Base.InputsRead & FRAG_BIT_WPOS) || program_uses_dfdy) { if ((fp->program.Base.InputsRead & VARYING_BIT_POS) || program_uses_dfdy) {
key->render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer); key->render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
} }

View file

@ -126,7 +126,7 @@ void fs_visitor::setup_payload_gen4()
bool kill_stats_promoted_workaround = false; bool kill_stats_promoted_workaround = false;
int lookup = c->key.iz_lookup; int lookup = c->key.iz_lookup;
bool uses_depth = bool uses_depth =
(fp->Base.InputsRead & (1 << FRAG_ATTRIB_WPOS)) != 0; (fp->Base.InputsRead & (1 << VARYING_SLOT_POS)) != 0;
assert(lookup < IZ_BIT_MAX); assert(lookup < IZ_BIT_MAX);

View file

@ -150,7 +150,7 @@ brw_upload_wm_unit(struct brw_context *brw)
/* BRW_NEW_FRAGMENT_PROGRAM */ /* BRW_NEW_FRAGMENT_PROGRAM */
wm->wm5.program_uses_depth = (fp->Base.InputsRead & wm->wm5.program_uses_depth = (fp->Base.InputsRead &
(1 << FRAG_ATTRIB_WPOS)) != 0; (1 << VARYING_SLOT_POS)) != 0;
wm->wm5.program_computes_depth = (fp->Base.OutputsWritten & wm->wm5.program_computes_depth = (fp->Base.OutputsWritten &
BITFIELD64_BIT(FRAG_RESULT_DEPTH)) != 0; BITFIELD64_BIT(FRAG_RESULT_DEPTH)) != 0;
/* _NEW_BUFFERS /* _NEW_BUFFERS

View file

@ -56,7 +56,7 @@ uint32_t
get_attr_override(struct brw_vue_map *vue_map, int urb_entry_read_offset, get_attr_override(struct brw_vue_map *vue_map, int urb_entry_read_offset,
int fs_attr, bool two_side_color, uint32_t *max_source_attr) int fs_attr, bool two_side_color, uint32_t *max_source_attr)
{ {
if (fs_attr == FRAG_ATTRIB_WPOS) { if (fs_attr == VARYING_SLOT_POS) {
/* This attribute will be overwritten by the fragment shader's /* This attribute will be overwritten by the fragment shader's
* interpolation code (see emit_interp() in brw_wm_fp.c), so just let it * interpolation code (see emit_interp() in brw_wm_fp.c), so just let it
* reference the first available attribute. * reference the first available attribute.
@ -141,7 +141,7 @@ upload_sf_state(struct brw_context *brw)
int attr = 0, input_index = 0; int attr = 0, input_index = 0;
int urb_entry_read_offset = 1; int urb_entry_read_offset = 1;
float point_size; float point_size;
uint16_t attr_overrides[FRAG_ATTRIB_MAX]; uint16_t attr_overrides[VARYING_SLOT_MAX];
uint32_t point_sprite_origin; uint32_t point_sprite_origin;
dw1 = GEN6_SF_SWIZZLE_ENABLE | num_outputs << GEN6_SF_NUM_OUTPUTS_SHIFT; dw1 = GEN6_SF_SWIZZLE_ENABLE | num_outputs << GEN6_SF_NUM_OUTPUTS_SHIFT;
@ -281,22 +281,22 @@ upload_sf_state(struct brw_context *brw)
* they source from. * they source from.
*/ */
uint32_t max_source_attr = 0; uint32_t max_source_attr = 0;
for (; attr < FRAG_ATTRIB_MAX; attr++) { for (; attr < VARYING_SLOT_MAX; attr++) {
enum glsl_interp_qualifier interp_qualifier = enum glsl_interp_qualifier interp_qualifier =
brw->fragment_program->InterpQualifier[attr]; brw->fragment_program->InterpQualifier[attr];
bool is_gl_Color = attr == FRAG_ATTRIB_COL0 || attr == FRAG_ATTRIB_COL1; bool is_gl_Color = attr == VARYING_SLOT_COL0 || attr == VARYING_SLOT_COL1;
if (!(brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr))) if (!(brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr)))
continue; continue;
/* _NEW_POINT */ /* _NEW_POINT */
if (ctx->Point.PointSprite && if (ctx->Point.PointSprite &&
(attr >= FRAG_ATTRIB_TEX0 && attr <= FRAG_ATTRIB_TEX7) && (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7) &&
ctx->Point.CoordReplace[attr - FRAG_ATTRIB_TEX0]) { ctx->Point.CoordReplace[attr - VARYING_SLOT_TEX0]) {
dw16 |= (1 << input_index); dw16 |= (1 << input_index);
} }
if (attr == FRAG_ATTRIB_PNTC) if (attr == VARYING_SLOT_PNTC)
dw16 |= (1 << input_index); dw16 |= (1 << input_index);
/* flat shading */ /* flat shading */
@ -320,7 +320,7 @@ upload_sf_state(struct brw_context *brw)
&max_source_attr); &max_source_attr);
} }
for (; input_index < FRAG_ATTRIB_MAX; input_index++) for (; input_index < VARYING_SLOT_MAX; input_index++)
attr_overrides[input_index] = 0; attr_overrides[input_index] = 0;
/* From the Sandy Bridge PRM, Volume 2, Part 1, documentation for /* From the Sandy Bridge PRM, Volume 2, Part 1, documentation for

View file

@ -171,7 +171,7 @@ upload_wm_state(struct brw_context *brw)
dw5 |= GEN6_WM_POLYGON_STIPPLE_ENABLE; dw5 |= GEN6_WM_POLYGON_STIPPLE_ENABLE;
/* BRW_NEW_FRAGMENT_PROGRAM */ /* BRW_NEW_FRAGMENT_PROGRAM */
if (fp->program.Base.InputsRead & FRAG_BIT_WPOS) if (fp->program.Base.InputsRead & VARYING_BIT_POS)
dw5 |= GEN6_WM_USES_SOURCE_DEPTH | GEN6_WM_USES_SOURCE_W; dw5 |= GEN6_WM_USES_SOURCE_DEPTH | GEN6_WM_USES_SOURCE_W;
if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH))
dw5 |= GEN6_WM_COMPUTED_DEPTH; dw5 |= GEN6_WM_COMPUTED_DEPTH;

View file

@ -42,7 +42,7 @@ upload_sbe_state(struct brw_context *brw)
int i; int i;
int attr = 0, input_index = 0; int attr = 0, input_index = 0;
int urb_entry_read_offset = 1; int urb_entry_read_offset = 1;
uint16_t attr_overrides[FRAG_ATTRIB_MAX]; uint16_t attr_overrides[VARYING_SLOT_MAX];
/* _NEW_BUFFERS */ /* _NEW_BUFFERS */
bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer); bool render_to_fbo = _mesa_is_user_fbo(ctx->DrawBuffer);
uint32_t point_sprite_origin; uint32_t point_sprite_origin;
@ -70,21 +70,21 @@ upload_sbe_state(struct brw_context *brw)
* they source from. * they source from.
*/ */
uint32_t max_source_attr = 0; uint32_t max_source_attr = 0;
for (; attr < FRAG_ATTRIB_MAX; attr++) { for (; attr < VARYING_SLOT_MAX; attr++) {
enum glsl_interp_qualifier interp_qualifier = enum glsl_interp_qualifier interp_qualifier =
brw->fragment_program->InterpQualifier[attr]; brw->fragment_program->InterpQualifier[attr];
bool is_gl_Color = attr == FRAG_ATTRIB_COL0 || attr == FRAG_ATTRIB_COL1; bool is_gl_Color = attr == VARYING_SLOT_COL0 || attr == VARYING_SLOT_COL1;
if (!(brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr))) if (!(brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(attr)))
continue; continue;
if (ctx->Point.PointSprite && if (ctx->Point.PointSprite &&
attr >= FRAG_ATTRIB_TEX0 && attr <= FRAG_ATTRIB_TEX7 && attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7 &&
ctx->Point.CoordReplace[attr - FRAG_ATTRIB_TEX0]) { ctx->Point.CoordReplace[attr - VARYING_SLOT_TEX0]) {
dw10 |= (1 << input_index); dw10 |= (1 << input_index);
} }
if (attr == FRAG_ATTRIB_PNTC) if (attr == VARYING_SLOT_PNTC)
dw10 |= (1 << input_index); dw10 |= (1 << input_index);
/* flat shading */ /* flat shading */
@ -123,7 +123,7 @@ upload_sbe_state(struct brw_context *brw)
dw1 |= urb_entry_read_length << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT | dw1 |= urb_entry_read_length << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT |
urb_entry_read_offset << GEN7_SBE_URB_ENTRY_READ_OFFSET_SHIFT; urb_entry_read_offset << GEN7_SBE_URB_ENTRY_READ_OFFSET_SHIFT;
for (; input_index < FRAG_ATTRIB_MAX; input_index++) for (; input_index < VARYING_SLOT_MAX; input_index++)
attr_overrides[input_index] = 0; attr_overrides[input_index] = 0;
BEGIN_BATCH(14); BEGIN_BATCH(14);

View file

@ -58,7 +58,7 @@ upload_wm_state(struct brw_context *brw)
dw1 |= GEN7_WM_POLYGON_STIPPLE_ENABLE; dw1 |= GEN7_WM_POLYGON_STIPPLE_ENABLE;
/* BRW_NEW_FRAGMENT_PROGRAM */ /* BRW_NEW_FRAGMENT_PROGRAM */
if (fp->program.Base.InputsRead & FRAG_BIT_WPOS) if (fp->program.Base.InputsRead & VARYING_BIT_POS)
dw1 |= GEN7_WM_USES_SOURCE_DEPTH | GEN7_WM_USES_SOURCE_W; dw1 |= GEN7_WM_USES_SOURCE_DEPTH | GEN7_WM_USES_SOURCE_W;
if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) {
writes_depth = true; writes_depth = true;

View file

@ -423,10 +423,10 @@ xor_line(struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1)
vert1->color[0], vert1->color[1], vert1->color[0], vert1->color[1],
vert1->color[2], vert1->color[3], vert1->color[2], vert1->color[3],
xmesa->pixelformat); xmesa->pixelformat);
int x0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][0]; int x0 = (GLint) vert0->attrib[VARYING_SLOT_POS][0];
int y0 = YFLIP(xrb, (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][1]); int y0 = YFLIP(xrb, (GLint) vert0->attrib[VARYING_SLOT_POS][1]);
int x1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][0]; int x1 = (GLint) vert1->attrib[VARYING_SLOT_POS][0];
int y1 = YFLIP(xrb, (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][1]); int y1 = YFLIP(xrb, (GLint) vert1->attrib[VARYING_SLOT_POS][1]);
XMesaSetForeground(dpy, gc, pixel); XMesaSetForeground(dpy, gc, pixel);
XMesaSetFunction(dpy, gc, GXxor); XMesaSetFunction(dpy, gc, GXxor);
XSetLineAttributes(dpy, gc, (int) ctx->Line.Width, XSetLineAttributes(dpy, gc, (int) ctx->Line.Width,

View file

@ -344,7 +344,6 @@ dummy_enum_func(void)
{ {
gl_buffer_index bi = BUFFER_FRONT_LEFT; gl_buffer_index bi = BUFFER_FRONT_LEFT;
gl_face_index fi = FACE_POS_X; gl_face_index fi = FACE_POS_X;
gl_frag_attrib fa = FRAG_ATTRIB_WPOS;
gl_frag_result fr = FRAG_RESULT_DEPTH; gl_frag_result fr = FRAG_RESULT_DEPTH;
gl_texture_index ti = TEXTURE_2D_ARRAY_INDEX; gl_texture_index ti = TEXTURE_2D_ARRAY_INDEX;
gl_vert_attrib va = VERT_ATTRIB_POS; gl_vert_attrib va = VERT_ATTRIB_POS;
@ -352,7 +351,6 @@ dummy_enum_func(void)
(void) bi; (void) bi;
(void) fi; (void) fi;
(void) fa;
(void) fr; (void) fr;
(void) ti; (void) ti;
(void) va; (void) va;
@ -675,7 +673,7 @@ check_context_limits(struct gl_context *ctx)
/* check that we don't exceed the size of various bitfields */ /* check that we don't exceed the size of various bitfields */
assert(VARYING_SLOT_MAX <= assert(VARYING_SLOT_MAX <=
(8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten))); (8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten)));
assert(FRAG_ATTRIB_MAX <= assert(VARYING_SLOT_MAX <=
(8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead))); (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead)));
assert(MAX_COMBINED_TEXTURE_IMAGE_UNITS <= 8 * sizeof(GLbitfield)); assert(MAX_COMBINED_TEXTURE_IMAGE_UNITS <= 8 * sizeof(GLbitfield));

View file

@ -333,7 +333,7 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
} }
else if (ctx->RenderMode == GL_FEEDBACK) { else if (ctx->RenderMode == GL_FEEDBACK) {
/* _NEW_RENDERMODE */ /* _NEW_RENDERMODE */
fp_inputs = (FRAG_BIT_COL0 | FRAG_BIT_TEX0); fp_inputs = (VARYING_BIT_COL0 | VARYING_BIT_TEX0);
} }
else if (!(vertexProgram || vertexShader)) { else if (!(vertexProgram || vertexShader)) {
/* Fixed function vertex logic */ /* Fixed function vertex logic */
@ -345,33 +345,33 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
*/ */
/* _NEW_POINT */ /* _NEW_POINT */
if (ctx->Point.PointSprite) if (ctx->Point.PointSprite)
varying_inputs |= FRAG_BITS_TEX_ANY; varying_inputs |= VARYING_BITS_TEX_ANY;
/* First look at what values may be computed by the generated /* First look at what values may be computed by the generated
* vertex program: * vertex program:
*/ */
/* _NEW_LIGHT */ /* _NEW_LIGHT */
if (ctx->Light.Enabled) { if (ctx->Light.Enabled) {
fp_inputs |= FRAG_BIT_COL0; fp_inputs |= VARYING_BIT_COL0;
if (texenv_doing_secondary_color(ctx)) if (texenv_doing_secondary_color(ctx))
fp_inputs |= FRAG_BIT_COL1; fp_inputs |= VARYING_BIT_COL1;
} }
/* _NEW_TEXTURE */ /* _NEW_TEXTURE */
fp_inputs |= (ctx->Texture._TexGenEnabled | fp_inputs |= (ctx->Texture._TexGenEnabled |
ctx->Texture._TexMatEnabled) << FRAG_ATTRIB_TEX0; ctx->Texture._TexMatEnabled) << VARYING_SLOT_TEX0;
/* Then look at what might be varying as a result of enabled /* Then look at what might be varying as a result of enabled
* arrays, etc: * arrays, etc:
*/ */
if (varying_inputs & VERT_BIT_COLOR0) if (varying_inputs & VERT_BIT_COLOR0)
fp_inputs |= FRAG_BIT_COL0; fp_inputs |= VARYING_BIT_COL0;
if (varying_inputs & VERT_BIT_COLOR1) if (varying_inputs & VERT_BIT_COLOR1)
fp_inputs |= FRAG_BIT_COL1; fp_inputs |= VARYING_BIT_COL1;
fp_inputs |= (((varying_inputs & VERT_BIT_TEX_ANY) >> VERT_ATTRIB_TEX0) fp_inputs |= (((varying_inputs & VERT_BIT_TEX_ANY) >> VERT_ATTRIB_TEX0)
<< FRAG_ATTRIB_TEX0); << VARYING_SLOT_TEX0);
} }
else { else {
@ -395,15 +395,15 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
*/ */
/* _NEW_POINT */ /* _NEW_POINT */
if (ctx->Point.PointSprite) if (ctx->Point.PointSprite)
vp_outputs |= FRAG_BITS_TEX_ANY; vp_outputs |= VARYING_BITS_TEX_ANY;
if (vp_outputs & (1 << VARYING_SLOT_COL0)) if (vp_outputs & (1 << VARYING_SLOT_COL0))
fp_inputs |= FRAG_BIT_COL0; fp_inputs |= VARYING_BIT_COL0;
if (vp_outputs & (1 << VARYING_SLOT_COL1)) if (vp_outputs & (1 << VARYING_SLOT_COL1))
fp_inputs |= FRAG_BIT_COL1; fp_inputs |= VARYING_BIT_COL1;
fp_inputs |= (((vp_outputs & VARYING_BITS_TEX_ANY) >> VARYING_SLOT_TEX0) fp_inputs |= (((vp_outputs & VARYING_BITS_TEX_ANY) >> VARYING_SLOT_TEX0)
<< FRAG_ATTRIB_TEX0); << VARYING_SLOT_TEX0);
} }
return fp_inputs; return fp_inputs;
@ -417,7 +417,7 @@ static GLbitfield get_fp_input_mask( struct gl_context *ctx )
static GLuint make_state_key( struct gl_context *ctx, struct state_key *key ) static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
{ {
GLuint i, j; GLuint i, j;
GLbitfield inputs_referenced = FRAG_BIT_COL0; GLbitfield inputs_referenced = VARYING_BIT_COL0;
const GLbitfield inputs_available = get_fp_input_mask( ctx ); const GLbitfield inputs_available = get_fp_input_mask( ctx );
GLuint keySize; GLuint keySize;
@ -440,7 +440,7 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
key->unit[i].enabled = 1; key->unit[i].enabled = 1;
key->enabled_units |= (1<<i); key->enabled_units |= (1<<i);
key->nr_enabled_units = i + 1; key->nr_enabled_units = i + 1;
inputs_referenced |= FRAG_BIT_TEX(i); inputs_referenced |= VARYING_BIT_TEX(i);
key->unit[i].source_index = key->unit[i].source_index =
translate_tex_src_bit(texUnit->_ReallyEnabled); translate_tex_src_bit(texUnit->_ReallyEnabled);
@ -482,14 +482,14 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
/* _NEW_LIGHT | _NEW_FOG */ /* _NEW_LIGHT | _NEW_FOG */
if (texenv_doing_secondary_color(ctx)) { if (texenv_doing_secondary_color(ctx)) {
key->separate_specular = 1; key->separate_specular = 1;
inputs_referenced |= FRAG_BIT_COL1; inputs_referenced |= VARYING_BIT_COL1;
} }
/* _NEW_FOG */ /* _NEW_FOG */
if (ctx->Fog.Enabled) { if (ctx->Fog.Enabled) {
key->fog_enabled = 1; key->fog_enabled = 1;
key->fog_mode = translate_fog_mode(ctx->Fog.Mode); key->fog_mode = translate_fog_mode(ctx->Fog.Mode);
inputs_referenced |= FRAG_BIT_FOGC; /* maybe */ inputs_referenced |= VARYING_BIT_FOGC; /* maybe */
} }
/* _NEW_BUFFERS */ /* _NEW_BUFFERS */
@ -553,7 +553,7 @@ get_current_attrib(texenv_fragment_program *p, GLuint attrib)
static ir_rvalue * static ir_rvalue *
get_gl_Color(texenv_fragment_program *p) get_gl_Color(texenv_fragment_program *p)
{ {
if (p->state->inputs_available & FRAG_BIT_COL0) { if (p->state->inputs_available & VARYING_BIT_COL0) {
ir_variable *var = p->shader->symbols->get_variable("gl_Color"); ir_variable *var = p->shader->symbols->get_variable("gl_Color");
assert(var); assert(var);
return new(p->mem_ctx) ir_dereference_variable(var); return new(p->mem_ctx) ir_dereference_variable(var);
@ -918,7 +918,7 @@ static void load_texture( texenv_fragment_program *p, GLuint unit )
const GLuint texTarget = p->state->unit[unit].source_index; const GLuint texTarget = p->state->unit[unit].source_index;
ir_rvalue *texcoord; ir_rvalue *texcoord;
if (!(p->state->inputs_available & (FRAG_BIT_TEX0 << unit))) { if (!(p->state->inputs_available & (VARYING_BIT_TEX0 << unit))) {
texcoord = get_current_attrib(p, VERT_ATTRIB_TEX0 + unit); texcoord = get_current_attrib(p, VERT_ATTRIB_TEX0 + unit);
} else if (p->texcoord_tex[unit]) { } else if (p->texcoord_tex[unit]) {
texcoord = new(p->mem_ctx) ir_dereference_variable(p->texcoord_tex[unit]); texcoord = new(p->mem_ctx) ir_dereference_variable(p->texcoord_tex[unit]);
@ -1253,7 +1253,7 @@ emit_instructions(texenv_fragment_program *p)
p->emit(assign(spec_result, cf)); p->emit(assign(spec_result, cf));
ir_rvalue *secondary; ir_rvalue *secondary;
if (p->state->inputs_available & FRAG_BIT_COL1) { if (p->state->inputs_available & VARYING_BIT_COL1) {
ir_variable *var = ir_variable *var =
p->shader->symbols->get_variable("gl_SecondaryColor"); p->shader->symbols->get_variable("gl_SecondaryColor");
assert(var); assert(var);

View file

@ -165,7 +165,7 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
if (ctx->RenderMode == GL_FEEDBACK) { if (ctx->RenderMode == GL_FEEDBACK) {
/* make sure the vertprog emits color and tex0 */ /* make sure the vertprog emits color and tex0 */
key->fragprog_inputs_read |= (FRAG_BIT_COL0 | FRAG_BIT_TEX0); key->fragprog_inputs_read |= (VARYING_BIT_COL0 | VARYING_BIT_TEX0);
} }
key->separate_specular = (ctx->Light.Model.ColorControl == key->separate_specular = (ctx->Light.Model.ColorControl ==
@ -1407,7 +1407,7 @@ static void build_texture_transform( struct tnl_program *p )
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
if (!(p->state->fragprog_inputs_read & FRAG_BIT_TEX(i))) if (!(p->state->fragprog_inputs_read & VARYING_BIT_TEX(i)))
continue; continue;
if (p->state->unit[i].coord_replace) if (p->state->unit[i].coord_replace)
@ -1575,22 +1575,22 @@ static void build_tnl_program( struct tnl_program *p )
/* Lighting calculations: /* Lighting calculations:
*/ */
if (p->state->fragprog_inputs_read & (FRAG_BIT_COL0|FRAG_BIT_COL1)) { if (p->state->fragprog_inputs_read & (VARYING_BIT_COL0|VARYING_BIT_COL1)) {
if (p->state->light_global_enabled) if (p->state->light_global_enabled)
build_lighting(p); build_lighting(p);
else { else {
if (p->state->fragprog_inputs_read & FRAG_BIT_COL0) if (p->state->fragprog_inputs_read & VARYING_BIT_COL0)
emit_passthrough(p, VERT_ATTRIB_COLOR0, VARYING_SLOT_COL0); emit_passthrough(p, VERT_ATTRIB_COLOR0, VARYING_SLOT_COL0);
if (p->state->fragprog_inputs_read & FRAG_BIT_COL1) if (p->state->fragprog_inputs_read & VARYING_BIT_COL1)
emit_passthrough(p, VERT_ATTRIB_COLOR1, VARYING_SLOT_COL1); emit_passthrough(p, VERT_ATTRIB_COLOR1, VARYING_SLOT_COL1);
} }
} }
if (p->state->fragprog_inputs_read & FRAG_BIT_FOGC) if (p->state->fragprog_inputs_read & VARYING_BIT_FOGC)
build_fog(p); build_fog(p);
if (p->state->fragprog_inputs_read & FRAG_BITS_TEX_ANY) if (p->state->fragprog_inputs_read & VARYING_BITS_TEX_ANY)
build_texture_transform(p); build_texture_transform(p);
if (p->state->point_attenuated) if (p->state->point_attenuated)

View file

@ -285,32 +285,6 @@ typedef enum
/*********************************************/ /*********************************************/
/**
* Indexes for fragment program input attributes.
*/
typedef enum
{
FRAG_ATTRIB_WPOS = VARYING_SLOT_POS,
FRAG_ATTRIB_COL0 = VARYING_SLOT_COL0,
FRAG_ATTRIB_COL1 = VARYING_SLOT_COL1,
FRAG_ATTRIB_FOGC = VARYING_SLOT_FOGC,
FRAG_ATTRIB_TEX0 = VARYING_SLOT_TEX0,
FRAG_ATTRIB_TEX1 = VARYING_SLOT_TEX1,
FRAG_ATTRIB_TEX2 = VARYING_SLOT_TEX2,
FRAG_ATTRIB_TEX3 = VARYING_SLOT_TEX3,
FRAG_ATTRIB_TEX4 = VARYING_SLOT_TEX4,
FRAG_ATTRIB_TEX5 = VARYING_SLOT_TEX5,
FRAG_ATTRIB_TEX6 = VARYING_SLOT_TEX6,
FRAG_ATTRIB_TEX7 = VARYING_SLOT_TEX7,
FRAG_ATTRIB_FACE = VARYING_SLOT_FACE, /**< front/back face */
FRAG_ATTRIB_PNTC = VARYING_SLOT_PNTC, /**< sprite/point coord */
FRAG_ATTRIB_CLIP_DIST0 = VARYING_SLOT_CLIP_DIST0,
FRAG_ATTRIB_CLIP_DIST1 = VARYING_SLOT_CLIP_DIST1,
FRAG_ATTRIB_VAR0 = VARYING_SLOT_VAR0, /**< shader varying */
FRAG_ATTRIB_MAX = VARYING_SLOT_MAX
} gl_frag_attrib;
/** /**
* Determine if the given gl_varying_slot appears in the fragment shader. * Determine if the given gl_varying_slot appears in the fragment shader.
*/ */
@ -331,40 +305,6 @@ _mesa_varying_slot_in_fs(gl_varying_slot slot)
} }
/**
* Bitflags for fragment program input attributes.
*/
/*@{*/
#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS)
#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0)
#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1)
#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC)
#define FRAG_BIT_FACE (1 << FRAG_ATTRIB_FACE)
#define FRAG_BIT_PNTC (1 << FRAG_ATTRIB_PNTC)
#define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0)
#define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1)
#define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2)
#define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3)
#define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4)
#define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5)
#define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6)
#define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7)
#define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0)
#define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U))
#define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V))
#define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \
FRAG_BIT_TEX1| \
FRAG_BIT_TEX2| \
FRAG_BIT_TEX3| \
FRAG_BIT_TEX4| \
FRAG_BIT_TEX5| \
FRAG_BIT_TEX6| \
FRAG_BIT_TEX7)
/*@}*/
/** /**
* Fragment program results * Fragment program results
*/ */
@ -2016,7 +1956,7 @@ struct gl_fragment_program
* For inputs that do not have an interpolation qualifier specified in * For inputs that do not have an interpolation qualifier specified in
* GLSL, the value is INTERP_QUALIFIER_NONE. * GLSL, the value is INTERP_QUALIFIER_NONE.
*/ */
enum glsl_interp_qualifier InterpQualifier[FRAG_ATTRIB_MAX]; enum glsl_interp_qualifier InterpQualifier[VARYING_SLOT_MAX];
/** /**
* Bitfield indicating, for each fragment shader input, 1 if that input * Bitfield indicating, for each fragment shader input, 1 if that input

View file

@ -66,7 +66,7 @@ _mesa_need_secondary_color(const struct gl_context *ctx)
if (ctx->FragmentProgram._Current && if (ctx->FragmentProgram._Current &&
(ctx->FragmentProgram._Current != ctx->FragmentProgram._TexEnvProgram) && (ctx->FragmentProgram._Current != ctx->FragmentProgram._TexEnvProgram) &&
(ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL1)) (ctx->FragmentProgram._Current->Base.InputsRead & VARYING_BIT_COL1))
return GL_TRUE; return GL_TRUE;
return GL_FALSE; return GL_FALSE;

View file

@ -661,7 +661,7 @@ update_texture_state( struct gl_context *ctx )
if (fprog) { if (fprog) {
const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1; const GLuint coordMask = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
ctx->Texture._EnabledCoordUnits ctx->Texture._EnabledCoordUnits
= (fprog->InputsRead >> FRAG_ATTRIB_TEX0) & coordMask; = (fprog->InputsRead >> VARYING_SLOT_TEX0) & coordMask;
} }
else { else {
ctx->Texture._EnabledCoordUnits = enabledFragUnits; ctx->Texture._EnabledCoordUnits = enabledFragUnits;

View file

@ -93,7 +93,7 @@ public:
explicit src_reg(dst_reg reg); explicit src_reg(dst_reg reg);
gl_register_file file; /**< PROGRAM_* from Mesa */ gl_register_file file; /**< PROGRAM_* from Mesa */
int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */ int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */ GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
int negate; /**< NEGATE_XYZW mask from mesa */ int negate; /**< NEGATE_XYZW mask from mesa */
/** Register index should be offset by the integer in this reg. */ /** Register index should be offset by the integer in this reg. */
@ -123,7 +123,7 @@ public:
explicit dst_reg(src_reg reg); explicit dst_reg(src_reg reg);
gl_register_file file; /**< PROGRAM_* from Mesa */ gl_register_file file; /**< PROGRAM_* from Mesa */
int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */ int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
int writemask; /**< Bitfield of WRITEMASK_[XYZW] */ int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
GLuint cond_mask:4; GLuint cond_mask:4;
/** Register index should be offset by the integer in this reg. */ /** Register index should be offset by the integer in this reg. */

View file

@ -108,7 +108,7 @@ get_src_register_pointer(const struct prog_src_register *source,
return machine->VertAttribs[reg]; return machine->VertAttribs[reg];
} }
else { else {
if (reg >= FRAG_ATTRIB_MAX) if (reg >= VARYING_SLOT_MAX)
return ZeroVec; return ZeroVec;
return machine->Attribs[reg][machine->CurElement]; return machine->Attribs[reg][machine->CurElement];
} }
@ -283,7 +283,7 @@ fetch_vector4_deriv(struct gl_context * ctx,
if (source->File == PROGRAM_INPUT && if (source->File == PROGRAM_INPUT &&
source->Index < (GLint) machine->NumDeriv) { source->Index < (GLint) machine->NumDeriv) {
const GLint col = machine->CurElement; const GLint col = machine->CurElement;
const GLfloat w = machine->Attribs[FRAG_ATTRIB_WPOS][col][3]; const GLfloat w = machine->Attribs[VARYING_SLOT_POS][col][3];
const GLfloat invQ = 1.0f / w; const GLfloat invQ = 1.0f / w;
GLfloat deriv[4]; GLfloat deriv[4];
@ -371,7 +371,7 @@ fetch_texel(struct gl_context *ctx,
*/ */
if (machine->NumDeriv > 0 && if (machine->NumDeriv > 0 &&
inst->SrcReg[0].File == PROGRAM_INPUT && inst->SrcReg[0].File == PROGRAM_INPUT &&
inst->SrcReg[0].Index == FRAG_ATTRIB_TEX0 + inst->TexSrcUnit) { inst->SrcReg[0].Index == VARYING_SLOT_TEX0 + inst->TexSrcUnit) {
/* simple texture fetch for which we should have derivatives */ /* simple texture fetch for which we should have derivatives */
GLuint attr = inst->SrcReg[0].Index; GLuint attr = inst->SrcReg[0].Index;
machine->FetchTexelDeriv(ctx, texcoord, machine->FetchTexelDeriv(ctx, texcoord,

View file

@ -89,7 +89,7 @@ static const char *
arb_input_attrib_string(GLint index, GLenum progType) arb_input_attrib_string(GLint index, GLenum progType)
{ {
/* /*
* These strings should match the VERT_ATTRIB_x and FRAG_ATTRIB_x tokens. * These strings should match the VERT_ATTRIB_x and VARYING_SLOT_x tokens.
*/ */
static const char *const vertAttribs[] = { static const char *const vertAttribs[] = {
"vertex.position", "vertex.position",
@ -144,12 +144,12 @@ arb_input_attrib_string(GLint index, GLenum progType)
"fragment.(fourteen)", /* VARYING_SLOT_BFC1 */ "fragment.(fourteen)", /* VARYING_SLOT_BFC1 */
"fragment.(fifteen)", /* VARYING_SLOT_EDGE */ "fragment.(fifteen)", /* VARYING_SLOT_EDGE */
"fragment.(sixteen)", /* VARYING_SLOT_CLIP_VERTEX */ "fragment.(sixteen)", /* VARYING_SLOT_CLIP_VERTEX */
"fragment.(seventeen)", /* FRAG_ATTRIB_CLIP_DIST0 */ "fragment.(seventeen)", /* VARYING_SLOT_CLIP_DIST0 */
"fragment.(eighteen)", /* FRAG_ATTRIB_CLIP_DIST1 */ "fragment.(eighteen)", /* VARYING_SLOT_CLIP_DIST1 */
"fragment.(nineteen)", /* VARYING_SLOT_PRIMITIVE_ID */ "fragment.(nineteen)", /* VARYING_SLOT_PRIMITIVE_ID */
"fragment.(twenty)", /* VARYING_SLOT_LAYER */ "fragment.(twenty)", /* VARYING_SLOT_LAYER */
"fragment.(twenty-one)", /* FRAG_ATTRIB_FACE */ "fragment.(twenty-one)", /* VARYING_SLOT_FACE */
"fragment.(twenty-two)", /* FRAG_ATTRIB_PNTC */ "fragment.(twenty-two)", /* VARYING_SLOT_PNTC */
"fragment.varying[0]", "fragment.varying[0]",
"fragment.varying[1]", "fragment.varying[1]",
"fragment.varying[2]", "fragment.varying[2]",
@ -186,11 +186,11 @@ arb_input_attrib_string(GLint index, GLenum progType)
/* sanity checks */ /* sanity checks */
STATIC_ASSERT(Elements(vertAttribs) == VERT_ATTRIB_MAX); STATIC_ASSERT(Elements(vertAttribs) == VERT_ATTRIB_MAX);
STATIC_ASSERT(Elements(fragAttribs) == FRAG_ATTRIB_MAX); STATIC_ASSERT(Elements(fragAttribs) == VARYING_SLOT_MAX);
assert(strcmp(vertAttribs[VERT_ATTRIB_TEX0], "vertex.texcoord[0]") == 0); assert(strcmp(vertAttribs[VERT_ATTRIB_TEX0], "vertex.texcoord[0]") == 0);
assert(strcmp(vertAttribs[VERT_ATTRIB_GENERIC15], "vertex.attrib[15]") == 0); assert(strcmp(vertAttribs[VERT_ATTRIB_GENERIC15], "vertex.attrib[15]") == 0);
assert(strcmp(fragAttribs[FRAG_ATTRIB_TEX0], "fragment.texcoord[0]") == 0); assert(strcmp(fragAttribs[VARYING_SLOT_TEX0], "fragment.texcoord[0]") == 0);
assert(strcmp(fragAttribs[FRAG_ATTRIB_VAR0+15], "fragment.varying[15]") == 0); assert(strcmp(fragAttribs[VARYING_SLOT_VAR0+15], "fragment.varying[15]") == 0);
if (progType == GL_VERTEX_PROGRAM_ARB) { if (progType == GL_VERTEX_PROGRAM_ARB) {
assert(index < Elements(vertAttribs)); assert(index < Elements(vertAttribs));

View file

@ -738,7 +738,7 @@ _mesa_combine_programs(struct gl_context *ctx,
* of progB_colorFile/progB_colorIndex below... * of progB_colorFile/progB_colorIndex below...
*/ */
progB_colorFile = PROGRAM_INPUT; progB_colorFile = PROGRAM_INPUT;
progB_colorIndex = FRAG_ATTRIB_COL0; progB_colorIndex = VARYING_SLOT_COL0;
/* /*
* The fragment program may get color from a state var rather than * The fragment program may get color from a state var rather than
@ -754,7 +754,7 @@ _mesa_combine_programs(struct gl_context *ctx,
p->StateIndexes[0] == STATE_INTERNAL && p->StateIndexes[0] == STATE_INTERNAL &&
p->StateIndexes[1] == STATE_CURRENT_ATTRIB && p->StateIndexes[1] == STATE_CURRENT_ATTRIB &&
(int) p->StateIndexes[2] == (int) VERT_ATTRIB_COLOR0) { (int) p->StateIndexes[2] == (int) VERT_ATTRIB_COLOR0) {
progB_inputsRead |= FRAG_BIT_COL0; progB_inputsRead |= VARYING_BIT_COL0;
progB_colorFile = PROGRAM_STATE_VAR; progB_colorFile = PROGRAM_STATE_VAR;
progB_colorIndex = i; progB_colorIndex = i;
break; break;
@ -765,7 +765,7 @@ _mesa_combine_programs(struct gl_context *ctx,
* new temporary register. * new temporary register.
*/ */
if ((progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) && if ((progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) &&
(progB_inputsRead & FRAG_BIT_COL0)) { (progB_inputsRead & VARYING_BIT_COL0)) {
GLint tempReg = _mesa_find_free_register(usedTemps, MAX_PROGRAM_TEMPS, GLint tempReg = _mesa_find_free_register(usedTemps, MAX_PROGRAM_TEMPS,
firstTemp); firstTemp);
if (tempReg < 0) { if (tempReg < 0) {
@ -788,7 +788,7 @@ _mesa_combine_programs(struct gl_context *ctx,
/* compute combined program's InputsRead */ /* compute combined program's InputsRead */
inputsB = progB_inputsRead; inputsB = progB_inputsRead;
if (progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) { if (progA->OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
inputsB &= ~(1 << FRAG_ATTRIB_COL0); inputsB &= ~(1 << VARYING_SLOT_COL0);
} }
newProg->InputsRead = progA->InputsRead | inputsB; newProg->InputsRead = progA->InputsRead | inputsB;
newProg->OutputsWritten = progB->OutputsWritten; newProg->OutputsWritten = progB->OutputsWritten;
@ -934,7 +934,7 @@ _mesa_valid_register_index(const struct gl_context *ctx,
case MESA_SHADER_VERTEX: case MESA_SHADER_VERTEX:
return index < VERT_ATTRIB_GENERIC0 + (GLint) c->MaxAttribs; return index < VERT_ATTRIB_GENERIC0 + (GLint) c->MaxAttribs;
case MESA_SHADER_FRAGMENT: case MESA_SHADER_FRAGMENT:
return index < FRAG_ATTRIB_VAR0 + (GLint) ctx->Const.MaxVarying; return index < VARYING_SLOT_VAR0 + (GLint) ctx->Const.MaxVarying;
case MESA_SHADER_GEOMETRY: case MESA_SHADER_GEOMETRY:
return index < VARYING_SLOT_VAR0 + (GLint) ctx->Const.MaxVarying; return index < VARYING_SLOT_VAR0 + (GLint) ctx->Const.MaxVarying;
default: default:

View file

@ -1187,19 +1187,19 @@ vtxWeightNum: INTEGER;
fragAttribItem: POSITION fragAttribItem: POSITION
{ {
$$ = FRAG_ATTRIB_WPOS; $$ = VARYING_SLOT_POS;
} }
| COLOR optColorType | COLOR optColorType
{ {
$$ = FRAG_ATTRIB_COL0 + $2; $$ = VARYING_SLOT_COL0 + $2;
} }
| FOGCOORD | FOGCOORD
{ {
$$ = FRAG_ATTRIB_FOGC; $$ = VARYING_SLOT_FOGC;
} }
| TEXCOORD optTexCoordUnitNum | TEXCOORD optTexCoordUnitNum
{ {
$$ = FRAG_ATTRIB_TEX0 + $2; $$ = VARYING_SLOT_TEX0 + $2;
} }
; ;

View file

@ -240,7 +240,7 @@ _mesa_insert_mvp_code(struct gl_context *ctx, struct gl_vertex_program *vprog)
* \param saturate True if writes to color outputs should be clamped to [0, 1] * \param saturate True if writes to color outputs should be clamped to [0, 1]
* *
* \note * \note
* This function sets \c FRAG_BIT_FOGC in \c fprog->Base.InputsRead. * This function sets \c VARYING_BIT_FOGC in \c fprog->Base.InputsRead.
* *
* \todo With a little work, this function could be adapted to add fog code * \todo With a little work, this function could be adapted to add fog code
* to vertex programs too. * to vertex programs too.
@ -323,7 +323,7 @@ _mesa_append_fog_code(struct gl_context *ctx,
inst->DstReg.Index = fogFactorTemp; inst->DstReg.Index = fogFactorTemp;
inst->DstReg.WriteMask = WRITEMASK_X; inst->DstReg.WriteMask = WRITEMASK_X;
inst->SrcReg[0].File = PROGRAM_INPUT; inst->SrcReg[0].File = PROGRAM_INPUT;
inst->SrcReg[0].Index = FRAG_ATTRIB_FOGC; inst->SrcReg[0].Index = VARYING_SLOT_FOGC;
inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; inst->SrcReg[0].Swizzle = SWIZZLE_XXXX;
inst->SrcReg[1].File = PROGRAM_STATE_VAR; inst->SrcReg[1].File = PROGRAM_STATE_VAR;
inst->SrcReg[1].Index = fogPRefOpt; inst->SrcReg[1].Index = fogPRefOpt;
@ -348,7 +348,7 @@ _mesa_append_fog_code(struct gl_context *ctx,
inst->SrcReg[0].Swizzle inst->SrcReg[0].Swizzle
= (fog_mode == GL_EXP) ? SWIZZLE_ZZZZ : SWIZZLE_WWWW; = (fog_mode == GL_EXP) ? SWIZZLE_ZZZZ : SWIZZLE_WWWW;
inst->SrcReg[1].File = PROGRAM_INPUT; inst->SrcReg[1].File = PROGRAM_INPUT;
inst->SrcReg[1].Index = FRAG_ATTRIB_FOGC; inst->SrcReg[1].Index = VARYING_SLOT_FOGC;
inst->SrcReg[1].Swizzle = SWIZZLE_XXXX; inst->SrcReg[1].Swizzle = SWIZZLE_XXXX;
inst++; inst++;
if (fog_mode == GL_EXP2) { if (fog_mode == GL_EXP2) {
@ -411,7 +411,7 @@ _mesa_append_fog_code(struct gl_context *ctx,
/* install new instructions */ /* install new instructions */
fprog->Base.Instructions = newInst; fprog->Base.Instructions = newInst;
fprog->Base.NumInstructions = inst - newInst; fprog->Base.NumInstructions = inst - newInst;
fprog->Base.InputsRead |= FRAG_BIT_FOGC; fprog->Base.InputsRead |= VARYING_BIT_FOGC;
assert(fprog->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR)); assert(fprog->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR));
} }
@ -615,10 +615,10 @@ _mesa_nop_fragment_program(struct gl_context *ctx, struct gl_fragment_program *p
inst[0].DstReg.File = PROGRAM_OUTPUT; inst[0].DstReg.File = PROGRAM_OUTPUT;
inst[0].DstReg.Index = FRAG_RESULT_COLOR; inst[0].DstReg.Index = FRAG_RESULT_COLOR;
inst[0].SrcReg[0].File = PROGRAM_INPUT; inst[0].SrcReg[0].File = PROGRAM_INPUT;
if (prog->Base.InputsRead & FRAG_BIT_COL0) if (prog->Base.InputsRead & VARYING_BIT_COL0)
inputAttr = FRAG_ATTRIB_COL0; inputAttr = VARYING_SLOT_COL0;
else else
inputAttr = FRAG_ATTRIB_TEX0; inputAttr = VARYING_SLOT_TEX0;
inst[0].SrcReg[0].Index = inputAttr; inst[0].SrcReg[0].Index = inputAttr;
inst[1].Opcode = OPCODE_END; inst[1].Opcode = OPCODE_END;

View file

@ -161,11 +161,11 @@ get_pixel_transfer_program(struct gl_context *ctx, const struct state_key *key)
inst[ic].DstReg.File = PROGRAM_TEMPORARY; inst[ic].DstReg.File = PROGRAM_TEMPORARY;
inst[ic].DstReg.Index = colorTemp; inst[ic].DstReg.Index = colorTemp;
inst[ic].SrcReg[0].File = PROGRAM_INPUT; inst[ic].SrcReg[0].File = PROGRAM_INPUT;
inst[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; inst[ic].SrcReg[0].Index = VARYING_SLOT_TEX0;
inst[ic].TexSrcUnit = 0; inst[ic].TexSrcUnit = 0;
inst[ic].TexSrcTarget = TEXTURE_2D_INDEX; inst[ic].TexSrcTarget = TEXTURE_2D_INDEX;
ic++; ic++;
fp->Base.InputsRead = BITFIELD64_BIT(FRAG_ATTRIB_TEX0); fp->Base.InputsRead = BITFIELD64_BIT(VARYING_SLOT_TEX0);
fp->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR); fp->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR);
fp->Base.SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */ fp->Base.SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */

View file

@ -171,9 +171,9 @@ static void update_raster_state( struct st_context *st )
raster->sprite_coord_enable |= 1 << i; raster->sprite_coord_enable |= 1 << i;
} }
} }
if (fragProg->Base.InputsRead & FRAG_BIT_PNTC) { if (fragProg->Base.InputsRead & VARYING_BIT_PNTC) {
raster->sprite_coord_enable |= raster->sprite_coord_enable |=
1 << (FRAG_ATTRIB_PNTC - FRAG_ATTRIB_TEX0); 1 << (VARYING_SLOT_PNTC - VARYING_SLOT_TEX0);
} }
raster->point_quad_rasterization = 1; raster->point_quad_rasterization = 1;

View file

@ -139,7 +139,7 @@ make_bitmap_fragment_program(struct gl_context *ctx, GLuint samplerIndex)
p->Instructions[ic].DstReg.File = PROGRAM_TEMPORARY; p->Instructions[ic].DstReg.File = PROGRAM_TEMPORARY;
p->Instructions[ic].DstReg.Index = 0; p->Instructions[ic].DstReg.Index = 0;
p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_TEX0;
p->Instructions[ic].TexSrcUnit = samplerIndex; p->Instructions[ic].TexSrcUnit = samplerIndex;
p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
ic++; ic++;
@ -160,7 +160,7 @@ make_bitmap_fragment_program(struct gl_context *ctx, GLuint samplerIndex)
assert(ic == p->NumInstructions); assert(ic == p->NumInstructions);
p->InputsRead = FRAG_BIT_TEX0; p->InputsRead = VARYING_BIT_TEX0;
p->OutputsWritten = 0x0; p->OutputsWritten = 0x0;
p->SamplersUsed = (1 << samplerIndex); p->SamplersUsed = (1 << samplerIndex);

View file

@ -87,7 +87,7 @@ is_passthrough_program(const struct gl_fragment_program *prog)
inst[0].DstReg.Index == FRAG_RESULT_COLOR && inst[0].DstReg.Index == FRAG_RESULT_COLOR &&
inst[0].DstReg.WriteMask == WRITEMASK_XYZW && inst[0].DstReg.WriteMask == WRITEMASK_XYZW &&
inst[0].SrcReg[0].File == PROGRAM_INPUT && inst[0].SrcReg[0].File == PROGRAM_INPUT &&
inst[0].SrcReg[0].Index == FRAG_ATTRIB_COL0 && inst[0].SrcReg[0].Index == VARYING_SLOT_COL0 &&
inst[0].SrcReg[0].Swizzle == SWIZZLE_XYZW) { inst[0].SrcReg[0].Swizzle == SWIZZLE_XYZW) {
return GL_TRUE; return GL_TRUE;
} }
@ -233,7 +233,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH; p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH;
p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z; p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z;
p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_TEX0;
p->Instructions[ic].TexSrcUnit = 0; p->Instructions[ic].TexSrcUnit = 0;
p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
ic++; ic++;
@ -242,7 +242,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT;
p->Instructions[ic].DstReg.Index = FRAG_RESULT_COLOR; p->Instructions[ic].DstReg.Index = FRAG_RESULT_COLOR;
p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_COL0; p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_COL0;
ic++; ic++;
} }
@ -253,7 +253,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
p->Instructions[ic].DstReg.Index = FRAG_RESULT_STENCIL; p->Instructions[ic].DstReg.Index = FRAG_RESULT_STENCIL;
p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Y; p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Y;
p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT;
p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; p->Instructions[ic].SrcReg[0].Index = VARYING_SLOT_TEX0;
p->Instructions[ic].TexSrcUnit = 1; p->Instructions[ic].TexSrcUnit = 1;
p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX;
ic++; ic++;
@ -264,7 +264,7 @@ st_make_drawpix_z_stencil_program(struct st_context *st,
assert(ic == p->NumInstructions); assert(ic == p->NumInstructions);
p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0; p->InputsRead = VARYING_BIT_TEX0 | VARYING_BIT_COL0;
p->OutputsWritten = 0; p->OutputsWritten = 0;
if (write_depth) { if (write_depth) {
p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_DEPTH); p->OutputsWritten |= BITFIELD64_BIT(FRAG_RESULT_DEPTH);

View file

@ -116,7 +116,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
st_validate_state(st); st_validate_state(st);
/* determine if we need vertex color */ /* determine if we need vertex color */
if (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL0) if (ctx->FragmentProgram._Current->Base.InputsRead & VARYING_BIT_COL0)
emitColor = GL_TRUE; emitColor = GL_TRUE;
else else
emitColor = GL_FALSE; emitColor = GL_FALSE;

View file

@ -148,7 +148,7 @@ public:
explicit st_src_reg(st_dst_reg reg); explicit st_src_reg(st_dst_reg reg);
gl_register_file file; /**< PROGRAM_* from Mesa */ gl_register_file file; /**< PROGRAM_* from Mesa */
int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */ int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
int index2D; int index2D;
GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */ GLuint swizzle; /**< SWIZZLE_XYZWONEZERO swizzles from Mesa. */
int negate; /**< NEGATE_XYZW mask from mesa */ int negate; /**< NEGATE_XYZW mask from mesa */
@ -182,7 +182,7 @@ public:
explicit st_dst_reg(st_src_reg reg); explicit st_dst_reg(st_src_reg reg);
gl_register_file file; /**< PROGRAM_* from Mesa */ gl_register_file file; /**< PROGRAM_* from Mesa */
int index; /**< temporary index, VERT_ATTRIB_*, FRAG_ATTRIB_*, etc. */ int index; /**< temporary index, VERT_ATTRIB_*, VARYING_SLOT_*, etc. */
int writemask; /**< Bitfield of WRITEMASK_[XYZW] */ int writemask; /**< Bitfield of WRITEMASK_[XYZW] */
GLuint cond_mask:4; GLuint cond_mask:4;
int type; /** GLSL_TYPE_* from GLSL IR (enum glsl_base_type) */ int type; /** GLSL_TYPE_* from GLSL IR (enum glsl_base_type) */
@ -3830,14 +3830,14 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
* Get initial pixel color from the texture. * Get initial pixel color from the texture.
* TEX colorTemp, fragment.texcoord[0], texture[0], 2D; * TEX colorTemp, fragment.texcoord[0], texture[0], 2D;
*/ */
coord = st_src_reg(PROGRAM_INPUT, FRAG_ATTRIB_TEX0, glsl_type::vec2_type); coord = st_src_reg(PROGRAM_INPUT, VARYING_SLOT_TEX0, glsl_type::vec2_type);
src0 = v->get_temp(glsl_type::vec4_type); src0 = v->get_temp(glsl_type::vec4_type);
dst0 = st_dst_reg(src0); dst0 = st_dst_reg(src0);
inst = v->emit(NULL, TGSI_OPCODE_TEX, dst0, coord); inst = v->emit(NULL, TGSI_OPCODE_TEX, dst0, coord);
inst->sampler = 0; inst->sampler = 0;
inst->tex_target = TEXTURE_2D_INDEX; inst->tex_target = TEXTURE_2D_INDEX;
prog->InputsRead |= FRAG_BIT_TEX0; prog->InputsRead |= VARYING_BIT_TEX0;
prog->SamplersUsed |= (1 << 0); /* mark sampler 0 as used */ prog->SamplersUsed |= (1 << 0); /* mark sampler 0 as used */
v->samplers_used |= (1 << 0); v->samplers_used |= (1 << 0);
@ -3903,7 +3903,7 @@ get_pixel_transfer_visitor(struct st_fragment_program *fp,
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
src_regs[i] = inst->src[i]; src_regs[i] = inst->src[i];
if (src_regs[i].file == PROGRAM_INPUT && if (src_regs[i].file == PROGRAM_INPUT &&
src_regs[i].index == FRAG_ATTRIB_COL0) src_regs[i].index == VARYING_SLOT_COL0)
{ {
src_regs[i].file = PROGRAM_TEMPORARY; src_regs[i].file = PROGRAM_TEMPORARY;
src_regs[i].index = src0.index; src_regs[i].index = src0.index;
@ -3958,14 +3958,14 @@ get_bitmap_visitor(struct st_fragment_program *fp,
v->num_immediates = original->num_immediates; v->num_immediates = original->num_immediates;
/* TEX tmp0, fragment.texcoord[0], texture[0], 2D; */ /* TEX tmp0, fragment.texcoord[0], texture[0], 2D; */
coord = st_src_reg(PROGRAM_INPUT, FRAG_ATTRIB_TEX0, glsl_type::vec2_type); coord = st_src_reg(PROGRAM_INPUT, VARYING_SLOT_TEX0, glsl_type::vec2_type);
src0 = v->get_temp(glsl_type::vec4_type); src0 = v->get_temp(glsl_type::vec4_type);
dst0 = st_dst_reg(src0); dst0 = st_dst_reg(src0);
inst = v->emit(NULL, TGSI_OPCODE_TEX, dst0, coord); inst = v->emit(NULL, TGSI_OPCODE_TEX, dst0, coord);
inst->sampler = samplerIndex; inst->sampler = samplerIndex;
inst->tex_target = TEXTURE_2D_INDEX; inst->tex_target = TEXTURE_2D_INDEX;
prog->InputsRead |= FRAG_BIT_TEX0; prog->InputsRead |= VARYING_BIT_TEX0;
prog->SamplersUsed |= (1 << samplerIndex); /* mark sampler as used */ prog->SamplersUsed |= (1 << samplerIndex); /* mark sampler as used */
v->samplers_used |= (1 << samplerIndex); v->samplers_used |= (1 << samplerIndex);
@ -4441,7 +4441,7 @@ emit_wpos_adjustment( struct st_translate *t,
struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst ); struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst );
struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg ); struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg );
struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; struct ureg_src wpos_input = t->inputs[t->inputMapping[VARYING_SLOT_POS]];
/* First, apply the coordinate shift: */ /* First, apply the coordinate shift: */
if (adjX || adjY[0] || adjY[1]) { if (adjX || adjY[0] || adjY[1]) {
@ -4492,7 +4492,7 @@ emit_wpos_adjustment( struct st_translate *t,
/* Use wpos_temp as position input from here on: /* Use wpos_temp as position input from here on:
*/ */
t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp); t->inputs[t->inputMapping[VARYING_SLOT_POS]] = ureg_src(wpos_temp);
} }
@ -4610,14 +4610,14 @@ emit_face_var(struct st_translate *t)
{ {
struct ureg_program *ureg = t->ureg; struct ureg_program *ureg = t->ureg;
struct ureg_dst face_temp = ureg_DECL_temporary(ureg); struct ureg_dst face_temp = ureg_DECL_temporary(ureg);
struct ureg_src face_input = t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]]; struct ureg_src face_input = t->inputs[t->inputMapping[VARYING_SLOT_FACE]];
/* MOV_SAT face_temp, input[face] */ /* MOV_SAT face_temp, input[face] */
face_temp = ureg_saturate(face_temp); face_temp = ureg_saturate(face_temp);
ureg_MOV(ureg, face_temp, face_input); ureg_MOV(ureg, face_temp, face_input);
/* Use face_temp as face input from here on: */ /* Use face_temp as face input from here on: */
t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp); t->inputs[t->inputMapping[VARYING_SLOT_FACE]] = ureg_src(face_temp);
} }
static void static void
@ -4710,14 +4710,14 @@ st_translate_program(
is_centroid[i]); is_centroid[i]);
} }
if (proginfo->InputsRead & FRAG_BIT_WPOS) { if (proginfo->InputsRead & VARYING_BIT_POS) {
/* Must do this after setting up t->inputs, and before /* Must do this after setting up t->inputs, and before
* emitting constant references, below: * emitting constant references, below:
*/ */
emit_wpos(st_context(ctx), t, proginfo, ureg); emit_wpos(st_context(ctx), t, proginfo, ureg);
} }
if (proginfo->InputsRead & FRAG_BIT_FACE) if (proginfo->InputsRead & VARYING_BIT_FACE)
emit_face_var(t); emit_face_var(t);
/* /*

View file

@ -790,7 +790,7 @@ emit_wpos_adjustment( struct st_translate *t,
struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst ); struct ureg_src wpostrans = ureg_DECL_constant( ureg, wposTransConst );
struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg ); struct ureg_dst wpos_temp = ureg_DECL_temporary( ureg );
struct ureg_src wpos_input = t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]]; struct ureg_src wpos_input = t->inputs[t->inputMapping[VARYING_SLOT_POS]];
/* First, apply the coordinate shift: */ /* First, apply the coordinate shift: */
if (adjX || adjY[0] || adjY[1]) { if (adjX || adjY[0] || adjY[1]) {
@ -841,7 +841,7 @@ emit_wpos_adjustment( struct st_translate *t,
/* Use wpos_temp as position input from here on: /* Use wpos_temp as position input from here on:
*/ */
t->inputs[t->inputMapping[FRAG_ATTRIB_WPOS]] = ureg_src(wpos_temp); t->inputs[t->inputMapping[VARYING_SLOT_POS]] = ureg_src(wpos_temp);
} }
@ -961,7 +961,7 @@ emit_face_var( struct st_translate *t,
{ {
struct ureg_program *ureg = t->ureg; struct ureg_program *ureg = t->ureg;
struct ureg_dst face_temp = ureg_DECL_temporary( ureg ); struct ureg_dst face_temp = ureg_DECL_temporary( ureg );
struct ureg_src face_input = t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]]; struct ureg_src face_input = t->inputs[t->inputMapping[VARYING_SLOT_FACE]];
/* MOV_SAT face_temp, input[face] /* MOV_SAT face_temp, input[face]
*/ */
@ -970,7 +970,7 @@ emit_face_var( struct st_translate *t,
/* Use face_temp as face input from here on: /* Use face_temp as face input from here on:
*/ */
t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp); t->inputs[t->inputMapping[VARYING_SLOT_FACE]] = ureg_src(face_temp);
} }
@ -1051,14 +1051,14 @@ st_translate_mesa_program(
interpMode[i]); interpMode[i]);
} }
if (program->InputsRead & FRAG_BIT_WPOS) { if (program->InputsRead & VARYING_BIT_POS) {
/* Must do this after setting up t->inputs, and before /* Must do this after setting up t->inputs, and before
* emitting constant references, below: * emitting constant references, below:
*/ */
emit_wpos(st_context(ctx), t, program, ureg); emit_wpos(st_context(ctx), t, program, ureg);
} }
if (program->InputsRead & FRAG_BIT_FACE) { if (program->InputsRead & VARYING_BIT_FACE) {
emit_face_var( t, program ); emit_face_var( t, program );
} }

View file

@ -275,8 +275,8 @@ st_prepare_vertex_program(struct gl_context *ctx,
default: default:
assert(attr < VARYING_SLOT_MAX); assert(attr < VARYING_SLOT_MAX);
stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 - stvp->output_semantic_index[slot] = (VARYING_SLOT_VAR0 -
FRAG_ATTRIB_TEX0 + VARYING_SLOT_TEX0 +
attr - attr -
VARYING_SLOT_VAR0); VARYING_SLOT_VAR0);
break; break;
@ -472,7 +472,7 @@ st_translate_fragment_program(struct st_context *st,
GLboolean deleteFP = GL_FALSE; GLboolean deleteFP = GL_FALSE;
GLuint outputMapping[FRAG_RESULT_MAX]; GLuint outputMapping[FRAG_RESULT_MAX];
GLuint inputMapping[FRAG_ATTRIB_MAX]; GLuint inputMapping[VARYING_SLOT_MAX];
GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */ GLuint interpMode[PIPE_MAX_SHADER_INPUTS]; /* XXX size? */
GLuint attr; GLuint attr;
GLbitfield64 inputsRead; GLbitfield64 inputsRead;
@ -529,7 +529,7 @@ st_translate_fragment_program(struct st_context *st,
* Convert Mesa program inputs to TGSI input register semantics. * Convert Mesa program inputs to TGSI input register semantics.
*/ */
inputsRead = stfp->Base.Base.InputsRead; inputsRead = stfp->Base.Base.InputsRead;
for (attr = 0; attr < FRAG_ATTRIB_MAX; attr++) { for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
if ((inputsRead & BITFIELD64_BIT(attr)) != 0) { if ((inputsRead & BITFIELD64_BIT(attr)) != 0) {
const GLuint slot = fs_num_inputs++; const GLuint slot = fs_num_inputs++;
@ -537,46 +537,46 @@ st_translate_fragment_program(struct st_context *st,
is_centroid[slot] = (stfp->Base.IsCentroid & BITFIELD64_BIT(attr)) != 0; is_centroid[slot] = (stfp->Base.IsCentroid & BITFIELD64_BIT(attr)) != 0;
switch (attr) { switch (attr) {
case FRAG_ATTRIB_WPOS: case VARYING_SLOT_POS:
input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; input_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
input_semantic_index[slot] = 0; input_semantic_index[slot] = 0;
interpMode[slot] = TGSI_INTERPOLATE_LINEAR; interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
break; break;
case FRAG_ATTRIB_COL0: case VARYING_SLOT_COL0:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 0; input_semantic_index[slot] = 0;
interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr],
TRUE); TRUE);
break; break;
case FRAG_ATTRIB_COL1: case VARYING_SLOT_COL1:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 1; input_semantic_index[slot] = 1;
interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr],
TRUE); TRUE);
break; break;
case FRAG_ATTRIB_FOGC: case VARYING_SLOT_FOGC:
input_semantic_name[slot] = TGSI_SEMANTIC_FOG; input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
input_semantic_index[slot] = 0; input_semantic_index[slot] = 0;
interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
break; break;
case FRAG_ATTRIB_FACE: case VARYING_SLOT_FACE:
input_semantic_name[slot] = TGSI_SEMANTIC_FACE; input_semantic_name[slot] = TGSI_SEMANTIC_FACE;
input_semantic_index[slot] = 0; input_semantic_index[slot] = 0;
interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
break; break;
case FRAG_ATTRIB_CLIP_DIST0: case VARYING_SLOT_CLIP_DIST0:
input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
input_semantic_index[slot] = 0; input_semantic_index[slot] = 0;
interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
break; break;
case FRAG_ATTRIB_CLIP_DIST1: case VARYING_SLOT_CLIP_DIST1:
input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
input_semantic_index[slot] = 1; input_semantic_index[slot] = 1;
interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
break; break;
/* In most cases, there is nothing special about these /* In most cases, there is nothing special about these
* inputs, so adopt a convention to use the generic * inputs, so adopt a convention to use the generic
* semantic name and the mesa FRAG_ATTRIB_ number as the * semantic name and the mesa VARYING_SLOT_ number as the
* index. * index.
* *
* All that is required is that the vertex shader labels * All that is required is that the vertex shader labels
@ -589,24 +589,24 @@ st_translate_fragment_program(struct st_context *st,
* zero or be restricted to a particular range -- nobody * zero or be restricted to a particular range -- nobody
* should be building tables based on semantic index. * should be building tables based on semantic index.
*/ */
case FRAG_ATTRIB_PNTC: case VARYING_SLOT_PNTC:
case FRAG_ATTRIB_TEX0: case VARYING_SLOT_TEX0:
case FRAG_ATTRIB_TEX1: case VARYING_SLOT_TEX1:
case FRAG_ATTRIB_TEX2: case VARYING_SLOT_TEX2:
case FRAG_ATTRIB_TEX3: case VARYING_SLOT_TEX3:
case FRAG_ATTRIB_TEX4: case VARYING_SLOT_TEX4:
case FRAG_ATTRIB_TEX5: case VARYING_SLOT_TEX5:
case FRAG_ATTRIB_TEX6: case VARYING_SLOT_TEX6:
case FRAG_ATTRIB_TEX7: case VARYING_SLOT_TEX7:
case FRAG_ATTRIB_VAR0: case VARYING_SLOT_VAR0:
default: default:
/* Actually, let's try and zero-base this just for /* Actually, let's try and zero-base this just for
* readability of the generated TGSI. * readability of the generated TGSI.
*/ */
assert(attr >= FRAG_ATTRIB_TEX0); assert(attr >= VARYING_SLOT_TEX0);
input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); input_semantic_index[slot] = (attr - VARYING_SLOT_TEX0);
input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
if (attr == FRAG_ATTRIB_PNTC) if (attr == VARYING_SLOT_PNTC)
interpMode[slot] = TGSI_INTERPOLATE_LINEAR; interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
else else
interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr],

View file

@ -63,10 +63,10 @@ struct LineInfo
GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
/* DO_ATTRIBS */ /* DO_ATTRIBS */
GLfloat wPlane[4]; GLfloat wPlane[4];
GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; GLfloat attrPlane[VARYING_SLOT_MAX][4][4];
GLfloat lambda[FRAG_ATTRIB_MAX]; GLfloat lambda[VARYING_SLOT_MAX];
GLfloat texWidth[FRAG_ATTRIB_MAX]; GLfloat texWidth[VARYING_SLOT_MAX];
GLfloat texHeight[FRAG_ATTRIB_MAX]; GLfloat texHeight[VARYING_SLOT_MAX];
SWspan span; SWspan span;
}; };

View file

@ -66,10 +66,10 @@ NAME(plot)(struct gl_context *ctx, struct LineInfo *line, int ix, int iy)
#if defined(DO_ATTRIBS) #if defined(DO_ATTRIBS)
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
GLfloat (*attribArray)[4] = line->span.array->attribs[attr]; GLfloat (*attribArray)[4] = line->span.array->attribs[attr];
if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0 if (attr >= VARYING_SLOT_TEX0 && attr < VARYING_SLOT_VAR0
&& !_swrast_use_fragment_program(ctx)) { && !_swrast_use_fragment_program(ctx)) {
/* texcoord w/ divide by Q */ /* texcoord w/ divide by Q */
const GLuint unit = attr - FRAG_ATTRIB_TEX0; const GLuint unit = attr - VARYING_SLOT_TEX0;
const GLfloat invQ = solve_plane_recip(fx, fy, line->attrPlane[attr][3]); const GLfloat invQ = solve_plane_recip(fx, fy, line->attrPlane[attr][3]);
GLuint c; GLuint c;
for (c = 0; c < 3; c++) { for (c = 0; c < 3; c++) {
@ -112,10 +112,10 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
/* Init the LineInfo struct */ /* Init the LineInfo struct */
struct LineInfo line; struct LineInfo line;
line.x0 = v0->attrib[FRAG_ATTRIB_WPOS][0]; line.x0 = v0->attrib[VARYING_SLOT_POS][0];
line.y0 = v0->attrib[FRAG_ATTRIB_WPOS][1]; line.y0 = v0->attrib[VARYING_SLOT_POS][1];
line.x1 = v1->attrib[FRAG_ATTRIB_WPOS][0]; line.x1 = v1->attrib[VARYING_SLOT_POS][0];
line.y1 = v1->attrib[FRAG_ATTRIB_WPOS][1]; line.y1 = v1->attrib[VARYING_SLOT_POS][1];
line.dx = line.x1 - line.x0; line.dx = line.x1 - line.x0;
line.dy = line.y1 - line.y0; line.dy = line.y1 - line.y0;
line.len = sqrtf(line.dx * line.dx + line.dy * line.dy); line.len = sqrtf(line.dx * line.dx + line.dy * line.dy);
@ -135,7 +135,7 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
#ifdef DO_Z #ifdef DO_Z
line.span.arrayMask |= SPAN_Z; line.span.arrayMask |= SPAN_Z;
compute_plane(line.x0, line.y0, line.x1, line.y1, compute_plane(line.x0, line.y0, line.x1, line.y1,
v0->attrib[FRAG_ATTRIB_WPOS][2], v1->attrib[FRAG_ATTRIB_WPOS][2], line.zPlane); v0->attrib[VARYING_SLOT_POS][2], v1->attrib[VARYING_SLOT_POS][2], line.zPlane);
#endif #endif
line.span.arrayMask |= SPAN_RGBA; line.span.arrayMask |= SPAN_RGBA;
if (ctx->Light.ShadeModel == GL_SMOOTH) { if (ctx->Light.ShadeModel == GL_SMOOTH) {
@ -156,8 +156,8 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
} }
#if defined(DO_ATTRIBS) #if defined(DO_ATTRIBS)
{ {
const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invW0 = v0->attrib[VARYING_SLOT_POS][3];
const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invW1 = v1->attrib[VARYING_SLOT_POS][3];
line.span.arrayMask |= SPAN_LAMBDA; line.span.arrayMask |= SPAN_LAMBDA;
compute_plane(line.x0, line.y0, line.x1, line.y1, invW0, invW1, line.wPlane); compute_plane(line.x0, line.y0, line.x1, line.y1, invW0, invW1, line.wPlane);
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
@ -176,8 +176,8 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
} }
} }
line.span.arrayAttribs |= BITFIELD64_BIT(attr); line.span.arrayAttribs |= BITFIELD64_BIT(attr);
if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) { if (attr >= VARYING_SLOT_TEX0 && attr < VARYING_SLOT_VAR0) {
const GLuint u = attr - FRAG_ATTRIB_TEX0; const GLuint u = attr - VARYING_SLOT_TEX0;
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel]; const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
line.texWidth[attr] = (GLfloat) texImage->Width; line.texWidth[attr] = (GLfloat) texImage->Width;

View file

@ -39,9 +39,9 @@
/*void triangle( struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/ /*void triangle( struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
{ {
const SWcontext *swrast = SWRAST_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLfloat *p0 = v0->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *p0 = v0->attrib[VARYING_SLOT_POS];
const GLfloat *p1 = v1->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *p1 = v1->attrib[VARYING_SLOT_POS];
const GLfloat *p2 = v2->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *p2 = v2->attrib[VARYING_SLOT_POS];
const SWvertex *vMin, *vMid, *vMax; const SWvertex *vMin, *vMid, *vMax;
GLint iyMin, iyMax; GLint iyMin, iyMax;
GLfloat yMin, yMax; GLfloat yMin, yMax;
@ -55,7 +55,7 @@
#endif #endif
GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4]; GLfloat rPlane[4], gPlane[4], bPlane[4], aPlane[4];
#if defined(DO_ATTRIBS) #if defined(DO_ATTRIBS)
GLfloat attrPlane[FRAG_ATTRIB_MAX][4][4]; GLfloat attrPlane[VARYING_SLOT_MAX][4][4];
GLfloat wPlane[4]; /* win[3] */ GLfloat wPlane[4]; /* win[3] */
#endif #endif
GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign; GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceCullSign;
@ -67,9 +67,9 @@
/* determine bottom to top order of vertices */ /* determine bottom to top order of vertices */
{ {
GLfloat y0 = v0->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat y0 = v0->attrib[VARYING_SLOT_POS][1];
GLfloat y1 = v1->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat y1 = v1->attrib[VARYING_SLOT_POS][1];
GLfloat y2 = v2->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat y2 = v2->attrib[VARYING_SLOT_POS][1];
if (y0 <= y1) { if (y0 <= y1) {
if (y1 <= y2) { if (y1 <= y2) {
vMin = v0; vMid = v1; vMax = v2; /* y0<=y1<=y2 */ vMin = v0; vMid = v1; vMax = v2; /* y0<=y1<=y2 */
@ -94,13 +94,13 @@
} }
} }
majDx = vMax->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0]; majDx = vMax->attrib[VARYING_SLOT_POS][0] - vMin->attrib[VARYING_SLOT_POS][0];
majDy = vMax->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1]; majDy = vMax->attrib[VARYING_SLOT_POS][1] - vMin->attrib[VARYING_SLOT_POS][1];
/* front/back-face determination and cullling */ /* front/back-face determination and cullling */
{ {
const GLfloat botDx = vMid->attrib[FRAG_ATTRIB_WPOS][0] - vMin->attrib[FRAG_ATTRIB_WPOS][0]; const GLfloat botDx = vMid->attrib[VARYING_SLOT_POS][0] - vMin->attrib[VARYING_SLOT_POS][0];
const GLfloat botDy = vMid->attrib[FRAG_ATTRIB_WPOS][1] - vMin->attrib[FRAG_ATTRIB_WPOS][1]; const GLfloat botDy = vMid->attrib[VARYING_SLOT_POS][1] - vMin->attrib[VARYING_SLOT_POS][1];
const GLfloat area = majDx * botDy - botDx * majDy; const GLfloat area = majDx * botDy - botDx * majDy;
/* Do backface culling */ /* Do backface culling */
if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area)) if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area))
@ -134,12 +134,12 @@
span.arrayMask |= SPAN_RGBA; span.arrayMask |= SPAN_RGBA;
#if defined(DO_ATTRIBS) #if defined(DO_ATTRIBS)
{ {
const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invW0 = v0->attrib[VARYING_SLOT_POS][3];
const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invW1 = v1->attrib[VARYING_SLOT_POS][3];
const GLfloat invW2 = v2->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invW2 = v2->attrib[VARYING_SLOT_POS][3];
compute_plane(p0, p1, p2, invW0, invW1, invW2, wPlane); compute_plane(p0, p1, p2, invW0, invW1, invW2, wPlane);
span.attrStepX[FRAG_ATTRIB_WPOS][3] = plane_dx(wPlane); span.attrStepX[VARYING_SLOT_POS][3] = plane_dx(wPlane);
span.attrStepY[FRAG_ATTRIB_WPOS][3] = plane_dy(wPlane); span.attrStepY[VARYING_SLOT_POS][3] = plane_dy(wPlane);
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
GLuint c; GLuint c;
if (swrast->_InterpMode[attr] == GL_FLAT) { if (swrast->_InterpMode[attr] == GL_FLAT) {
@ -169,16 +169,16 @@
* edges, stopping when we find that coverage = 0. If the long edge * edges, stopping when we find that coverage = 0. If the long edge
* is on the left we scan left-to-right. Else, we scan right-to-left. * is on the left we scan left-to-right. Else, we scan right-to-left.
*/ */
yMin = vMin->attrib[FRAG_ATTRIB_WPOS][1]; yMin = vMin->attrib[VARYING_SLOT_POS][1];
yMax = vMax->attrib[FRAG_ATTRIB_WPOS][1]; yMax = vMax->attrib[VARYING_SLOT_POS][1];
iyMin = (GLint) yMin; iyMin = (GLint) yMin;
iyMax = (GLint) yMax + 1; iyMax = (GLint) yMax + 1;
if (ltor) { if (ltor) {
/* scan left to right */ /* scan left to right */
const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *pMin = vMin->attrib[VARYING_SLOT_POS];
const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *pMid = vMid->attrib[VARYING_SLOT_POS];
const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *pMax = vMax->attrib[VARYING_SLOT_POS];
const GLfloat dxdy = majDx / majDy; const GLfloat dxdy = majDx / majDy;
const GLfloat xAdj = dxdy < 0.0F ? -dxdy : 0.0F; const GLfloat xAdj = dxdy < 0.0F ? -dxdy : 0.0F;
GLint iy; GLint iy;
@ -208,7 +208,7 @@
#if defined(DO_ATTRIBS) #if defined(DO_ATTRIBS)
/* compute attributes at left-most fragment */ /* compute attributes at left-most fragment */
span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 0.5F, iy + 0.5F, wPlane); span.attrStart[VARYING_SLOT_POS][3] = solve_plane(ix + 0.5F, iy + 0.5F, wPlane);
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
GLuint c; GLuint c;
for (c = 0; c < 4; c++) { for (c = 0; c < 4; c++) {
@ -245,9 +245,9 @@
} }
else { else {
/* scan right to left */ /* scan right to left */
const GLfloat *pMin = vMin->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *pMin = vMin->attrib[VARYING_SLOT_POS];
const GLfloat *pMid = vMid->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *pMid = vMid->attrib[VARYING_SLOT_POS];
const GLfloat *pMax = vMax->attrib[FRAG_ATTRIB_WPOS]; const GLfloat *pMax = vMax->attrib[VARYING_SLOT_POS];
const GLfloat dxdy = majDx / majDy; const GLfloat dxdy = majDx / majDy;
const GLfloat xAdj = dxdy > 0 ? dxdy : 0.0F; const GLfloat xAdj = dxdy > 0 ? dxdy : 0.0F;
GLint iy; GLint iy;
@ -300,7 +300,7 @@
#if defined(DO_ATTRIBS) #if defined(DO_ATTRIBS)
/* compute attributes at left-most fragment */ /* compute attributes at left-most fragment */
span.attrStart[FRAG_ATTRIB_WPOS][3] = solve_plane(ix + 1.5F, iy + 0.5F, wPlane); span.attrStart[VARYING_SLOT_POS][3] = solve_plane(ix + 1.5F, iy + 0.5F, wPlane);
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
GLuint c; GLuint c;
for (c = 0; c < 4; c++) { for (c = 0; c < 4; c++) {

View file

@ -123,7 +123,7 @@ _swrast_alpha_test(const struct gl_context *ctx, SWspan *span)
ALPHA_TEST(rgba[i][ACOMP], ;); ALPHA_TEST(rgba[i][ACOMP], ;);
} }
else { else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
const GLfloat ref = ctx->Color.AlphaRef; const GLfloat ref = ctx->Color.AlphaRef;
ALPHA_TEST(rgba[i][ACOMP], ;); ALPHA_TEST(rgba[i][ACOMP], ;);
} }

View file

@ -248,7 +248,7 @@ handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst,
if (pass_tex >= GL_TEXTURE0_ARB && pass_tex <= GL_TEXTURE7_ARB) { if (pass_tex >= GL_TEXTURE0_ARB && pass_tex <= GL_TEXTURE7_ARB) {
pass_tex -= GL_TEXTURE0_ARB; pass_tex -= GL_TEXTURE0_ARB;
COPY_4V(machine->Registers[idx], COPY_4V(machine->Registers[idx],
span->array->attribs[FRAG_ATTRIB_TEX0 + pass_tex][column]); span->array->attribs[VARYING_SLOT_TEX0 + pass_tex][column]);
} }
else if (pass_tex >= GL_REG_0_ATI && pass_tex <= GL_REG_5_ATI) { else if (pass_tex >= GL_REG_0_ATI && pass_tex <= GL_REG_5_ATI) {
pass_tex -= GL_REG_0_ATI; pass_tex -= GL_REG_0_ATI;
@ -271,7 +271,7 @@ handle_sample_op(struct gl_context * ctx, struct atifs_machine *machine,
if (coord_source >= GL_TEXTURE0_ARB && coord_source <= GL_TEXTURE7_ARB) { if (coord_source >= GL_TEXTURE0_ARB && coord_source <= GL_TEXTURE7_ARB) {
coord_source -= GL_TEXTURE0_ARB; coord_source -= GL_TEXTURE0_ARB;
COPY_4V(tex_coords, COPY_4V(tex_coords,
span->array->attribs[FRAG_ATTRIB_TEX0 + coord_source][column]); span->array->attribs[VARYING_SLOT_TEX0 + coord_source][column]);
} }
else if (coord_source >= GL_REG_0_ATI && coord_source <= GL_REG_5_ATI) { else if (coord_source >= GL_REG_0_ATI && coord_source <= GL_REG_5_ATI) {
coord_source -= GL_REG_0_ATI; coord_source -= GL_REG_0_ATI;
@ -554,8 +554,8 @@ init_machine(struct gl_context * ctx, struct atifs_machine *machine,
machine->Registers[i][j] = 0.0; machine->Registers[i][j] = 0.0;
} }
COPY_4V(inputs[ATI_FS_INPUT_PRIMARY], span->array->attribs[FRAG_ATTRIB_COL0][col]); COPY_4V(inputs[ATI_FS_INPUT_PRIMARY], span->array->attribs[VARYING_SLOT_COL0][col]);
COPY_4V(inputs[ATI_FS_INPUT_SECONDARY], span->array->attribs[FRAG_ATTRIB_COL1][col]); COPY_4V(inputs[ATI_FS_INPUT_SECONDARY], span->array->attribs[VARYING_SLOT_COL1][col]);
} }
@ -584,7 +584,7 @@ _swrast_exec_fragment_shader(struct gl_context * ctx, SWspan *span)
const GLfloat *colOut = machine.Registers[0]; const GLfloat *colOut = machine.Registers[0];
/*fprintf(stderr,"outputs %f %f %f %f\n", /*fprintf(stderr,"outputs %f %f %f %f\n",
colOut[0], colOut[1], colOut[2], colOut[3]); */ colOut[0], colOut[1], colOut[2], colOut[3]); */
COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], colOut); COPY_4V(span->array->attribs[VARYING_SLOT_COL0][i], colOut);
} }
} }
} }

View file

@ -502,7 +502,7 @@ _swrast_update_active_attribs(struct gl_context *ctx)
if (_swrast_use_fragment_program(ctx)) { if (_swrast_use_fragment_program(ctx)) {
/* fragment program/shader */ /* fragment program/shader */
attribsMask = ctx->FragmentProgram._Current->Base.InputsRead; attribsMask = ctx->FragmentProgram._Current->Base.InputsRead;
attribsMask &= ~FRAG_BIT_WPOS; /* WPOS is always handled specially */ attribsMask &= ~VARYING_BIT_POS; /* WPOS is always handled specially */
} }
else if (ctx->ATIFragmentShader._Enabled) { else if (ctx->ATIFragmentShader._Enabled) {
attribsMask = ~0; /* XXX fix me */ attribsMask = ~0; /* XXX fix me */
@ -512,19 +512,19 @@ _swrast_update_active_attribs(struct gl_context *ctx)
attribsMask = 0x0; attribsMask = 0x0;
#if CHAN_TYPE == GL_FLOAT #if CHAN_TYPE == GL_FLOAT
attribsMask |= FRAG_BIT_COL0; attribsMask |= VARYING_BIT_COL0;
#endif #endif
if (ctx->Fog.ColorSumEnabled || if (ctx->Fog.ColorSumEnabled ||
(ctx->Light.Enabled && (ctx->Light.Enabled &&
ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) { ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR)) {
attribsMask |= FRAG_BIT_COL1; attribsMask |= VARYING_BIT_COL1;
} }
if (swrast->_FogEnabled) if (swrast->_FogEnabled)
attribsMask |= FRAG_BIT_FOGC; attribsMask |= VARYING_BIT_FOGC;
attribsMask |= (ctx->Texture._EnabledUnits << FRAG_ATTRIB_TEX0); attribsMask |= (ctx->Texture._EnabledUnits << VARYING_SLOT_TEX0);
} }
swrast->_ActiveAttribMask = attribsMask; swrast->_ActiveAttribMask = attribsMask;
@ -532,11 +532,11 @@ _swrast_update_active_attribs(struct gl_context *ctx)
/* Update _ActiveAttribs[] list */ /* Update _ActiveAttribs[] list */
{ {
GLuint i, num = 0; GLuint i, num = 0;
for (i = 0; i < FRAG_ATTRIB_MAX; i++) { for (i = 0; i < VARYING_SLOT_MAX; i++) {
if (attribsMask & BITFIELD64_BIT(i)) { if (attribsMask & BITFIELD64_BIT(i)) {
swrast->_ActiveAttribs[num++] = i; swrast->_ActiveAttribs[num++] = i;
/* how should this attribute be interpolated? */ /* how should this attribute be interpolated? */
if (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1) if (i == VARYING_SLOT_COL0 || i == VARYING_SLOT_COL1)
swrast->_InterpMode[i] = ctx->Light.ShadeModel; swrast->_InterpMode[i] = ctx->Light.ShadeModel;
else else
swrast->_InterpMode[i] = GL_SMOOTH; swrast->_InterpMode[i] = GL_SMOOTH;
@ -785,7 +785,7 @@ _swrast_CreateContext( struct gl_context *ctx )
#elif CHAN_TYPE == GL_UNSIGNED_SHORT #elif CHAN_TYPE == GL_UNSIGNED_SHORT
swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba16; swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].rgba16;
#else #else
swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].attribs[FRAG_ATTRIB_COL0]; swrast->SpanArrays[i].rgba = swrast->SpanArrays[i].attribs[VARYING_SLOT_COL0];
#endif #endif
} }
@ -918,18 +918,18 @@ _swrast_print_vertex( struct gl_context *ctx, const SWvertex *v )
if (SWRAST_DEBUG_VERTICES) { if (SWRAST_DEBUG_VERTICES) {
_mesa_debug(ctx, "win %f %f %f %f\n", _mesa_debug(ctx, "win %f %f %f %f\n",
v->attrib[FRAG_ATTRIB_WPOS][0], v->attrib[VARYING_SLOT_POS][0],
v->attrib[FRAG_ATTRIB_WPOS][1], v->attrib[VARYING_SLOT_POS][1],
v->attrib[FRAG_ATTRIB_WPOS][2], v->attrib[VARYING_SLOT_POS][2],
v->attrib[FRAG_ATTRIB_WPOS][3]); v->attrib[VARYING_SLOT_POS][3]);
for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
if (ctx->Texture.Unit[i]._ReallyEnabled) if (ctx->Texture.Unit[i]._ReallyEnabled)
_mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i, _mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i,
v->attrib[FRAG_ATTRIB_TEX0 + i][0], v->attrib[VARYING_SLOT_TEX0 + i][0],
v->attrib[FRAG_ATTRIB_TEX0 + i][1], v->attrib[VARYING_SLOT_TEX0 + i][1],
v->attrib[FRAG_ATTRIB_TEX0 + i][2], v->attrib[VARYING_SLOT_TEX0 + i][2],
v->attrib[FRAG_ATTRIB_TEX0 + i][3]); v->attrib[VARYING_SLOT_TEX0 + i][3]);
#if CHAN_TYPE == GL_FLOAT #if CHAN_TYPE == GL_FLOAT
_mesa_debug(ctx, "color %f %f %f %f\n", _mesa_debug(ctx, "color %f %f %f %f\n",
@ -939,12 +939,12 @@ _swrast_print_vertex( struct gl_context *ctx, const SWvertex *v )
v->color[0], v->color[1], v->color[2], v->color[3]); v->color[0], v->color[1], v->color[2], v->color[3]);
#endif #endif
_mesa_debug(ctx, "spec %g %g %g %g\n", _mesa_debug(ctx, "spec %g %g %g %g\n",
v->attrib[FRAG_ATTRIB_COL1][0], v->attrib[VARYING_SLOT_COL1][0],
v->attrib[FRAG_ATTRIB_COL1][1], v->attrib[VARYING_SLOT_COL1][1],
v->attrib[FRAG_ATTRIB_COL1][2], v->attrib[VARYING_SLOT_COL1][2],
v->attrib[FRAG_ATTRIB_COL1][3]); v->attrib[VARYING_SLOT_COL1][3]);
_mesa_debug(ctx, "fog %f\n", v->attrib[FRAG_ATTRIB_FOGC][0]); _mesa_debug(ctx, "fog %f\n", v->attrib[VARYING_SLOT_FOGC][0]);
_mesa_debug(ctx, "index %f\n", v->attrib[FRAG_ATTRIB_CI][0]); _mesa_debug(ctx, "index %f\n", v->attrib[VARYING_SLOT_CI][0]);
_mesa_debug(ctx, "pointsize %f\n", v->pointSize); _mesa_debug(ctx, "pointsize %f\n", v->pointSize);
_mesa_debug(ctx, "\n"); _mesa_debug(ctx, "\n");
} }

View file

@ -224,13 +224,13 @@ typedef struct
GLboolean _DeferredTexture; GLboolean _DeferredTexture;
/** List/array of the fragment attributes to interpolate */ /** List/array of the fragment attributes to interpolate */
GLuint _ActiveAttribs[FRAG_ATTRIB_MAX]; GLuint _ActiveAttribs[VARYING_SLOT_MAX];
/** Same info, but as a bitmask of FRAG_BIT_x bits */ /** Same info, but as a bitmask of VARYING_BIT_x bits */
GLbitfield64 _ActiveAttribMask; GLbitfield64 _ActiveAttribMask;
/** Number of fragment attributes to interpolate */ /** Number of fragment attributes to interpolate */
GLuint _NumActiveAttribs; GLuint _NumActiveAttribs;
/** Indicates how each attrib is to be interpolated (lines/tris) */ /** Indicates how each attrib is to be interpolated (lines/tris) */
GLenum _InterpMode[FRAG_ATTRIB_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */ GLenum _InterpMode[VARYING_SLOT_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */
/* Working values: /* Working values:
*/ */

View file

@ -136,7 +136,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
INIT_SPAN(span, GL_BITMAP); INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span); _swrast_span_default_attribs(ctx, &span);
span.arrayMask = SPAN_RGBA; span.arrayMask = SPAN_RGBA;
span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */ span.arrayAttribs = VARYING_BIT_COL0; /* we'll fill in COL0 attrib values */
if (overlapping) { if (overlapping) {
tmpImage = malloc(width * height * sizeof(GLfloat) * 4); tmpImage = malloc(width * height * sizeof(GLfloat) * 4);
@ -161,7 +161,7 @@ copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
ASSERT(width < SWRAST_MAX_WIDTH); ASSERT(width < SWRAST_MAX_WIDTH);
for (row = 0; row < height; row++, sy += stepy, dy += stepy) { for (row = 0; row < height; row++, sy += stepy, dy += stepy) {
GLvoid *rgba = span.array->attribs[FRAG_ATTRIB_COL0]; GLvoid *rgba = span.array->attribs[VARYING_SLOT_COL0];
/* Get row/span of source pixels */ /* Get row/span of source pixels */
if (overlapping) { if (overlapping) {

View file

@ -429,7 +429,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
INIT_SPAN(span, GL_BITMAP); INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span); _swrast_span_default_attribs(ctx, &span);
span.arrayMask = SPAN_RGBA; span.arrayMask = SPAN_RGBA;
span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */ span.arrayAttribs = VARYING_BIT_COL0; /* we're fill in COL0 attrib values */
if (ctx->DrawBuffer->_NumColorDrawBuffers > 0) { if (ctx->DrawBuffer->_NumColorDrawBuffers > 0) {
GLenum datatype = _mesa_get_format_datatype( GLenum datatype = _mesa_get_format_datatype(
@ -451,7 +451,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
= _mesa_image_row_stride(unpack, width, format, type); = _mesa_image_row_stride(unpack, width, format, type);
GLint skipPixels = 0; GLint skipPixels = 0;
/* use span array for temp color storage */ /* use span array for temp color storage */
GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0]; GLfloat *rgba = (GLfloat *) span.array->attribs[VARYING_SLOT_COL0];
/* if the span is wider than SWRAST_MAX_WIDTH we have to do it in chunks */ /* if the span is wider than SWRAST_MAX_WIDTH we have to do it in chunks */
while (skipPixels < width) { while (skipPixels < width) {

View file

@ -37,13 +37,13 @@ static void
feedback_vertex(struct gl_context * ctx, const SWvertex * v, const SWvertex * pv) feedback_vertex(struct gl_context * ctx, const SWvertex * v, const SWvertex * pv)
{ {
GLfloat win[4]; GLfloat win[4];
const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0]; const GLfloat *vtc = v->attrib[VARYING_SLOT_TEX0];
const GLfloat *color = v->attrib[FRAG_ATTRIB_COL0]; const GLfloat *color = v->attrib[VARYING_SLOT_COL0];
win[0] = v->attrib[FRAG_ATTRIB_WPOS][0]; win[0] = v->attrib[VARYING_SLOT_POS][0];
win[1] = v->attrib[FRAG_ATTRIB_WPOS][1]; win[1] = v->attrib[VARYING_SLOT_POS][1];
win[2] = v->attrib[FRAG_ATTRIB_WPOS][2] / ctx->DrawBuffer->_DepthMaxF; win[2] = v->attrib[VARYING_SLOT_POS][2] / ctx->DrawBuffer->_DepthMaxF;
win[3] = 1.0F / v->attrib[FRAG_ATTRIB_WPOS][3]; win[3] = 1.0F / v->attrib[VARYING_SLOT_POS][3];
_mesa_feedback_vertex(ctx, win, color, vtc); _mesa_feedback_vertex(ctx, win, color, vtc);
} }
@ -114,9 +114,9 @@ _swrast_select_triangle(struct gl_context *ctx, const SWvertex *v0,
if (!_swrast_culltriangle(ctx, v0, v1, v2)) { if (!_swrast_culltriangle(ctx, v0, v1, v2)) {
const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF;
_mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs ); _mesa_update_hitflag( ctx, v0->attrib[VARYING_SLOT_POS][2] * zs );
_mesa_update_hitflag( ctx, v1->attrib[FRAG_ATTRIB_WPOS][2] * zs ); _mesa_update_hitflag( ctx, v1->attrib[VARYING_SLOT_POS][2] * zs );
_mesa_update_hitflag( ctx, v2->attrib[FRAG_ATTRIB_WPOS][2] * zs ); _mesa_update_hitflag( ctx, v2->attrib[VARYING_SLOT_POS][2] * zs );
} }
} }
@ -125,8 +125,8 @@ void
_swrast_select_line(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1) _swrast_select_line(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
{ {
const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF;
_mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs ); _mesa_update_hitflag( ctx, v0->attrib[VARYING_SLOT_POS][2] * zs );
_mesa_update_hitflag( ctx, v1->attrib[FRAG_ATTRIB_WPOS][2] * zs ); _mesa_update_hitflag( ctx, v1->attrib[VARYING_SLOT_POS][2] * zs );
} }
@ -134,5 +134,5 @@ void
_swrast_select_point(struct gl_context *ctx, const SWvertex *v) _swrast_select_point(struct gl_context *ctx, const SWvertex *v)
{ {
const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF; const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF;
_mesa_update_hitflag( ctx, v->attrib[FRAG_ATTRIB_WPOS][2] * zs ); _mesa_update_hitflag( ctx, v->attrib[VARYING_SLOT_POS][2] * zs );
} }

View file

@ -87,10 +87,10 @@ do { \
* \param COMPUTE_F code to compute the fog blend factor, f. * \param COMPUTE_F code to compute the fog blend factor, f.
*/ */
#define FOG_LOOP(TYPE, FOG_FUNC) \ #define FOG_LOOP(TYPE, FOG_FUNC) \
if (span->arrayAttribs & FRAG_BIT_FOGC) { \ if (span->arrayAttribs & VARYING_BIT_FOGC) { \
GLuint i; \ GLuint i; \
for (i = 0; i < span->end; i++) { \ for (i = 0; i < span->end; i++) { \
const GLfloat fogCoord = span->array->attribs[FRAG_ATTRIB_FOGC][i][0]; \ const GLfloat fogCoord = span->array->attribs[VARYING_SLOT_FOGC][i][0]; \
const GLfloat c = FABSF(fogCoord); \ const GLfloat c = FABSF(fogCoord); \
GLfloat f, oneMinusF; \ GLfloat f, oneMinusF; \
FOG_FUNC(f, c); \ FOG_FUNC(f, c); \
@ -102,10 +102,10 @@ if (span->arrayAttribs & FRAG_BIT_FOGC) { \
} \ } \
} \ } \
else { \ else { \
const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \ const GLfloat fogStep = span->attrStepX[VARYING_SLOT_FOGC][0]; \
GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \ GLfloat fogCoord = span->attrStart[VARYING_SLOT_FOGC][0]; \
const GLfloat wStep = span->attrStepX[FRAG_ATTRIB_WPOS][3]; \ const GLfloat wStep = span->attrStepX[VARYING_SLOT_POS][3]; \
GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; \ GLfloat w = span->attrStart[VARYING_SLOT_POS][3]; \
GLuint i; \ GLuint i; \
for (i = 0; i < span->end; i++) { \ for (i = 0; i < span->end; i++) { \
const GLfloat c = FABSF(fogCoord) / w; \ const GLfloat c = FABSF(fogCoord) / w; \
@ -173,7 +173,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, LINEAR_FOG); FOG_LOOP(GLushort, LINEAR_FOG);
} }
else { else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
ASSERT(span->array->ChanType == GL_FLOAT); ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, LINEAR_FOG); FOG_LOOP(GLfloat, LINEAR_FOG);
} }
@ -192,7 +192,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, EXP_FOG); FOG_LOOP(GLushort, EXP_FOG);
} }
else { else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
ASSERT(span->array->ChanType == GL_FLOAT); ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, EXP_FOG); FOG_LOOP(GLfloat, EXP_FOG);
} }
@ -211,7 +211,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, EXP2_FOG); FOG_LOOP(GLushort, EXP2_FOG);
} }
else { else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
ASSERT(span->array->ChanType == GL_FLOAT); ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, EXP2_FOG); FOG_LOOP(GLfloat, EXP2_FOG);
} }
@ -236,7 +236,7 @@ _swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
FOG_LOOP(GLushort, BLEND_FOG); FOG_LOOP(GLushort, BLEND_FOG);
} }
else { else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
ASSERT(span->array->ChanType == GL_FLOAT); ASSERT(span->array->ChanType == GL_FLOAT);
FOG_LOOP(GLfloat, BLEND_FOG); FOG_LOOP(GLfloat, BLEND_FOG);
} }

View file

@ -162,7 +162,7 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
const struct gl_fragment_program *program, const struct gl_fragment_program *program,
const SWspan *span, GLuint col) const SWspan *span, GLuint col)
{ {
GLfloat *wpos = span->array->attribs[FRAG_ATTRIB_WPOS][col]; GLfloat *wpos = span->array->attribs[VARYING_SLOT_POS][col];
/* ARB_fragment_coord_conventions */ /* ARB_fragment_coord_conventions */
if (program->OriginUpperLeft) if (program->OriginUpperLeft)
@ -177,14 +177,14 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
machine->DerivX = (GLfloat (*)[4]) span->attrStepX; machine->DerivX = (GLfloat (*)[4]) span->attrStepX;
machine->DerivY = (GLfloat (*)[4]) span->attrStepY; machine->DerivY = (GLfloat (*)[4]) span->attrStepY;
machine->NumDeriv = FRAG_ATTRIB_MAX; machine->NumDeriv = VARYING_SLOT_MAX;
machine->Samplers = program->Base.SamplerUnits; machine->Samplers = program->Base.SamplerUnits;
/* if running a GLSL program (not ARB_fragment_program) */ /* if running a GLSL program (not ARB_fragment_program) */
if (ctx->Shader.CurrentFragmentProgram) { if (ctx->Shader.CurrentFragmentProgram) {
/* Store front/back facing value */ /* Store front/back facing value */
machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0F - span->facing; machine->Attribs[VARYING_SLOT_FACE][col][0] = 1.0F - span->facing;
} }
machine->CurElement = col; machine->CurElement = col;
@ -223,7 +223,7 @@ run_program(struct gl_context *ctx, SWspan *span, GLuint start, GLuint end)
/* Store result color */ /* Store result color */
if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) { if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) {
COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], COPY_4V(span->array->attribs[VARYING_SLOT_COL0][i],
machine->Outputs[FRAG_RESULT_COLOR]); machine->Outputs[FRAG_RESULT_COLOR]);
} }
else { else {
@ -234,7 +234,7 @@ run_program(struct gl_context *ctx, SWspan *span, GLuint start, GLuint end)
GLuint buf; GLuint buf;
for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) { for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) {
if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0 + buf)) { if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0 + buf)) {
COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0 + buf][i], COPY_4V(span->array->attribs[VARYING_SLOT_COL0 + buf][i],
machine->Outputs[FRAG_RESULT_DATA0 + buf]); machine->Outputs[FRAG_RESULT_DATA0 + buf]);
} }
} }
@ -272,7 +272,7 @@ _swrast_exec_fragment_program( struct gl_context *ctx, SWspan *span )
const struct gl_fragment_program *program = ctx->FragmentProgram._Current; const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
/* incoming colors should be floats */ /* incoming colors should be floats */
if (program->Base.InputsRead & FRAG_BIT_COL0) { if (program->Base.InputsRead & VARYING_BIT_COL0) {
ASSERT(span->array->ChanType == GL_FLOAT); ASSERT(span->array->ChanType == GL_FLOAT);
} }

View file

@ -172,16 +172,16 @@ _swrast_add_spec_terms_line(struct gl_context *ctx,
COPY_CHAN4(cSave[0], ncv0->color); COPY_CHAN4(cSave[0], ncv0->color);
COPY_CHAN4(cSave[1], ncv1->color); COPY_CHAN4(cSave[1], ncv1->color);
/* sum v0 */ /* sum v0 */
rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[VARYING_SLOT_COL1][0];
gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[VARYING_SLOT_COL1][1];
bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[VARYING_SLOT_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
/* sum v1 */ /* sum v1 */
rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[VARYING_SLOT_COL1][0];
gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[VARYING_SLOT_COL1][1];
bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[VARYING_SLOT_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum);

View file

@ -68,10 +68,10 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 )
const SWcontext *swrast = SWRAST_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT(ctx);
SWspan span; SWspan span;
GLuint interpFlags = 0; GLuint interpFlags = 0;
GLint x0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][0]; GLint x0 = (GLint) vert0->attrib[VARYING_SLOT_POS][0];
GLint x1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][0]; GLint x1 = (GLint) vert1->attrib[VARYING_SLOT_POS][0];
GLint y0 = (GLint) vert0->attrib[FRAG_ATTRIB_WPOS][1]; GLint y0 = (GLint) vert0->attrib[VARYING_SLOT_POS][1];
GLint y1 = (GLint) vert1->attrib[FRAG_ATTRIB_WPOS][1]; GLint y1 = (GLint) vert1->attrib[VARYING_SLOT_POS][1];
GLint dx, dy; GLint dx, dy;
GLint numPixels; GLint numPixels;
GLint xstep, ystep; GLint xstep, ystep;
@ -99,8 +99,8 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 )
/* Cull primitives with malformed coordinates. /* Cull primitives with malformed coordinates.
*/ */
{ {
GLfloat tmp = vert0->attrib[FRAG_ATTRIB_WPOS][0] + vert0->attrib[FRAG_ATTRIB_WPOS][1] GLfloat tmp = vert0->attrib[VARYING_SLOT_POS][0] + vert0->attrib[VARYING_SLOT_POS][1]
+ vert1->attrib[FRAG_ATTRIB_WPOS][0] + vert1->attrib[FRAG_ATTRIB_WPOS][1]; + vert1->attrib[VARYING_SLOT_POS][0] + vert1->attrib[VARYING_SLOT_POS][1];
if (IS_INF_OR_NAN(tmp)) if (IS_INF_OR_NAN(tmp))
return; return;
} }
@ -108,12 +108,12 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 )
/* /*
printf("%s():\n", __FUNCTION__); printf("%s():\n", __FUNCTION__);
printf(" (%f, %f, %f) -> (%f, %f, %f)\n", printf(" (%f, %f, %f) -> (%f, %f, %f)\n",
vert0->attrib[FRAG_ATTRIB_WPOS][0], vert0->attrib[VARYING_SLOT_POS][0],
vert0->attrib[FRAG_ATTRIB_WPOS][1], vert0->attrib[VARYING_SLOT_POS][1],
vert0->attrib[FRAG_ATTRIB_WPOS][2], vert0->attrib[VARYING_SLOT_POS][2],
vert1->attrib[FRAG_ATTRIB_WPOS][0], vert1->attrib[VARYING_SLOT_POS][0],
vert1->attrib[FRAG_ATTRIB_WPOS][1], vert1->attrib[VARYING_SLOT_POS][1],
vert1->attrib[FRAG_ATTRIB_WPOS][2]); vert1->attrib[VARYING_SLOT_POS][2]);
printf(" (%d, %d, %d) -> (%d, %d, %d)\n", printf(" (%d, %d, %d) -> (%d, %d, %d)\n",
vert0->color[0], vert0->color[1], vert0->color[2], vert0->color[0], vert0->color[1], vert0->color[2],
vert1->color[0], vert1->color[1], vert1->color[2]); vert1->color[0], vert1->color[1], vert1->color[2]);
@ -155,14 +155,14 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 )
/* /*
printf("%s %d,%d %g %g %g %g %g %g %g %g\n", __FUNCTION__, dx, dy, printf("%s %d,%d %g %g %g %g %g %g %g %g\n", __FUNCTION__, dx, dy,
vert0->attrib[FRAG_ATTRIB_COL1][0], vert0->attrib[VARYING_SLOT_COL1][0],
vert0->attrib[FRAG_ATTRIB_COL1][1], vert0->attrib[VARYING_SLOT_COL1][1],
vert0->attrib[FRAG_ATTRIB_COL1][2], vert0->attrib[VARYING_SLOT_COL1][2],
vert0->attrib[FRAG_ATTRIB_COL1][3], vert0->attrib[VARYING_SLOT_COL1][3],
vert1->attrib[FRAG_ATTRIB_COL1][0], vert1->attrib[VARYING_SLOT_COL1][0],
vert1->attrib[FRAG_ATTRIB_COL1][1], vert1->attrib[VARYING_SLOT_COL1][1],
vert1->attrib[FRAG_ATTRIB_COL1][2], vert1->attrib[VARYING_SLOT_COL1][2],
vert1->attrib[FRAG_ATTRIB_COL1][3]); vert1->attrib[VARYING_SLOT_COL1][3]);
*/ */
#ifdef DEPTH_TYPE #ifdef DEPTH_TYPE
@ -245,27 +245,27 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 )
interpFlags |= SPAN_Z; interpFlags |= SPAN_Z;
{ {
if (depthBits <= 16) { if (depthBits <= 16) {
span.z = FloatToFixed(vert0->attrib[FRAG_ATTRIB_WPOS][2]) + FIXED_HALF; span.z = FloatToFixed(vert0->attrib[VARYING_SLOT_POS][2]) + FIXED_HALF;
span.zStep = FloatToFixed( vert1->attrib[FRAG_ATTRIB_WPOS][2] span.zStep = FloatToFixed( vert1->attrib[VARYING_SLOT_POS][2]
- vert0->attrib[FRAG_ATTRIB_WPOS][2]) / numPixels; - vert0->attrib[VARYING_SLOT_POS][2]) / numPixels;
} }
else { else {
/* don't use fixed point */ /* don't use fixed point */
span.z = (GLuint) vert0->attrib[FRAG_ATTRIB_WPOS][2]; span.z = (GLuint) vert0->attrib[VARYING_SLOT_POS][2];
span.zStep = (GLint) (( vert1->attrib[FRAG_ATTRIB_WPOS][2] span.zStep = (GLint) (( vert1->attrib[VARYING_SLOT_POS][2]
- vert0->attrib[FRAG_ATTRIB_WPOS][2]) / numPixels); - vert0->attrib[VARYING_SLOT_POS][2]) / numPixels);
} }
} }
#endif #endif
#if defined(INTERP_ATTRIBS) #if defined(INTERP_ATTRIBS)
{ {
const GLfloat invLen = 1.0F / numPixels; const GLfloat invLen = 1.0F / numPixels;
const GLfloat invw0 = vert0->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invw0 = vert0->attrib[VARYING_SLOT_POS][3];
const GLfloat invw1 = vert1->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invw1 = vert1->attrib[VARYING_SLOT_POS][3];
span.attrStart[FRAG_ATTRIB_WPOS][3] = invw0; span.attrStart[VARYING_SLOT_POS][3] = invw0;
span.attrStepX[FRAG_ATTRIB_WPOS][3] = (invw1 - invw0) * invLen; span.attrStepX[VARYING_SLOT_POS][3] = (invw1 - invw0) * invLen;
span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; span.attrStepY[VARYING_SLOT_POS][3] = 0.0;
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
if (swrast->_InterpMode[attr] == GL_FLAT) { if (swrast->_InterpMode[attr] == GL_FLAT) {

View file

@ -212,7 +212,7 @@ _swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
} }
else { else {
logicop_uint4(ctx, 4 * span->end, logicop_uint4(ctx, 4 * span->end,
(GLuint *) span->array->attribs[FRAG_ATTRIB_COL0], (GLuint *) span->array->attribs[VARYING_SLOT_COL0],
(const GLuint *) rbPixels, span->array->mask); (const GLuint *) rbPixels, span->array->mask);
} }
} }

View file

@ -90,7 +90,7 @@ _swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
const GLuint bMask = ctx->Color.ColorMask[buf][BCOMP] ? ~0x0 : 0x0; const GLuint bMask = ctx->Color.ColorMask[buf][BCOMP] ? ~0x0 : 0x0;
const GLuint aMask = ctx->Color.ColorMask[buf][ACOMP] ? ~0x0 : 0x0; const GLuint aMask = ctx->Color.ColorMask[buf][ACOMP] ? ~0x0 : 0x0;
const GLuint (*dst)[4] = (const GLuint (*)[4]) rbPixels; const GLuint (*dst)[4] = (const GLuint (*)[4]) rbPixels;
GLuint (*src)[4] = (GLuint (*)[4]) span->array->attribs[FRAG_ATTRIB_COL0]; GLuint (*src)[4] = (GLuint (*)[4]) span->array->attribs[VARYING_SLOT_COL0];
GLuint i; GLuint i;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask); src[i][RCOMP] = (src[i][RCOMP] & rMask) | (dst[i][RCOMP] & ~rMask);

View file

@ -37,8 +37,8 @@
*/ */
#define CULL_INVALID(V) \ #define CULL_INVALID(V) \
do { \ do { \
float tmp = (V)->attrib[FRAG_ATTRIB_WPOS][0] \ float tmp = (V)->attrib[VARYING_SLOT_POS][0] \
+ (V)->attrib[FRAG_ATTRIB_WPOS][1]; \ + (V)->attrib[VARYING_SLOT_POS][1]; \
if (IS_INF_OR_NAN(tmp)) \ if (IS_INF_OR_NAN(tmp)) \
return; \ return; \
} while(0) } while(0)
@ -93,9 +93,9 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert)
/* z coord */ /* z coord */
if (ctx->DrawBuffer->Visual.depthBits <= 16) if (ctx->DrawBuffer->Visual.depthBits <= 16)
span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); span.z = FloatToFixed(vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
else else
span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); span.z = (GLuint) (vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
span.zStep = 0; span.zStep = 0;
size = get_size(ctx, vert, GL_FALSE); size = get_size(ctx, vert, GL_FALSE);
@ -116,9 +116,9 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert)
span.alphaStep = 0; span.alphaStep = 0;
/* need these for fragment programs */ /* need these for fragment programs */
span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; span.attrStart[VARYING_SLOT_POS][3] = 1.0F;
span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; span.attrStepX[VARYING_SLOT_POS][3] = 0.0F;
span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; span.attrStepY[VARYING_SLOT_POS][3] = 0.0F;
{ {
GLfloat s, r, dsdx; GLfloat s, r, dsdx;
@ -137,9 +137,9 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert)
} }
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
if (attr >= FRAG_ATTRIB_TEX0 && attr <= FRAG_ATTRIB_TEX7) { if (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7) {
/* a texcoord attribute */ /* a texcoord attribute */
const GLuint u = attr - FRAG_ATTRIB_TEX0; const GLuint u = attr - VARYING_SLOT_TEX0;
ASSERT(u < Elements(ctx->Point.CoordReplace)); ASSERT(u < Elements(ctx->Point.CoordReplace));
if (ctx->Point.CoordReplace[u]) { if (ctx->Point.CoordReplace[u]) {
tCoords[numTcoords++] = attr; tCoords[numTcoords++] = attr;
@ -169,15 +169,15 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert)
continue; continue;
} }
} }
else if (attr == FRAG_ATTRIB_PNTC) { else if (attr == VARYING_SLOT_PNTC) {
/* GLSL gl_PointCoord.xy (.zw undefined) */ /* GLSL gl_PointCoord.xy (.zw undefined) */
span.attrStart[FRAG_ATTRIB_PNTC][0] = 0.0; span.attrStart[VARYING_SLOT_PNTC][0] = 0.0;
span.attrStart[FRAG_ATTRIB_PNTC][1] = 0.0; /* t0 set below */ span.attrStart[VARYING_SLOT_PNTC][1] = 0.0; /* t0 set below */
span.attrStepX[FRAG_ATTRIB_PNTC][0] = dsdx; span.attrStepX[VARYING_SLOT_PNTC][0] = dsdx;
span.attrStepX[FRAG_ATTRIB_PNTC][1] = 0.0; span.attrStepX[VARYING_SLOT_PNTC][1] = 0.0;
span.attrStepY[FRAG_ATTRIB_PNTC][0] = 0.0; span.attrStepY[VARYING_SLOT_PNTC][0] = 0.0;
span.attrStepY[FRAG_ATTRIB_PNTC][1] = dtdy; span.attrStepY[VARYING_SLOT_PNTC][1] = dtdy;
tCoords[numTcoords++] = FRAG_ATTRIB_PNTC; tCoords[numTcoords++] = VARYING_SLOT_PNTC;
continue; continue;
} }
/* use vertex's texcoord/attrib */ /* use vertex's texcoord/attrib */
@ -189,8 +189,8 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert)
/* compute pos, bounds and render */ /* compute pos, bounds and render */
{ {
const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; const GLfloat x = vert->attrib[VARYING_SLOT_POS][0];
const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; const GLfloat y = vert->attrib[VARYING_SLOT_POS][1];
GLint iSize = (GLint) (size + 0.5F); GLint iSize = (GLint) (size + 0.5F);
GLint xmin, xmax, ymin, ymax, iy; GLint xmin, xmax, ymin, ymax, iy;
GLint iRadius; GLint iRadius;
@ -250,9 +250,9 @@ smooth_point(struct gl_context *ctx, const SWvertex *vert)
/* z coord */ /* z coord */
if (ctx->DrawBuffer->Visual.depthBits <= 16) if (ctx->DrawBuffer->Visual.depthBits <= 16)
span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); span.z = FloatToFixed(vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
else else
span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); span.z = (GLuint) (vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
span.zStep = 0; span.zStep = 0;
size = get_size(ctx, vert, GL_TRUE); size = get_size(ctx, vert, GL_TRUE);
@ -289,9 +289,9 @@ smooth_point(struct gl_context *ctx, const SWvertex *vert)
span.alphaStep = 0; span.alphaStep = 0;
/* need these for fragment programs */ /* need these for fragment programs */
span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; span.attrStart[VARYING_SLOT_POS][3] = 1.0F;
span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; span.attrStepX[VARYING_SLOT_POS][3] = 0.0F;
span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; span.attrStepY[VARYING_SLOT_POS][3] = 0.0F;
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
COPY_4V(span.attrStart[attr], vert->attrib[attr]); COPY_4V(span.attrStart[attr], vert->attrib[attr]);
@ -301,8 +301,8 @@ smooth_point(struct gl_context *ctx, const SWvertex *vert)
/* compute pos, bounds and render */ /* compute pos, bounds and render */
{ {
const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; const GLfloat x = vert->attrib[VARYING_SLOT_POS][0];
const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; const GLfloat y = vert->attrib[VARYING_SLOT_POS][1];
const GLfloat radius = 0.5F * size; const GLfloat radius = 0.5F * size;
const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */ const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
const GLfloat rmax = radius + 0.7071F; const GLfloat rmax = radius + 0.7071F;
@ -370,9 +370,9 @@ large_point(struct gl_context *ctx, const SWvertex *vert)
/* z coord */ /* z coord */
if (ctx->DrawBuffer->Visual.depthBits <= 16) if (ctx->DrawBuffer->Visual.depthBits <= 16)
span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); span.z = FloatToFixed(vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
else else
span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); span.z = (GLuint) (vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
span.zStep = 0; span.zStep = 0;
size = get_size(ctx, vert, GL_FALSE); size = get_size(ctx, vert, GL_FALSE);
@ -393,9 +393,9 @@ large_point(struct gl_context *ctx, const SWvertex *vert)
span.alphaStep = 0; span.alphaStep = 0;
/* need these for fragment programs */ /* need these for fragment programs */
span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; span.attrStart[VARYING_SLOT_POS][3] = 1.0F;
span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; span.attrStepX[VARYING_SLOT_POS][3] = 0.0F;
span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; span.attrStepY[VARYING_SLOT_POS][3] = 0.0F;
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
COPY_4V(span.attrStart[attr], vert->attrib[attr]); COPY_4V(span.attrStart[attr], vert->attrib[attr]);
@ -405,8 +405,8 @@ large_point(struct gl_context *ctx, const SWvertex *vert)
/* compute pos, bounds and render */ /* compute pos, bounds and render */
{ {
const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0]; const GLfloat x = vert->attrib[VARYING_SLOT_POS][0];
const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1]; const GLfloat y = vert->attrib[VARYING_SLOT_POS][1];
GLint iSize = (GLint) (size + 0.5F); GLint iSize = (GLint) (size + 0.5F);
GLint xmin, xmax, ymin, ymax, ix, iy; GLint xmin, xmax, ymin, ymax, ix, iy;
GLint iRadius; GLint iRadius;
@ -470,9 +470,9 @@ pixel_point(struct gl_context *ctx, const SWvertex *vert)
span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */ span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */
/* need these for fragment programs */ /* need these for fragment programs */
span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F; span->attrStart[VARYING_SLOT_POS][3] = 1.0F;
span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F; span->attrStepX[VARYING_SLOT_POS][3] = 0.0F;
span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F; span->attrStepY[VARYING_SLOT_POS][3] = 0.0F;
/* check if we need to flush */ /* check if we need to flush */
if (span->end >= SWRAST_MAX_WIDTH || if (span->end >= SWRAST_MAX_WIDTH ||
@ -499,9 +499,9 @@ pixel_point(struct gl_context *ctx, const SWvertex *vert)
ATTRIB_LOOP_END ATTRIB_LOOP_END
/* fragment position */ /* fragment position */
span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0]; span->array->x[count] = (GLint) vert->attrib[VARYING_SLOT_POS][0];
span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1]; span->array->y[count] = (GLint) vert->attrib[VARYING_SLOT_POS][1];
span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F); span->array->z[count] = (GLint) (vert->attrib[VARYING_SLOT_POS][2] + 0.5F);
span->end = count + 1; span->end = count + 1;
ASSERT(span->end <= SWRAST_MAX_WIDTH); ASSERT(span->end <= SWRAST_MAX_WIDTH);
@ -522,9 +522,9 @@ _swrast_add_spec_terms_point(struct gl_context *ctx, const SWvertex *v0)
/* save */ /* save */
COPY_CHAN4(cSave, ncv0->color); COPY_CHAN4(cSave, ncv0->color);
/* sum */ /* sum */
rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[VARYING_SLOT_COL1][0];
gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[VARYING_SLOT_COL1][1];
bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[VARYING_SLOT_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);

View file

@ -79,9 +79,9 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
} }
/* W (for perspective correction) */ /* W (for perspective correction) */
span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0; span->attrStart[VARYING_SLOT_POS][3] = 1.0;
span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0; span->attrStepX[VARYING_SLOT_POS][3] = 0.0;
span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0; span->attrStepY[VARYING_SLOT_POS][3] = 0.0;
/* primary color, or color index */ /* primary color, or color index */
UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]); UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]);
@ -105,16 +105,16 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
span->alphaStep = 0; span->alphaStep = 0;
span->interpMask |= SPAN_RGBA; span->interpMask |= SPAN_RGBA;
COPY_4V(span->attrStart[FRAG_ATTRIB_COL0], ctx->Current.RasterColor); COPY_4V(span->attrStart[VARYING_SLOT_COL0], ctx->Current.RasterColor);
ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); ASSIGN_4V(span->attrStepX[VARYING_SLOT_COL0], 0.0, 0.0, 0.0, 0.0);
ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL0], 0.0, 0.0, 0.0, 0.0); ASSIGN_4V(span->attrStepY[VARYING_SLOT_COL0], 0.0, 0.0, 0.0, 0.0);
/* Secondary color */ /* Secondary color */
if (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled) if (ctx->Light.Enabled || ctx->Fog.ColorSumEnabled)
{ {
COPY_4V(span->attrStart[FRAG_ATTRIB_COL1], ctx->Current.RasterSecondaryColor); COPY_4V(span->attrStart[VARYING_SLOT_COL1], ctx->Current.RasterSecondaryColor);
ASSIGN_4V(span->attrStepX[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); ASSIGN_4V(span->attrStepX[VARYING_SLOT_COL1], 0.0, 0.0, 0.0, 0.0);
ASSIGN_4V(span->attrStepY[FRAG_ATTRIB_COL1], 0.0, 0.0, 0.0, 0.0); ASSIGN_4V(span->attrStepY[VARYING_SLOT_COL1], 0.0, 0.0, 0.0, 0.0);
} }
/* fog */ /* fog */
@ -129,16 +129,16 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
/* fog blend factor should be computed from fogcoord now */ /* fog blend factor should be computed from fogcoord now */
fogVal = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance); fogVal = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
} }
span->attrStart[FRAG_ATTRIB_FOGC][0] = fogVal; span->attrStart[VARYING_SLOT_FOGC][0] = fogVal;
span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0; span->attrStepX[VARYING_SLOT_FOGC][0] = 0.0;
span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0; span->attrStepY[VARYING_SLOT_FOGC][0] = 0.0;
} }
/* texcoords */ /* texcoords */
{ {
GLuint i; GLuint i;
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
const GLuint attr = FRAG_ATTRIB_TEX0 + i; const GLuint attr = VARYING_SLOT_TEX0 + i;
const GLfloat *tc = ctx->Current.RasterTexCoords[i]; const GLfloat *tc = ctx->Current.RasterTexCoords[i];
if (_swrast_use_fragment_program(ctx) || if (_swrast_use_fragment_program(ctx) ||
ctx->ATIFragmentShader._Enabled) { ctx->ATIFragmentShader._Enabled) {
@ -165,7 +165,7 @@ _swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
* Interpolate the active attributes (and'd with attrMask) to * Interpolate the active attributes (and'd with attrMask) to
* fill in span->array->attribs[]. * fill in span->array->attribs[].
* Perspective correction will be done. The point/line/triangle function * Perspective correction will be done. The point/line/triangle function
* should have computed attrStart/Step values for FRAG_ATTRIB_WPOS[3]! * should have computed attrStart/Step values for VARYING_SLOT_POS[3]!
*/ */
static inline void static inline void
interpolate_active_attribs(struct gl_context *ctx, SWspan *span, interpolate_active_attribs(struct gl_context *ctx, SWspan *span,
@ -181,8 +181,8 @@ interpolate_active_attribs(struct gl_context *ctx, SWspan *span,
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
if (attrMask & BITFIELD64_BIT(attr)) { if (attrMask & BITFIELD64_BIT(attr)) {
const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; const GLfloat dwdx = span->attrStepX[VARYING_SLOT_POS][3];
GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3]; GLfloat w = span->attrStart[VARYING_SLOT_POS][3];
const GLfloat dv0dx = span->attrStepX[attr][0]; const GLfloat dv0dx = span->attrStepX[attr][0];
const GLfloat dv1dx = span->attrStepX[attr][1]; const GLfloat dv1dx = span->attrStepX[attr][1];
const GLfloat dv2dx = span->attrStepX[attr][2]; const GLfloat dv2dx = span->attrStepX[attr][2];
@ -302,7 +302,7 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span)
break; break;
#endif #endif
case GL_FLOAT: case GL_FLOAT:
interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); interpolate_active_attribs(ctx, span, VARYING_BIT_COL0);
break; break;
default: default:
_mesa_problem(ctx, "bad datatype 0x%x in interpolate_int_colors", _mesa_problem(ctx, "bad datatype 0x%x in interpolate_int_colors",
@ -313,16 +313,16 @@ interpolate_int_colors(struct gl_context *ctx, SWspan *span)
/** /**
* Populate the FRAG_ATTRIB_COL0 array. * Populate the VARYING_SLOT_COL0 array.
*/ */
static inline void static inline void
interpolate_float_colors(SWspan *span) interpolate_float_colors(SWspan *span)
{ {
GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*col0)[4] = span->array->attribs[VARYING_SLOT_COL0];
const GLuint n = span->end; const GLuint n = span->end;
GLuint i; GLuint i;
assert(!(span->arrayAttribs & FRAG_BIT_COL0)); assert(!(span->arrayAttribs & VARYING_BIT_COL0));
if (span->arrayMask & SPAN_RGBA) { if (span->arrayMask & SPAN_RGBA) {
/* convert array of int colors */ /* convert array of int colors */
@ -367,7 +367,7 @@ interpolate_float_colors(SWspan *span)
} }
} }
span->arrayAttribs |= FRAG_BIT_COL0; span->arrayAttribs |= VARYING_BIT_COL0;
span->array->ChanType = GL_FLOAT; span->array->ChanType = GL_FLOAT;
} }
@ -456,7 +456,7 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
/** /**
* Fill in the span.array->attrib[FRAG_ATTRIB_TEXn] arrays from the * Fill in the span.array->attrib[VARYING_SLOT_TEXn] arrays from the
* using the attrStart/Step values. * using the attrStart/Step values.
* *
* This function only used during fixed-function fragment processing. * This function only used during fixed-function fragment processing.
@ -476,7 +476,7 @@ interpolate_texcoords(struct gl_context *ctx, SWspan *span)
/* XXX CoordUnits vs. ImageUnits */ /* XXX CoordUnits vs. ImageUnits */
for (u = 0; u < maxUnit; u++) { for (u = 0; u < maxUnit; u++) {
if (ctx->Texture._EnabledCoordUnits & (1 << u)) { if (ctx->Texture._EnabledCoordUnits & (1 << u)) {
const GLuint attr = FRAG_ATTRIB_TEX0 + u; const GLuint attr = VARYING_SLOT_TEX0 + u;
const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
GLfloat texW, texH; GLfloat texW, texH;
GLboolean needLambda; GLboolean needLambda;
@ -524,8 +524,8 @@ interpolate_texcoords(struct gl_context *ctx, SWspan *span)
if (_swrast_use_fragment_program(ctx) if (_swrast_use_fragment_program(ctx)
|| ctx->ATIFragmentShader._Enabled) { || ctx->ATIFragmentShader._Enabled) {
/* do perspective correction but don't divide s, t, r by q */ /* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; const GLfloat dwdx = span->attrStepX[VARYING_SLOT_POS][3];
GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3] + span->leftClip * dwdx; GLfloat w = span->attrStart[VARYING_SLOT_POS][3] + span->leftClip * dwdx;
for (i = 0; i < span->end; i++) { for (i = 0; i < span->end; i++) {
const GLfloat invW = 1.0F / w; const GLfloat invW = 1.0F / w;
texcoord[i][0] = s * invW; texcoord[i][0] = s * invW;
@ -565,8 +565,8 @@ interpolate_texcoords(struct gl_context *ctx, SWspan *span)
if (_swrast_use_fragment_program(ctx) || if (_swrast_use_fragment_program(ctx) ||
ctx->ATIFragmentShader._Enabled) { ctx->ATIFragmentShader._Enabled) {
/* do perspective correction but don't divide s, t, r by q */ /* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3]; const GLfloat dwdx = span->attrStepX[VARYING_SLOT_POS][3];
GLfloat w = span->attrStart[FRAG_ATTRIB_WPOS][3] + span->leftClip * dwdx; GLfloat w = span->attrStart[VARYING_SLOT_POS][3] + span->leftClip * dwdx;
for (i = 0; i < span->end; i++) { for (i = 0; i < span->end; i++) {
const GLfloat invW = 1.0F / w; const GLfloat invW = 1.0F / w;
texcoord[i][0] = s * invW; texcoord[i][0] = s * invW;
@ -616,12 +616,12 @@ interpolate_texcoords(struct gl_context *ctx, SWspan *span)
/** /**
* Fill in the arrays->attribs[FRAG_ATTRIB_WPOS] array. * Fill in the arrays->attribs[VARYING_SLOT_POS] array.
*/ */
static inline void static inline void
interpolate_wpos(struct gl_context *ctx, SWspan *span) interpolate_wpos(struct gl_context *ctx, SWspan *span)
{ {
GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS]; GLfloat (*wpos)[4] = span->array->attribs[VARYING_SLOT_POS];
GLuint i; GLuint i;
const GLfloat zScale = 1.0F / ctx->DrawBuffer->_DepthMaxF; const GLfloat zScale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
GLfloat w, dw; GLfloat w, dw;
@ -639,8 +639,8 @@ interpolate_wpos(struct gl_context *ctx, SWspan *span)
} }
} }
dw = span->attrStepX[FRAG_ATTRIB_WPOS][3]; dw = span->attrStepX[VARYING_SLOT_POS][3];
w = span->attrStart[FRAG_ATTRIB_WPOS][3] + span->leftClip * dw; w = span->attrStart[VARYING_SLOT_POS][3] + span->leftClip * dw;
for (i = 0; i < span->end; i++) { for (i = 0; i < span->end; i++) {
wpos[i][2] = (GLfloat) span->array->z[i] * zScale; wpos[i][2] = (GLfloat) span->array->z[i] * zScale;
wpos[i][3] = w; wpos[i][3] = w;
@ -764,7 +764,7 @@ clip_span( struct gl_context *ctx, SWspan *span )
* fragment attributes. * fragment attributes.
* For arrays of values, shift them left. * For arrays of values, shift them left.
*/ */
for (i = 0; i < FRAG_ATTRIB_MAX; i++) { for (i = 0; i < VARYING_SLOT_MAX; i++) {
if (span->interpMask & (1 << i)) { if (span->interpMask & (1 << i)) {
GLuint j; GLuint j;
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
@ -785,7 +785,7 @@ clip_span( struct gl_context *ctx, SWspan *span )
#define SHIFT_ARRAY(ARRAY, SHIFT, LEN) \ #define SHIFT_ARRAY(ARRAY, SHIFT, LEN) \
memmove(ARRAY, ARRAY + (SHIFT), (LEN) * sizeof(ARRAY[0])) memmove(ARRAY, ARRAY + (SHIFT), (LEN) * sizeof(ARRAY[0]))
for (i = 0; i < FRAG_ATTRIB_MAX; i++) { for (i = 0; i < VARYING_SLOT_MAX; i++) {
if (span->arrayAttribs & (1 << i)) { if (span->arrayAttribs & (1 << i)) {
/* shift array elements left by 'leftClip' */ /* shift array elements left by 'leftClip' */
SHIFT_ARRAY(span->array->attribs[i], leftClip, n - leftClip); SHIFT_ARRAY(span->array->attribs[i], leftClip, n - leftClip);
@ -825,41 +825,41 @@ clip_span( struct gl_context *ctx, SWspan *span )
/** /**
* Add specular colors to primary colors. * Add specular colors to primary colors.
* Only called during fixed-function operation. * Only called during fixed-function operation.
* Result is float color array (FRAG_ATTRIB_COL0). * Result is float color array (VARYING_SLOT_COL0).
*/ */
static inline void static inline void
add_specular(struct gl_context *ctx, SWspan *span) add_specular(struct gl_context *ctx, SWspan *span)
{ {
const SWcontext *swrast = SWRAST_CONTEXT(ctx); const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLubyte *mask = span->array->mask; const GLubyte *mask = span->array->mask;
GLfloat (*col0)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*col0)[4] = span->array->attribs[VARYING_SLOT_COL0];
GLfloat (*col1)[4] = span->array->attribs[FRAG_ATTRIB_COL1]; GLfloat (*col1)[4] = span->array->attribs[VARYING_SLOT_COL1];
GLuint i; GLuint i;
ASSERT(!_swrast_use_fragment_program(ctx)); ASSERT(!_swrast_use_fragment_program(ctx));
ASSERT(span->arrayMask & SPAN_RGBA); ASSERT(span->arrayMask & SPAN_RGBA);
ASSERT(swrast->_ActiveAttribMask & FRAG_BIT_COL1); ASSERT(swrast->_ActiveAttribMask & VARYING_BIT_COL1);
(void) swrast; /* silence warning */ (void) swrast; /* silence warning */
if (span->array->ChanType == GL_FLOAT) { if (span->array->ChanType == GL_FLOAT) {
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { if ((span->arrayAttribs & VARYING_BIT_COL0) == 0) {
interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); interpolate_active_attribs(ctx, span, VARYING_BIT_COL0);
} }
} }
else { else {
/* need float colors */ /* need float colors */
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { if ((span->arrayAttribs & VARYING_BIT_COL0) == 0) {
interpolate_float_colors(span); interpolate_float_colors(span);
} }
} }
if ((span->arrayAttribs & FRAG_BIT_COL1) == 0) { if ((span->arrayAttribs & VARYING_BIT_COL1) == 0) {
/* XXX could avoid this and interpolate COL1 in the loop below */ /* XXX could avoid this and interpolate COL1 in the loop below */
interpolate_active_attribs(ctx, span, FRAG_BIT_COL1); interpolate_active_attribs(ctx, span, VARYING_BIT_COL1);
} }
ASSERT(span->arrayAttribs & FRAG_BIT_COL0); ASSERT(span->arrayAttribs & VARYING_BIT_COL0);
ASSERT(span->arrayAttribs & FRAG_BIT_COL1); ASSERT(span->arrayAttribs & VARYING_BIT_COL1);
for (i = 0; i < span->end; i++) { for (i = 0; i < span->end; i++) {
if (mask[i]) { if (mask[i]) {
@ -898,7 +898,7 @@ apply_aa_coverage(SWspan *span)
} }
} }
else { else {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
for (i = 0; i < span->end; i++) { for (i = 0; i < span->end; i++) {
rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i]; rgba[i][ACOMP] = rgba[i][ACOMP] * coverage[i];
/* clamp later */ /* clamp later */
@ -913,7 +913,7 @@ apply_aa_coverage(SWspan *span)
static inline void static inline void
clamp_colors(SWspan *span) clamp_colors(SWspan *span)
{ {
GLfloat (*rgba)[4] = span->array->attribs[FRAG_ATTRIB_COL0]; GLfloat (*rgba)[4] = span->array->attribs[VARYING_SLOT_COL0];
GLuint i; GLuint i;
ASSERT(span->array->ChanType == GL_FLOAT); ASSERT(span->array->ChanType == GL_FLOAT);
for (i = 0; i < span->end; i++) { for (i = 0; i < span->end; i++) {
@ -937,7 +937,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
GLvoid *src, *dst; GLvoid *src, *dst;
if (output > 0 || span->array->ChanType == GL_FLOAT) { if (output > 0 || span->array->ChanType == GL_FLOAT) {
src = span->array->attribs[FRAG_ATTRIB_COL0 + output]; src = span->array->attribs[VARYING_SLOT_COL0 + output];
span->array->ChanType = GL_FLOAT; span->array->ChanType = GL_FLOAT;
} }
else if (span->array->ChanType == GL_UNSIGNED_BYTE) { else if (span->array->ChanType == GL_UNSIGNED_BYTE) {
@ -955,7 +955,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
dst = span->array->rgba16; dst = span->array->rgba16;
} }
else { else {
dst = span->array->attribs[FRAG_ATTRIB_COL0]; dst = span->array->attribs[VARYING_SLOT_COL0];
} }
_mesa_convert_colors(span->array->ChanType, src, _mesa_convert_colors(span->array->ChanType, src,
@ -981,7 +981,7 @@ shade_texture_span(struct gl_context *ctx, SWspan *span)
convert_color_type(span, GL_FLOAT, 0); convert_color_type(span, GL_FLOAT, 0);
} }
else { else {
span->array->rgba = (void *) span->array->attribs[FRAG_ATTRIB_COL0]; span->array->rgba = (void *) span->array->attribs[VARYING_SLOT_COL0];
} }
if (span->primitive != GL_POINT || if (span->primitive != GL_POINT ||
@ -996,7 +996,7 @@ shade_texture_span(struct gl_context *ctx, SWspan *span)
_swrast_span_interpolate_z (ctx, span); _swrast_span_interpolate_z (ctx, span);
#if 0 #if 0
if (inputsRead & FRAG_BIT_WPOS) if (inputsRead & VARYING_BIT_POS)
#else #else
/* XXX always interpolate wpos so that DDX/DDY work */ /* XXX always interpolate wpos so that DDX/DDY work */
#endif #endif
@ -1015,14 +1015,14 @@ shade_texture_span(struct gl_context *ctx, SWspan *span)
/* conventional texturing */ /* conventional texturing */
#if CHAN_BITS == 32 #if CHAN_BITS == 32
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { if ((span->arrayAttribs & VARYING_BIT_COL0) == 0) {
interpolate_int_colors(ctx, span); interpolate_int_colors(ctx, span);
} }
#else #else
if (!(span->arrayMask & SPAN_RGBA)) if (!(span->arrayMask & SPAN_RGBA))
interpolate_int_colors(ctx, span); interpolate_int_colors(ctx, span);
#endif #endif
if ((span->arrayAttribs & FRAG_BITS_TEX_ANY) == 0x0) if ((span->arrayAttribs & VARYING_BITS_TEX_ANY) == 0x0)
interpolate_texcoords(ctx, span); interpolate_texcoords(ctx, span);
_swrast_texture_span(ctx, span); _swrast_texture_span(ctx, span);
@ -1262,8 +1262,8 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
} }
#if CHAN_BITS == 32 #if CHAN_BITS == 32
if ((span->arrayAttribs & FRAG_BIT_COL0) == 0) { if ((span->arrayAttribs & VARYING_BIT_COL0) == 0) {
interpolate_active_attribs(ctx, span, FRAG_BIT_COL0); interpolate_active_attribs(ctx, span, VARYING_BIT_COL0);
} }
#else #else
if ((span->arrayMask & SPAN_RGBA) == 0) { if ((span->arrayMask & SPAN_RGBA) == 0) {
@ -1339,7 +1339,7 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
} }
else { else {
span->array->rgba = (void *) span->array->rgba = (void *)
span->array->attribs[FRAG_ATTRIB_COL0]; span->array->attribs[VARYING_SLOT_COL0];
} }
} }
@ -1574,7 +1574,7 @@ _swrast_get_dest_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
void *rbPixels; void *rbPixels;
/* Point rbPixels to a temporary space */ /* Point rbPixels to a temporary space */
rbPixels = span->array->attribs[FRAG_ATTRIB_MAX - 1]; rbPixels = span->array->attribs[VARYING_SLOT_MAX - 1];
/* Get destination values from renderbuffer */ /* Get destination values from renderbuffer */
if (span->arrayMask & SPAN_XY) { if (span->arrayMask & SPAN_XY) {

View file

@ -68,11 +68,11 @@ struct gl_renderbuffer;
*/ */
typedef struct sw_span_arrays typedef struct sw_span_arrays
{ {
/** Per-fragment attributes (indexed by FRAG_ATTRIB_* tokens) */ /** Per-fragment attributes (indexed by VARYING_SLOT_* tokens) */
/* XXX someday look at transposing first two indexes for better memory /* XXX someday look at transposing first two indexes for better memory
* access pattern. * access pattern.
*/ */
GLfloat attribs[FRAG_ATTRIB_MAX][SWRAST_MAX_WIDTH][4]; GLfloat attribs[VARYING_SLOT_MAX][SWRAST_MAX_WIDTH][4];
/** This mask indicates which fragments are alive or culled */ /** This mask indicates which fragments are alive or culled */
GLubyte mask[SWRAST_MAX_WIDTH]; GLubyte mask[SWRAST_MAX_WIDTH];
@ -133,9 +133,9 @@ typedef struct sw_span
GLbitfield interpMask; GLbitfield interpMask;
/** Fragment attribute interpolants */ /** Fragment attribute interpolants */
GLfloat attrStart[FRAG_ATTRIB_MAX][4]; /**< initial value */ GLfloat attrStart[VARYING_SLOT_MAX][4]; /**< initial value */
GLfloat attrStepX[FRAG_ATTRIB_MAX][4]; /**< dvalue/dx */ GLfloat attrStepX[VARYING_SLOT_MAX][4]; /**< dvalue/dx */
GLfloat attrStepY[FRAG_ATTRIB_MAX][4]; /**< dvalue/dy */ GLfloat attrStepY[VARYING_SLOT_MAX][4]; /**< dvalue/dy */
/* XXX the rest of these will go away eventually... */ /* XXX the rest of these will go away eventually... */
@ -156,7 +156,7 @@ typedef struct sw_span
*/ */
GLbitfield arrayMask; GLbitfield arrayMask;
/** Mask of FRAG_BIT_x bits */ /** Mask of VARYING_BIT_x bits */
GLbitfield64 arrayAttribs; GLbitfield64 arrayAttribs;
/** /**

View file

@ -648,9 +648,9 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
if (texUnit->_ReallyEnabled && if (texUnit->_ReallyEnabled &&
texUnit->_CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) { texUnit->_CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) {
const GLfloat (*texcoords)[4] = (const GLfloat (*)[4]) const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
span->array->attribs[FRAG_ATTRIB_TEX0 + unit]; span->array->attribs[VARYING_SLOT_TEX0 + unit];
float4_array targetcoords = float4_array targetcoords =
span->array->attribs[FRAG_ATTRIB_TEX0 + span->array->attribs[VARYING_SLOT_TEX0 +
ctx->Texture.Unit[unit].BumpTarget - GL_TEXTURE0]; ctx->Texture.Unit[unit].BumpTarget - GL_TEXTURE0];
const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit); const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit);
@ -714,7 +714,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
if (texUnit->_ReallyEnabled && if (texUnit->_ReallyEnabled &&
texUnit->_CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) { texUnit->_CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) {
const GLfloat (*texcoords)[4] = (const GLfloat (*)[4]) const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
span->array->attribs[FRAG_ATTRIB_TEX0 + unit]; span->array->attribs[VARYING_SLOT_TEX0 + unit];
const struct gl_texture_object *curObj = texUnit->_Current; const struct gl_texture_object *curObj = texUnit->_Current;
const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit); const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit);
GLfloat *lambda = span->array->lambda[unit]; GLfloat *lambda = span->array->lambda[unit];

View file

@ -1880,7 +1880,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx,
* from the context list of available texture objects. * from the context list of available texture objects.
*/ */
const GLuint u = texture_unit_index(ctx, tObj); const GLuint u = texture_unit_index(ctx, tObj);
const GLuint attr = FRAG_ATTRIB_TEX0 + u; const GLuint attr = VARYING_SLOT_TEX0 + u;
GLfloat texW, texH; GLfloat texW, texH;
const GLfloat dsdx = span->attrStepX[attr][0]; const GLfloat dsdx = span->attrStepX[attr][0];

View file

@ -57,10 +57,10 @@ _swrast_culltriangle( struct gl_context *ctx,
const SWvertex *v2 ) const SWvertex *v2 )
{ {
SWcontext *swrast = SWRAST_CONTEXT(ctx); SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLfloat ex = v1->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0]; GLfloat ex = v1->attrib[VARYING_SLOT_POS][0] - v0->attrib[VARYING_SLOT_POS][0];
GLfloat ey = v1->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat ey = v1->attrib[VARYING_SLOT_POS][1] - v0->attrib[VARYING_SLOT_POS][1];
GLfloat fx = v2->attrib[FRAG_ATTRIB_WPOS][0] - v0->attrib[FRAG_ATTRIB_WPOS][0]; GLfloat fx = v2->attrib[VARYING_SLOT_POS][0] - v0->attrib[VARYING_SLOT_POS][0];
GLfloat fy = v2->attrib[FRAG_ATTRIB_WPOS][1] - v0->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat fy = v2->attrib[VARYING_SLOT_POS][1] - v0->attrib[VARYING_SLOT_POS][1];
GLfloat c = ex*fy-ey*fx; GLfloat c = ex*fy-ey*fx;
if (c * swrast->_BackfaceSign * swrast->_BackfaceCullSign <= 0.0F) if (c * swrast->_BackfaceSign * swrast->_BackfaceCullSign <= 0.0F)
@ -678,13 +678,13 @@ fast_persp_span(struct gl_context *ctx, SWspan *span,
const GLuint texEnableSave = ctx->Texture._EnabledCoordUnits; const GLuint texEnableSave = ctx->Texture._EnabledCoordUnits;
ctx->Texture._EnabledCoordUnits = 0; ctx->Texture._EnabledCoordUnits = 0;
tex_coord[0] = span->attrStart[FRAG_ATTRIB_TEX0][0] * (info->smask + 1); tex_coord[0] = span->attrStart[VARYING_SLOT_TEX0][0] * (info->smask + 1);
tex_step[0] = span->attrStepX[FRAG_ATTRIB_TEX0][0] * (info->smask + 1); tex_step[0] = span->attrStepX[VARYING_SLOT_TEX0][0] * (info->smask + 1);
tex_coord[1] = span->attrStart[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1); tex_coord[1] = span->attrStart[VARYING_SLOT_TEX0][1] * (info->tmask + 1);
tex_step[1] = span->attrStepX[FRAG_ATTRIB_TEX0][1] * (info->tmask + 1); tex_step[1] = span->attrStepX[VARYING_SLOT_TEX0][1] * (info->tmask + 1);
/* span->attrStart[FRAG_ATTRIB_TEX0][2] only if 3D-texturing, here only 2D */ /* span->attrStart[VARYING_SLOT_TEX0][2] only if 3D-texturing, here only 2D */
tex_coord[2] = span->attrStart[FRAG_ATTRIB_TEX0][3]; tex_coord[2] = span->attrStart[VARYING_SLOT_TEX0][3];
tex_step[2] = span->attrStepX[FRAG_ATTRIB_TEX0][3]; tex_step[2] = span->attrStepX[VARYING_SLOT_TEX0][3];
switch (info->filter) { switch (info->filter) {
case GL_NEAREST: case GL_NEAREST:
@ -939,23 +939,23 @@ _swrast_add_spec_terms_triangle(struct gl_context *ctx, const SWvertex *v0,
COPY_CHAN4( cSave[1], ncv1->color ); COPY_CHAN4( cSave[1], ncv1->color );
COPY_CHAN4( cSave[2], ncv2->color ); COPY_CHAN4( cSave[2], ncv2->color );
/* sum v0 */ /* sum v0 */
rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0]; rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[VARYING_SLOT_COL1][0];
gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1]; gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[VARYING_SLOT_COL1][1];
bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[FRAG_ATTRIB_COL1][2]; bSum = CHAN_TO_FLOAT(ncv0->color[2]) + ncv0->attrib[VARYING_SLOT_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum); UNCLAMPED_FLOAT_TO_CHAN(ncv0->color[2], bSum);
/* sum v1 */ /* sum v1 */
rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[FRAG_ATTRIB_COL1][0]; rSum = CHAN_TO_FLOAT(ncv1->color[0]) + ncv1->attrib[VARYING_SLOT_COL1][0];
gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[FRAG_ATTRIB_COL1][1]; gSum = CHAN_TO_FLOAT(ncv1->color[1]) + ncv1->attrib[VARYING_SLOT_COL1][1];
bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[FRAG_ATTRIB_COL1][2]; bSum = CHAN_TO_FLOAT(ncv1->color[2]) + ncv1->attrib[VARYING_SLOT_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum); UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum); UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum); UNCLAMPED_FLOAT_TO_CHAN(ncv1->color[2], bSum);
/* sum v2 */ /* sum v2 */
rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[FRAG_ATTRIB_COL1][0]; rSum = CHAN_TO_FLOAT(ncv2->color[0]) + ncv2->attrib[VARYING_SLOT_COL1][0];
gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[FRAG_ATTRIB_COL1][1]; gSum = CHAN_TO_FLOAT(ncv2->color[1]) + ncv2->attrib[VARYING_SLOT_COL1][1];
bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[FRAG_ATTRIB_COL1][2]; bSum = CHAN_TO_FLOAT(ncv2->color[2]) + ncv2->attrib[VARYING_SLOT_COL1][2];
UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum); UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[0], rSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum); UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[1], gSum);
UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum); UNCLAMPED_FLOAT_TO_CHAN(ncv2->color[2], bSum);

View file

@ -153,26 +153,26 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
/* /*
printf("%s()\n", __FUNCTION__); printf("%s()\n", __FUNCTION__);
printf(" %g, %g, %g\n", printf(" %g, %g, %g\n",
v0->attrib[FRAG_ATTRIB_WPOS][0], v0->attrib[VARYING_SLOT_POS][0],
v0->attrib[FRAG_ATTRIB_WPOS][1], v0->attrib[VARYING_SLOT_POS][1],
v0->attrib[FRAG_ATTRIB_WPOS][2]); v0->attrib[VARYING_SLOT_POS][2]);
printf(" %g, %g, %g\n", printf(" %g, %g, %g\n",
v1->attrib[FRAG_ATTRIB_WPOS][0], v1->attrib[VARYING_SLOT_POS][0],
v1->attrib[FRAG_ATTRIB_WPOS][1], v1->attrib[VARYING_SLOT_POS][1],
v1->attrib[FRAG_ATTRIB_WPOS][2]); v1->attrib[VARYING_SLOT_POS][2]);
printf(" %g, %g, %g\n", printf(" %g, %g, %g\n",
v2->attrib[FRAG_ATTRIB_WPOS][0], v2->attrib[VARYING_SLOT_POS][0],
v2->attrib[FRAG_ATTRIB_WPOS][1], v2->attrib[VARYING_SLOT_POS][1],
v2->attrib[FRAG_ATTRIB_WPOS][2]); v2->attrib[VARYING_SLOT_POS][2]);
*/ */
/* Compute fixed point x,y coords w/ half-pixel offsets and snapping. /* Compute fixed point x,y coords w/ half-pixel offsets and snapping.
* And find the order of the 3 vertices along the Y axis. * And find the order of the 3 vertices along the Y axis.
*/ */
{ {
const GLfixed fy0 = FloatToFixed(v0->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; const GLfixed fy0 = FloatToFixed(v0->attrib[VARYING_SLOT_POS][1] - 0.5F) & snapMask;
const GLfixed fy1 = FloatToFixed(v1->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; const GLfixed fy1 = FloatToFixed(v1->attrib[VARYING_SLOT_POS][1] - 0.5F) & snapMask;
const GLfixed fy2 = FloatToFixed(v2->attrib[FRAG_ATTRIB_WPOS][1] - 0.5F) & snapMask; const GLfixed fy2 = FloatToFixed(v2->attrib[VARYING_SLOT_POS][1] - 0.5F) & snapMask;
if (fy0 <= fy1) { if (fy0 <= fy1) {
if (fy1 <= fy2) { if (fy1 <= fy2) {
/* y0 <= y1 <= y2 */ /* y0 <= y1 <= y2 */
@ -212,9 +212,9 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
} }
/* fixed point X coords */ /* fixed point X coords */
vMin_fx = FloatToFixed(vMin->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; vMin_fx = FloatToFixed(vMin->attrib[VARYING_SLOT_POS][0] + 0.5F) & snapMask;
vMid_fx = FloatToFixed(vMid->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; vMid_fx = FloatToFixed(vMid->attrib[VARYING_SLOT_POS][0] + 0.5F) & snapMask;
vMax_fx = FloatToFixed(vMax->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F) & snapMask; vMax_fx = FloatToFixed(vMax->attrib[VARYING_SLOT_POS][0] + 0.5F) & snapMask;
} }
/* vertex/edge relationship */ /* vertex/edge relationship */
@ -333,22 +333,22 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
#ifdef INTERP_Z #ifdef INTERP_Z
span.interpMask |= SPAN_Z; span.interpMask |= SPAN_Z;
{ {
GLfloat eMaj_dz = vMax->attrib[FRAG_ATTRIB_WPOS][2] - vMin->attrib[FRAG_ATTRIB_WPOS][2]; GLfloat eMaj_dz = vMax->attrib[VARYING_SLOT_POS][2] - vMin->attrib[VARYING_SLOT_POS][2];
GLfloat eBot_dz = vMid->attrib[FRAG_ATTRIB_WPOS][2] - vMin->attrib[FRAG_ATTRIB_WPOS][2]; GLfloat eBot_dz = vMid->attrib[VARYING_SLOT_POS][2] - vMin->attrib[VARYING_SLOT_POS][2];
span.attrStepX[FRAG_ATTRIB_WPOS][2] = oneOverArea * (eMaj_dz * eBot.dy - eMaj.dy * eBot_dz); span.attrStepX[VARYING_SLOT_POS][2] = oneOverArea * (eMaj_dz * eBot.dy - eMaj.dy * eBot_dz);
if (span.attrStepX[FRAG_ATTRIB_WPOS][2] > maxDepth || if (span.attrStepX[VARYING_SLOT_POS][2] > maxDepth ||
span.attrStepX[FRAG_ATTRIB_WPOS][2] < -maxDepth) { span.attrStepX[VARYING_SLOT_POS][2] < -maxDepth) {
/* probably a sliver triangle */ /* probably a sliver triangle */
span.attrStepX[FRAG_ATTRIB_WPOS][2] = 0.0; span.attrStepX[VARYING_SLOT_POS][2] = 0.0;
span.attrStepY[FRAG_ATTRIB_WPOS][2] = 0.0; span.attrStepY[VARYING_SLOT_POS][2] = 0.0;
} }
else { else {
span.attrStepY[FRAG_ATTRIB_WPOS][2] = oneOverArea * (eMaj.dx * eBot_dz - eMaj_dz * eBot.dx); span.attrStepY[VARYING_SLOT_POS][2] = oneOverArea * (eMaj.dx * eBot_dz - eMaj_dz * eBot.dx);
} }
if (depthBits <= 16) if (depthBits <= 16)
span.zStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_WPOS][2]); span.zStep = SignedFloatToFixed(span.attrStepX[VARYING_SLOT_POS][2]);
else else
span.zStep = (GLint) span.attrStepX[FRAG_ATTRIB_WPOS][2]; span.zStep = (GLint) span.attrStepX[VARYING_SLOT_POS][2];
} }
#endif #endif
#ifdef INTERP_RGB #ifdef INTERP_RGB
@ -364,61 +364,61 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
GLfloat eMaj_da = (GLfloat) (vMax->color[ACOMP] - vMin->color[ACOMP]); GLfloat eMaj_da = (GLfloat) (vMax->color[ACOMP] - vMin->color[ACOMP]);
GLfloat eBot_da = (GLfloat) (vMid->color[ACOMP] - vMin->color[ACOMP]); GLfloat eBot_da = (GLfloat) (vMid->color[ACOMP] - vMin->color[ACOMP]);
# endif # endif
span.attrStepX[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr); span.attrStepX[VARYING_SLOT_COL0][0] = oneOverArea * (eMaj_dr * eBot.dy - eMaj.dy * eBot_dr);
span.attrStepY[FRAG_ATTRIB_COL0][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx); span.attrStepY[VARYING_SLOT_COL0][0] = oneOverArea * (eMaj.dx * eBot_dr - eMaj_dr * eBot.dx);
span.attrStepX[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg); span.attrStepX[VARYING_SLOT_COL0][1] = oneOverArea * (eMaj_dg * eBot.dy - eMaj.dy * eBot_dg);
span.attrStepY[FRAG_ATTRIB_COL0][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx); span.attrStepY[VARYING_SLOT_COL0][1] = oneOverArea * (eMaj.dx * eBot_dg - eMaj_dg * eBot.dx);
span.attrStepX[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db); span.attrStepX[VARYING_SLOT_COL0][2] = oneOverArea * (eMaj_db * eBot.dy - eMaj.dy * eBot_db);
span.attrStepY[FRAG_ATTRIB_COL0][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx); span.attrStepY[VARYING_SLOT_COL0][2] = oneOverArea * (eMaj.dx * eBot_db - eMaj_db * eBot.dx);
span.redStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][0]); span.redStep = SignedFloatToFixed(span.attrStepX[VARYING_SLOT_COL0][0]);
span.greenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][1]); span.greenStep = SignedFloatToFixed(span.attrStepX[VARYING_SLOT_COL0][1]);
span.blueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][2]); span.blueStep = SignedFloatToFixed(span.attrStepX[VARYING_SLOT_COL0][2]);
# ifdef INTERP_ALPHA # ifdef INTERP_ALPHA
span.attrStepX[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da); span.attrStepX[VARYING_SLOT_COL0][3] = oneOverArea * (eMaj_da * eBot.dy - eMaj.dy * eBot_da);
span.attrStepY[FRAG_ATTRIB_COL0][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx); span.attrStepY[VARYING_SLOT_COL0][3] = oneOverArea * (eMaj.dx * eBot_da - eMaj_da * eBot.dx);
span.alphaStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL0][3]); span.alphaStep = SignedFloatToFixed(span.attrStepX[VARYING_SLOT_COL0][3]);
# endif /* INTERP_ALPHA */ # endif /* INTERP_ALPHA */
} }
else { else {
ASSERT(ctx->Light.ShadeModel == GL_FLAT); ASSERT(ctx->Light.ShadeModel == GL_FLAT);
span.interpMask |= SPAN_FLAT; span.interpMask |= SPAN_FLAT;
span.attrStepX[FRAG_ATTRIB_COL0][0] = span.attrStepY[FRAG_ATTRIB_COL0][0] = 0.0F; span.attrStepX[VARYING_SLOT_COL0][0] = span.attrStepY[VARYING_SLOT_COL0][0] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL0][1] = span.attrStepY[FRAG_ATTRIB_COL0][1] = 0.0F; span.attrStepX[VARYING_SLOT_COL0][1] = span.attrStepY[VARYING_SLOT_COL0][1] = 0.0F;
span.attrStepX[FRAG_ATTRIB_COL0][2] = span.attrStepY[FRAG_ATTRIB_COL0][2] = 0.0F; span.attrStepX[VARYING_SLOT_COL0][2] = span.attrStepY[VARYING_SLOT_COL0][2] = 0.0F;
span.redStep = 0; span.redStep = 0;
span.greenStep = 0; span.greenStep = 0;
span.blueStep = 0; span.blueStep = 0;
# ifdef INTERP_ALPHA # ifdef INTERP_ALPHA
span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepY[FRAG_ATTRIB_COL0][3] = 0.0F; span.attrStepX[VARYING_SLOT_COL0][3] = span.attrStepY[VARYING_SLOT_COL0][3] = 0.0F;
span.alphaStep = 0; span.alphaStep = 0;
# endif # endif
} }
#endif /* INTERP_RGB */ #endif /* INTERP_RGB */
#ifdef INTERP_INT_TEX #ifdef INTERP_INT_TEX
{ {
GLfloat eMaj_ds = (vMax->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE; GLfloat eMaj_ds = (vMax->attrib[VARYING_SLOT_TEX0][0] - vMin->attrib[VARYING_SLOT_TEX0][0]) * S_SCALE;
GLfloat eBot_ds = (vMid->attrib[FRAG_ATTRIB_TEX0][0] - vMin->attrib[FRAG_ATTRIB_TEX0][0]) * S_SCALE; GLfloat eBot_ds = (vMid->attrib[VARYING_SLOT_TEX0][0] - vMin->attrib[VARYING_SLOT_TEX0][0]) * S_SCALE;
GLfloat eMaj_dt = (vMax->attrib[FRAG_ATTRIB_TEX0][1] - vMin->attrib[FRAG_ATTRIB_TEX0][1]) * T_SCALE; GLfloat eMaj_dt = (vMax->attrib[VARYING_SLOT_TEX0][1] - vMin->attrib[VARYING_SLOT_TEX0][1]) * T_SCALE;
GLfloat eBot_dt = (vMid->attrib[FRAG_ATTRIB_TEX0][1] - vMin->attrib[FRAG_ATTRIB_TEX0][1]) * T_SCALE; GLfloat eBot_dt = (vMid->attrib[VARYING_SLOT_TEX0][1] - vMin->attrib[VARYING_SLOT_TEX0][1]) * T_SCALE;
span.attrStepX[FRAG_ATTRIB_TEX0][0] = oneOverArea * (eMaj_ds * eBot.dy - eMaj.dy * eBot_ds); span.attrStepX[VARYING_SLOT_TEX0][0] = oneOverArea * (eMaj_ds * eBot.dy - eMaj.dy * eBot_ds);
span.attrStepY[FRAG_ATTRIB_TEX0][0] = oneOverArea * (eMaj.dx * eBot_ds - eMaj_ds * eBot.dx); span.attrStepY[VARYING_SLOT_TEX0][0] = oneOverArea * (eMaj.dx * eBot_ds - eMaj_ds * eBot.dx);
span.attrStepX[FRAG_ATTRIB_TEX0][1] = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt); span.attrStepX[VARYING_SLOT_TEX0][1] = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt);
span.attrStepY[FRAG_ATTRIB_TEX0][1] = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx); span.attrStepY[VARYING_SLOT_TEX0][1] = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx);
span.intTexStep[0] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][0]); span.intTexStep[0] = SignedFloatToFixed(span.attrStepX[VARYING_SLOT_TEX0][0]);
span.intTexStep[1] = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_TEX0][1]); span.intTexStep[1] = SignedFloatToFixed(span.attrStepX[VARYING_SLOT_TEX0][1]);
} }
#endif #endif
#ifdef INTERP_ATTRIBS #ifdef INTERP_ATTRIBS
{ {
/* attrib[FRAG_ATTRIB_WPOS][3] is 1/W */ /* attrib[VARYING_SLOT_POS][3] is 1/W */
const GLfloat wMax = vMax->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat wMax = vMax->attrib[VARYING_SLOT_POS][3];
const GLfloat wMin = vMin->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat wMin = vMin->attrib[VARYING_SLOT_POS][3];
const GLfloat wMid = vMid->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat wMid = vMid->attrib[VARYING_SLOT_POS][3];
{ {
const GLfloat eMaj_dw = wMax - wMin; const GLfloat eMaj_dw = wMax - wMin;
const GLfloat eBot_dw = wMid - wMin; const GLfloat eBot_dw = wMid - wMin;
span.attrStepX[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj_dw * eBot.dy - eMaj.dy * eBot_dw); span.attrStepX[VARYING_SLOT_POS][3] = oneOverArea * (eMaj_dw * eBot.dy - eMaj.dy * eBot_dw);
span.attrStepY[FRAG_ATTRIB_WPOS][3] = oneOverArea * (eMaj.dx * eBot_dw - eMaj_dw * eBot.dx); span.attrStepY[VARYING_SLOT_POS][3] = oneOverArea * (eMaj.dx * eBot_dw - eMaj_dw * eBot.dx);
} }
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
if (swrast->_InterpMode[attr] == GL_FLAT) { if (swrast->_InterpMode[attr] == GL_FLAT) {
@ -518,8 +518,8 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
#endif #endif
#ifdef INTERP_ATTRIBS #ifdef INTERP_ATTRIBS
GLfloat wLeft = 0, dwOuter = 0, dwInner; GLfloat wLeft = 0, dwOuter = 0, dwInner;
GLfloat attrLeft[FRAG_ATTRIB_MAX][4]; GLfloat attrLeft[VARYING_SLOT_MAX][4];
GLfloat daOuter[FRAG_ATTRIB_MAX][4], daInner[FRAG_ATTRIB_MAX][4]; GLfloat daOuter[VARYING_SLOT_MAX][4], daInner[VARYING_SLOT_MAX][4];
#endif #endif
for (subTriangle=0; subTriangle<=1; subTriangle++) { for (subTriangle=0; subTriangle<=1; subTriangle++) {
@ -609,25 +609,25 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
#ifdef INTERP_Z #ifdef INTERP_Z
{ {
GLfloat z0 = vLower->attrib[FRAG_ATTRIB_WPOS][2]; GLfloat z0 = vLower->attrib[VARYING_SLOT_POS][2];
if (depthBits <= 16) { if (depthBits <= 16) {
/* interpolate fixed-pt values */ /* interpolate fixed-pt values */
GLfloat tmp = (z0 * FIXED_SCALE GLfloat tmp = (z0 * FIXED_SCALE
+ span.attrStepX[FRAG_ATTRIB_WPOS][2] * adjx + span.attrStepX[VARYING_SLOT_POS][2] * adjx
+ span.attrStepY[FRAG_ATTRIB_WPOS][2] * adjy) + FIXED_HALF; + span.attrStepY[VARYING_SLOT_POS][2] * adjy) + FIXED_HALF;
if (tmp < MAX_GLUINT / 2) if (tmp < MAX_GLUINT / 2)
zLeft = (GLfixed) tmp; zLeft = (GLfixed) tmp;
else else
zLeft = MAX_GLUINT / 2; zLeft = MAX_GLUINT / 2;
fdzOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_WPOS][2] + fdzOuter = SignedFloatToFixed(span.attrStepY[VARYING_SLOT_POS][2] +
dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); dxOuter * span.attrStepX[VARYING_SLOT_POS][2]);
} }
else { else {
/* interpolate depth values w/out scaling */ /* interpolate depth values w/out scaling */
zLeft = (GLuint) (z0 + span.attrStepX[FRAG_ATTRIB_WPOS][2] * FixedToFloat(adjx) zLeft = (GLuint) (z0 + span.attrStepX[VARYING_SLOT_POS][2] * FixedToFloat(adjx)
+ span.attrStepY[FRAG_ATTRIB_WPOS][2] * FixedToFloat(adjy)); + span.attrStepY[VARYING_SLOT_POS][2] * FixedToFloat(adjy));
fdzOuter = (GLint) (span.attrStepY[FRAG_ATTRIB_WPOS][2] + fdzOuter = (GLint) (span.attrStepY[VARYING_SLOT_POS][2] +
dxOuter * span.attrStepX[FRAG_ATTRIB_WPOS][2]); dxOuter * span.attrStepX[VARYING_SLOT_POS][2]);
} }
# ifdef DEPTH_TYPE # ifdef DEPTH_TYPE
zRow = (DEPTH_TYPE *) zRow = (DEPTH_TYPE *)
@ -639,26 +639,26 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
#ifdef INTERP_RGB #ifdef INTERP_RGB
if (ctx->Light.ShadeModel == GL_SMOOTH) { if (ctx->Light.ShadeModel == GL_SMOOTH) {
rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP]) rLeft = (GLint)(ChanToFixed(vLower->color[RCOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][0] * adjx + span.attrStepX[VARYING_SLOT_COL0][0] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][0] * adjy) + FIXED_HALF; + span.attrStepY[VARYING_SLOT_COL0][0] * adjy) + FIXED_HALF;
gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP]) gLeft = (GLint)(ChanToFixed(vLower->color[GCOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][1] * adjx + span.attrStepX[VARYING_SLOT_COL0][1] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][1] * adjy) + FIXED_HALF; + span.attrStepY[VARYING_SLOT_COL0][1] * adjy) + FIXED_HALF;
bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP]) bLeft = (GLint)(ChanToFixed(vLower->color[BCOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][2] * adjx + span.attrStepX[VARYING_SLOT_COL0][2] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][2] * adjy) + FIXED_HALF; + span.attrStepY[VARYING_SLOT_COL0][2] * adjy) + FIXED_HALF;
fdrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][0] fdrOuter = SignedFloatToFixed(span.attrStepY[VARYING_SLOT_COL0][0]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][0]); + dxOuter * span.attrStepX[VARYING_SLOT_COL0][0]);
fdgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][1] fdgOuter = SignedFloatToFixed(span.attrStepY[VARYING_SLOT_COL0][1]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][1]); + dxOuter * span.attrStepX[VARYING_SLOT_COL0][1]);
fdbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][2] fdbOuter = SignedFloatToFixed(span.attrStepY[VARYING_SLOT_COL0][2]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][2]); + dxOuter * span.attrStepX[VARYING_SLOT_COL0][2]);
# ifdef INTERP_ALPHA # ifdef INTERP_ALPHA
aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP]) aLeft = (GLint)(ChanToFixed(vLower->color[ACOMP])
+ span.attrStepX[FRAG_ATTRIB_COL0][3] * adjx + span.attrStepX[VARYING_SLOT_COL0][3] * adjx
+ span.attrStepY[FRAG_ATTRIB_COL0][3] * adjy) + FIXED_HALF; + span.attrStepY[VARYING_SLOT_COL0][3] * adjy) + FIXED_HALF;
fdaOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL0][3] fdaOuter = SignedFloatToFixed(span.attrStepY[VARYING_SLOT_COL0][3]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_COL0][3]); + dxOuter * span.attrStepX[VARYING_SLOT_COL0][3]);
# endif # endif
} }
else { else {
@ -678,29 +678,29 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
#ifdef INTERP_INT_TEX #ifdef INTERP_INT_TEX
{ {
GLfloat s0, t0; GLfloat s0, t0;
s0 = vLower->attrib[FRAG_ATTRIB_TEX0][0] * S_SCALE; s0 = vLower->attrib[VARYING_SLOT_TEX0][0] * S_SCALE;
sLeft = (GLfixed)(s0 * FIXED_SCALE + span.attrStepX[FRAG_ATTRIB_TEX0][0] * adjx sLeft = (GLfixed)(s0 * FIXED_SCALE + span.attrStepX[VARYING_SLOT_TEX0][0] * adjx
+ span.attrStepY[FRAG_ATTRIB_TEX0][0] * adjy) + FIXED_HALF; + span.attrStepY[VARYING_SLOT_TEX0][0] * adjy) + FIXED_HALF;
dsOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][0] dsOuter = SignedFloatToFixed(span.attrStepY[VARYING_SLOT_TEX0][0]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][0]); + dxOuter * span.attrStepX[VARYING_SLOT_TEX0][0]);
t0 = vLower->attrib[FRAG_ATTRIB_TEX0][1] * T_SCALE; t0 = vLower->attrib[VARYING_SLOT_TEX0][1] * T_SCALE;
tLeft = (GLfixed)(t0 * FIXED_SCALE + span.attrStepX[FRAG_ATTRIB_TEX0][1] * adjx tLeft = (GLfixed)(t0 * FIXED_SCALE + span.attrStepX[VARYING_SLOT_TEX0][1] * adjx
+ span.attrStepY[FRAG_ATTRIB_TEX0][1] * adjy) + FIXED_HALF; + span.attrStepY[VARYING_SLOT_TEX0][1] * adjy) + FIXED_HALF;
dtOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_TEX0][1] dtOuter = SignedFloatToFixed(span.attrStepY[VARYING_SLOT_TEX0][1]
+ dxOuter * span.attrStepX[FRAG_ATTRIB_TEX0][1]); + dxOuter * span.attrStepX[VARYING_SLOT_TEX0][1]);
} }
#endif #endif
#ifdef INTERP_ATTRIBS #ifdef INTERP_ATTRIBS
{ {
const GLuint attr = FRAG_ATTRIB_WPOS; const GLuint attr = VARYING_SLOT_POS;
wLeft = vLower->attrib[FRAG_ATTRIB_WPOS][3] wLeft = vLower->attrib[VARYING_SLOT_POS][3]
+ (span.attrStepX[attr][3] * adjx + (span.attrStepX[attr][3] * adjx
+ span.attrStepY[attr][3] * adjy) * (1.0F/FIXED_SCALE); + span.attrStepY[attr][3] * adjy) * (1.0F/FIXED_SCALE);
dwOuter = span.attrStepY[attr][3] + dxOuter * span.attrStepX[attr][3]; dwOuter = span.attrStepY[attr][3] + dxOuter * span.attrStepX[attr][3];
} }
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
const GLfloat invW = vLower->attrib[FRAG_ATTRIB_WPOS][3]; const GLfloat invW = vLower->attrib[VARYING_SLOT_POS][3];
if (swrast->_InterpMode[attr] == GL_FLAT) { if (swrast->_InterpMode[attr] == GL_FLAT) {
GLuint c; GLuint c;
for (c = 0; c < 4; c++) { for (c = 0; c < 4; c++) {
@ -755,7 +755,7 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
dtInner = dtOuter + span.intTexStep[1]; dtInner = dtOuter + span.intTexStep[1];
#endif #endif
#ifdef INTERP_ATTRIBS #ifdef INTERP_ATTRIBS
dwInner = dwOuter + span.attrStepX[FRAG_ATTRIB_WPOS][3]; dwInner = dwOuter + span.attrStepX[VARYING_SLOT_POS][3];
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
GLuint c; GLuint c;
for (c = 0; c < 4; c++) { for (c = 0; c < 4; c++) {
@ -791,7 +791,7 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0,
#endif #endif
#ifdef INTERP_ATTRIBS #ifdef INTERP_ATTRIBS
span.attrStart[FRAG_ATTRIB_WPOS][3] = wLeft; span.attrStart[VARYING_SLOT_POS][3] = wLeft;
ATTRIB_LOOP_BEGIN ATTRIB_LOOP_BEGIN
GLuint c; GLuint c;
for (c = 0; c < 4; c++) { for (c = 0; c < 4; c++) {

View file

@ -166,15 +166,15 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT) else if (zoomed.array->ChanType == GL_UNSIGNED_SHORT)
zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba16; zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->rgba16;
else else
zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[FRAG_ATTRIB_COL0]; zoomed.array->rgba = (GLchan (*)[4]) zoomed.array->attribs[VARYING_SLOT_COL0];
COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]); COPY_4V(zoomed.attrStart[VARYING_SLOT_POS], span->attrStart[VARYING_SLOT_POS]);
COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]); COPY_4V(zoomed.attrStepX[VARYING_SLOT_POS], span->attrStepX[VARYING_SLOT_POS]);
COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]); COPY_4V(zoomed.attrStepY[VARYING_SLOT_POS], span->attrStepY[VARYING_SLOT_POS]);
zoomed.attrStart[FRAG_ATTRIB_FOGC][0] = span->attrStart[FRAG_ATTRIB_FOGC][0]; zoomed.attrStart[VARYING_SLOT_FOGC][0] = span->attrStart[VARYING_SLOT_FOGC][0];
zoomed.attrStepX[FRAG_ATTRIB_FOGC][0] = span->attrStepX[FRAG_ATTRIB_FOGC][0]; zoomed.attrStepX[VARYING_SLOT_FOGC][0] = span->attrStepX[VARYING_SLOT_FOGC][0];
zoomed.attrStepY[FRAG_ATTRIB_FOGC][0] = span->attrStepY[FRAG_ATTRIB_FOGC][0]; zoomed.attrStepY[VARYING_SLOT_FOGC][0] = span->attrStepY[VARYING_SLOT_FOGC][0];
if (format == GL_RGBA || format == GL_RGB) { if (format == GL_RGBA || format == GL_RGB) {
/* copy Z info */ /* copy Z info */
@ -183,7 +183,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
/* we'll generate an array of colorss */ /* we'll generate an array of colorss */
zoomed.interpMask = span->interpMask & ~SPAN_RGBA; zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
zoomed.arrayMask |= SPAN_RGBA; zoomed.arrayMask |= SPAN_RGBA;
zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */ zoomed.arrayAttribs |= VARYING_BIT_COL0; /* we'll produce these values */
ASSERT(span->arrayMask & SPAN_RGBA); ASSERT(span->arrayMask & SPAN_RGBA);
} }
else if (format == GL_DEPTH_COMPONENT) { else if (format == GL_DEPTH_COMPONENT) {
@ -235,7 +235,7 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0); ASSERT(j >= 0);
ASSERT(j < (GLint) span->end); ASSERT(j < (GLint) span->end);
COPY_4V(zoomed.array->attribs[FRAG_ATTRIB_COL0][i], rgba[j]); COPY_4V(zoomed.array->attribs[VARYING_SLOT_COL0][i], rgba[j]);
} }
} }
} }
@ -273,10 +273,10 @@ zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x; GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0); ASSERT(j >= 0);
ASSERT(j < (GLint) span->end); ASSERT(j < (GLint) span->end);
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][0] = rgb[j][0]; zoomed.array->attribs[VARYING_SLOT_COL0][i][0] = rgb[j][0];
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][1] = rgb[j][1]; zoomed.array->attribs[VARYING_SLOT_COL0][i][1] = rgb[j][1];
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][2] = rgb[j][2]; zoomed.array->attribs[VARYING_SLOT_COL0][i][2] = rgb[j][2];
zoomed.array->attribs[FRAG_ATTRIB_COL0][i][3] = 1.0F; zoomed.array->attribs[VARYING_SLOT_COL0][i][3] = 1.0F;
} }
} }
} }

View file

@ -74,7 +74,7 @@
* improve its usefulness as a fallback mechanism for hardware * improve its usefulness as a fallback mechanism for hardware
* drivers. * drivers.
* *
* wpos = attr[FRAG_ATTRIB_WPOS] and MUST BE THE FIRST values in the * wpos = attr[VARYING_SLOT_POS] and MUST BE THE FIRST values in the
* vertex because of the tnl clipping code. * vertex because of the tnl clipping code.
* wpos[0] and [1] are the screen-coords of SWvertex. * wpos[0] and [1] are the screen-coords of SWvertex.
@ -98,13 +98,13 @@
* primitives unaccelerated), hook in swrast_setup instead. * primitives unaccelerated), hook in swrast_setup instead.
*/ */
typedef struct { typedef struct {
GLfloat attrib[FRAG_ATTRIB_MAX][4]; GLfloat attrib[VARYING_SLOT_MAX][4];
GLchan color[4]; /** integer color */ GLchan color[4]; /** integer color */
GLfloat pointSize; GLfloat pointSize;
} SWvertex; } SWvertex;
#define FRAG_ATTRIB_CI FRAG_ATTRIB_COL0 #define VARYING_SLOT_CI VARYING_SLOT_COL0
struct swrast_device_driver; struct swrast_device_driver;

View file

@ -125,22 +125,22 @@ setup_vertex_format(struct gl_context *ctx)
swsetup->intColors = intColors; swsetup->intColors = intColors;
EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[FRAG_ATTRIB_WPOS] ); EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, attrib[VARYING_SLOT_POS] );
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR0)) { if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR0)) {
if (swsetup->intColors) if (swsetup->intColors)
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );
else else
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[FRAG_ATTRIB_COL0]); EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F, attrib[VARYING_SLOT_COL0]);
} }
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) { if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_COLOR1)) {
EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[FRAG_ATTRIB_COL1]); EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4F, attrib[VARYING_SLOT_COL1]);
} }
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_FOG)) { if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_FOG)) {
const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F; const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F;
EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]); EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[VARYING_SLOT_FOGC]);
} }
if (index_bitset & BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX)) if (index_bitset & BITFIELD64_RANGE(_TNL_ATTRIB_TEX0, _TNL_NUM_TEX))
@ -148,7 +148,7 @@ setup_vertex_format(struct gl_context *ctx)
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_TEX(i))) { if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_TEX(i))) {
EMIT_ATTR( _TNL_ATTRIB_TEX(i), EMIT_4F, EMIT_ATTR( _TNL_ATTRIB_TEX(i), EMIT_4F,
attrib[FRAG_ATTRIB_TEX0 + i] ); attrib[VARYING_SLOT_TEX0 + i] );
} }
} }
} }
@ -158,7 +158,7 @@ setup_vertex_format(struct gl_context *ctx)
for (i = 0; i < ctx->Const.MaxVarying; i++) { for (i = 0; i < ctx->Const.MaxVarying; i++) {
if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_GENERIC(i))) { if (index_bitset & BITFIELD64_BIT(_TNL_ATTRIB_GENERIC(i))) {
EMIT_ATTR( _TNL_ATTRIB_GENERIC(i), VARYING_EMIT_STYLE, EMIT_ATTR( _TNL_ATTRIB_GENERIC(i), VARYING_EMIT_STYLE,
attrib[FRAG_ATTRIB_VAR0 + i] ); attrib[VARYING_SLOT_VAR0 + i] );
} }
} }
} }
@ -271,29 +271,29 @@ _swsetup_Translate( struct gl_context *ctx, const void *vertex, SWvertex *dest )
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, tmp ); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, tmp );
dest->attrib[FRAG_ATTRIB_WPOS][0] = m[0] * tmp[0] + m[12]; dest->attrib[VARYING_SLOT_POS][0] = m[0] * tmp[0] + m[12];
dest->attrib[FRAG_ATTRIB_WPOS][1] = m[5] * tmp[1] + m[13]; dest->attrib[VARYING_SLOT_POS][1] = m[5] * tmp[1] + m[13];
dest->attrib[FRAG_ATTRIB_WPOS][2] = m[10] * tmp[2] + m[14]; dest->attrib[VARYING_SLOT_POS][2] = m[10] * tmp[2] + m[14];
dest->attrib[FRAG_ATTRIB_WPOS][3] = tmp[3]; dest->attrib[VARYING_SLOT_POS][3] = tmp[3];
/** XXX try to limit these loops someday */ /** XXX try to limit these loops someday */
for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0 + i, _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0 + i,
dest->attrib[FRAG_ATTRIB_TEX0 + i] ); dest->attrib[VARYING_SLOT_TEX0 + i] );
for (i = 0 ; i < ctx->Const.MaxVarying ; i++) for (i = 0 ; i < ctx->Const.MaxVarying ; i++)
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_GENERIC0 + i, _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_GENERIC0 + i,
dest->attrib[FRAG_ATTRIB_VAR0 + i] ); dest->attrib[VARYING_SLOT_VAR0 + i] );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0,
dest->attrib[FRAG_ATTRIB_COL0] ); dest->attrib[VARYING_SLOT_COL0] );
UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1,
dest->attrib[FRAG_ATTRIB_COL1]); dest->attrib[VARYING_SLOT_COL1]);
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp ); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp );
dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0]; dest->attrib[VARYING_SLOT_FOGC][0] = tmp[0];
/* XXX See _tnl_get_attr about pointsize ... */ /* XXX See _tnl_get_attr about pointsize ... */
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp ); _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp );

View file

@ -137,21 +137,21 @@ static void _swsetup_render_tri(struct gl_context *ctx,
/* save colors/indexes for v0, v1 vertices */ /* save colors/indexes for v0, v1 vertices */
COPY_CHAN4(c[0], v0->color); COPY_CHAN4(c[0], v0->color);
COPY_CHAN4(c[1], v1->color); COPY_CHAN4(c[1], v1->color);
COPY_4V(s[0], v0->attrib[FRAG_ATTRIB_COL1]); COPY_4V(s[0], v0->attrib[VARYING_SLOT_COL1]);
COPY_4V(s[1], v1->attrib[FRAG_ATTRIB_COL1]); COPY_4V(s[1], v1->attrib[VARYING_SLOT_COL1]);
/* copy v2 color/indexes to v0, v1 indexes */ /* copy v2 color/indexes to v0, v1 indexes */
COPY_CHAN4(v0->color, v2->color); COPY_CHAN4(v0->color, v2->color);
COPY_CHAN4(v1->color, v2->color); COPY_CHAN4(v1->color, v2->color);
COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); COPY_4V(v0->attrib[VARYING_SLOT_COL1], v2->attrib[VARYING_SLOT_COL1]);
COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], v2->attrib[FRAG_ATTRIB_COL1]); COPY_4V(v1->attrib[VARYING_SLOT_COL1], v2->attrib[VARYING_SLOT_COL1]);
render(ctx, ef, e0, e1, e2, v0, v1, v2); render(ctx, ef, e0, e1, e2, v0, v1, v2);
COPY_CHAN4(v0->color, c[0]); COPY_CHAN4(v0->color, c[0]);
COPY_CHAN4(v1->color, c[1]); COPY_CHAN4(v1->color, c[1]);
COPY_4V(v0->attrib[FRAG_ATTRIB_COL1], s[0]); COPY_4V(v0->attrib[VARYING_SLOT_COL1], s[0]);
COPY_4V(v1->attrib[FRAG_ATTRIB_COL1], s[1]); COPY_4V(v1->attrib[VARYING_SLOT_COL1], s[1]);
} }
else { else {
render(ctx, ef, e0, e1, e2, v0, v1, v2); render(ctx, ef, e0, e1, e2, v0, v1, v2);

View file

@ -50,10 +50,10 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT)) if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT))
{ {
GLfloat ex = v[0]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0]; GLfloat ex = v[0]->attrib[VARYING_SLOT_POS][0] - v[2]->attrib[VARYING_SLOT_POS][0];
GLfloat ey = v[0]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat ey = v[0]->attrib[VARYING_SLOT_POS][1] - v[2]->attrib[VARYING_SLOT_POS][1];
GLfloat fx = v[1]->attrib[FRAG_ATTRIB_WPOS][0] - v[2]->attrib[FRAG_ATTRIB_WPOS][0]; GLfloat fx = v[1]->attrib[VARYING_SLOT_POS][0] - v[2]->attrib[VARYING_SLOT_POS][0];
GLfloat fy = v[1]->attrib[FRAG_ATTRIB_WPOS][1] - v[2]->attrib[FRAG_ATTRIB_WPOS][1]; GLfloat fy = v[1]->attrib[VARYING_SLOT_POS][1] - v[2]->attrib[VARYING_SLOT_POS][1];
GLfloat cc = ex*fy - ey*fx; GLfloat cc = ex*fy - ey*fx;
if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT)) if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT))
@ -74,9 +74,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
COPY_CHAN4(saved_color[2], v[2]->color); COPY_CHAN4(saved_color[2], v[2]->color);
} }
else { else {
COPY_4V(saved_col0[0], v[0]->attrib[FRAG_ATTRIB_COL0]); COPY_4V(saved_col0[0], v[0]->attrib[VARYING_SLOT_COL0]);
COPY_4V(saved_col0[1], v[1]->attrib[FRAG_ATTRIB_COL0]); COPY_4V(saved_col0[1], v[1]->attrib[VARYING_SLOT_COL0]);
COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]); COPY_4V(saved_col0[2], v[2]->attrib[VARYING_SLOT_COL0]);
} }
if (VB->BackfaceColorPtr->stride) { if (VB->BackfaceColorPtr->stride) {
@ -86,9 +86,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
SS_COLOR(v[2]->color, vbcolor[e2]); SS_COLOR(v[2]->color, vbcolor[e2]);
} }
else { else {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[e0]); COPY_4V(v[0]->attrib[VARYING_SLOT_COL0], vbcolor[e0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[e1]); COPY_4V(v[1]->attrib[VARYING_SLOT_COL0], vbcolor[e1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[e2]); COPY_4V(v[2]->attrib[VARYING_SLOT_COL0], vbcolor[e2]);
} }
} }
else { else {
@ -99,9 +99,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
SS_COLOR(v[2]->color, vbcolor[0]); SS_COLOR(v[2]->color, vbcolor[0]);
} }
else { else {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); COPY_4V(v[0]->attrib[VARYING_SLOT_COL0], vbcolor[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); COPY_4V(v[1]->attrib[VARYING_SLOT_COL0], vbcolor[0]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], vbcolor[0]); COPY_4V(v[2]->attrib[VARYING_SLOT_COL0], vbcolor[0]);
} }
} }
} }
@ -109,19 +109,19 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
if (VB->BackfaceSecondaryColorPtr) { if (VB->BackfaceSecondaryColorPtr) {
GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); COPY_4V(saved_spec[0], v[0]->attrib[VARYING_SLOT_COL1]);
COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]); COPY_4V(saved_spec[1], v[1]->attrib[VARYING_SLOT_COL1]);
COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]); COPY_4V(saved_spec[2], v[2]->attrib[VARYING_SLOT_COL1]);
if (VB->BackfaceSecondaryColorPtr->stride) { if (VB->BackfaceSecondaryColorPtr->stride) {
SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]); SS_SPEC(v[0]->attrib[VARYING_SLOT_COL1], vbspec[e0]);
SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); SS_SPEC(v[1]->attrib[VARYING_SLOT_COL1], vbspec[e1]);
SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); SS_SPEC(v[2]->attrib[VARYING_SLOT_COL1], vbspec[e2]);
} }
else { else {
SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); SS_SPEC(v[0]->attrib[VARYING_SLOT_COL1], vbspec[0]);
SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); SS_SPEC(v[1]->attrib[VARYING_SLOT_COL1], vbspec[0]);
SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[0]); SS_SPEC(v[2]->attrib[VARYING_SLOT_COL1], vbspec[0]);
} }
} }
} }
@ -131,9 +131,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
if (IND & SS_OFFSET_BIT) { if (IND & SS_OFFSET_BIT) {
const GLfloat max = ctx->DrawBuffer->_DepthMaxF; const GLfloat max = ctx->DrawBuffer->_DepthMaxF;
/* save original Z values (restored later) */ /* save original Z values (restored later) */
z[0] = v[0]->attrib[FRAG_ATTRIB_WPOS][2]; z[0] = v[0]->attrib[VARYING_SLOT_POS][2];
z[1] = v[1]->attrib[FRAG_ATTRIB_WPOS][2]; z[1] = v[1]->attrib[VARYING_SLOT_POS][2];
z[2] = v[2]->attrib[FRAG_ATTRIB_WPOS][2]; z[2] = v[2]->attrib[VARYING_SLOT_POS][2];
/* Note that Z values are already scaled to [0,65535] (for example) /* Note that Z values are already scaled to [0,65535] (for example)
* so no MRD value is used here. * so no MRD value is used here.
*/ */
@ -147,31 +147,31 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
offset += MAX2(dzdx, dzdy) * ctx->Polygon.OffsetFactor; offset += MAX2(dzdx, dzdy) * ctx->Polygon.OffsetFactor;
} }
/* new Z values */ /* new Z values */
oz0 = CLAMP(v[0]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max); oz0 = CLAMP(v[0]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max);
oz1 = CLAMP(v[1]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max); oz1 = CLAMP(v[1]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max);
oz2 = CLAMP(v[2]->attrib[FRAG_ATTRIB_WPOS][2] + offset, 0.0F, max); oz2 = CLAMP(v[2]->attrib[VARYING_SLOT_POS][2] + offset, 0.0F, max);
} }
} }
if (mode == GL_POINT) { if (mode == GL_POINT) {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetPoint) { if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetPoint) {
v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0; v[0]->attrib[VARYING_SLOT_POS][2] = oz0;
v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1; v[1]->attrib[VARYING_SLOT_POS][2] = oz1;
v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2; v[2]->attrib[VARYING_SLOT_POS][2] = oz2;
} }
_swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_point_tri); _swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_point_tri);
} else if (mode == GL_LINE) { } else if (mode == GL_LINE) {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) { if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) {
v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0; v[0]->attrib[VARYING_SLOT_POS][2] = oz0;
v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1; v[1]->attrib[VARYING_SLOT_POS][2] = oz1;
v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2; v[2]->attrib[VARYING_SLOT_POS][2] = oz2;
} }
_swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_line_tri); _swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_line_tri);
} else { } else {
if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) { if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) {
v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0; v[0]->attrib[VARYING_SLOT_POS][2] = oz0;
v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1; v[1]->attrib[VARYING_SLOT_POS][2] = oz1;
v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2; v[2]->attrib[VARYING_SLOT_POS][2] = oz2;
} }
_swrast_Triangle( ctx, v[0], v[1], v[2] ); _swrast_Triangle( ctx, v[0], v[1], v[2] );
} }
@ -180,9 +180,9 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
* Restore original vertex colors, etc. * Restore original vertex colors, etc.
*/ */
if (IND & SS_OFFSET_BIT) { if (IND & SS_OFFSET_BIT) {
v[0]->attrib[FRAG_ATTRIB_WPOS][2] = z[0]; v[0]->attrib[VARYING_SLOT_POS][2] = z[0];
v[1]->attrib[FRAG_ATTRIB_WPOS][2] = z[1]; v[1]->attrib[VARYING_SLOT_POS][2] = z[1];
v[2]->attrib[FRAG_ATTRIB_WPOS][2] = z[2]; v[2]->attrib[VARYING_SLOT_POS][2] = z[2];
} }
if (IND & SS_TWOSIDE_BIT) { if (IND & SS_TWOSIDE_BIT) {
@ -194,16 +194,16 @@ static void TAG(triangle)(struct gl_context *ctx, GLuint e0, GLuint e1, GLuint e
COPY_CHAN4(v[2]->color, saved_color[2]); COPY_CHAN4(v[2]->color, saved_color[2]);
} }
else { else {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL0], saved_col0[0]); COPY_4V(v[0]->attrib[VARYING_SLOT_COL0], saved_col0[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL0], saved_col0[1]); COPY_4V(v[1]->attrib[VARYING_SLOT_COL0], saved_col0[1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL0], saved_col0[2]); COPY_4V(v[2]->attrib[VARYING_SLOT_COL0], saved_col0[2]);
} }
} }
if (VB->BackfaceSecondaryColorPtr) { if (VB->BackfaceSecondaryColorPtr) {
COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]); COPY_4V(v[0]->attrib[VARYING_SLOT_COL1], saved_spec[0]);
COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); COPY_4V(v[1]->attrib[VARYING_SLOT_COL1], saved_spec[1]);
COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); COPY_4V(v[2]->attrib[VARYING_SLOT_COL1], saved_spec[2]);
} }
} }
} }

View file

@ -142,7 +142,7 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
*/ */
tnl->render_inputs_bitset = BITFIELD64_BIT(_TNL_ATTRIB_POS); tnl->render_inputs_bitset = BITFIELD64_BIT(_TNL_ATTRIB_POS);
if (!fp || (fp->Base.InputsRead & FRAG_BIT_COL0)) { if (!fp || (fp->Base.InputsRead & VARYING_BIT_COL0)) {
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR0); tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR0);
} }
@ -151,13 +151,13 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
if (ctx->Texture._EnabledCoordUnits & (1 << i) || if (ctx->Texture._EnabledCoordUnits & (1 << i) ||
(fp && fp->Base.InputsRead & FRAG_BIT_TEX(i))) { (fp && fp->Base.InputsRead & VARYING_BIT_TEX(i))) {
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX(i)); tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX(i));
} }
} }
if (ctx->Fog.Enabled if (ctx->Fog.Enabled
|| (fp != NULL && (fp->Base.InputsRead & FRAG_BIT_FOGC) != 0)) { || (fp != NULL && (fp->Base.InputsRead & VARYING_BIT_FOGC) != 0)) {
/* Either fixed-function fog or a fragment program needs fog coord. /* Either fixed-function fog or a fragment program needs fog coord.
*/ */
tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_FOG); tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_FOG);

View file

@ -89,15 +89,15 @@ void TAG(translate_vertex)(struct gl_context *ctx,
if (format == TINY_VERTEX_FORMAT) { if (format == TINY_VERTEX_FORMAT) {
if (HAVE_HW_VIEWPORT) { if (HAVE_HW_VIEWPORT) {
dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; dst->attrib[VARYING_SLOT_POS][0] = s[0] * src->v.x + s[12];
dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; dst->attrib[VARYING_SLOT_POS][1] = s[5] * src->v.y + s[13];
dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; dst->attrib[VARYING_SLOT_POS][2] = s[10] * src->v.z + s[14];
dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; dst->attrib[VARYING_SLOT_POS][3] = 1.0;
} else { } else {
dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); dst->attrib[VARYING_SLOT_POS][0] = UNVIEWPORT_X( src->v.x );
dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); dst->attrib[VARYING_SLOT_POS][1] = UNVIEWPORT_Y( src->v.y );
dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); dst->attrib[VARYING_SLOT_POS][2] = UNVIEWPORT_Z( src->v.z );
dst->attrib[FRAG_ATTRIB_WPOS][3] = 1.0; dst->attrib[VARYING_SLOT_POS][3] = 1.0;
} }
dst->color[0] = src->tv.color.red; dst->color[0] = src->tv.color.red;
@ -109,21 +109,21 @@ void TAG(translate_vertex)(struct gl_context *ctx,
if (HAVE_HW_VIEWPORT) { if (HAVE_HW_VIEWPORT) {
if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) { if (HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
GLfloat oow = 1.0 / src->v.w; GLfloat oow = 1.0 / src->v.w;
dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x * oow + s[12]; dst->attrib[VARYING_SLOT_POS][0] = s[0] * src->v.x * oow + s[12];
dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y * oow + s[13]; dst->attrib[VARYING_SLOT_POS][1] = s[5] * src->v.y * oow + s[13];
dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z * oow + s[14]; dst->attrib[VARYING_SLOT_POS][2] = s[10] * src->v.z * oow + s[14];
dst->attrib[FRAG_ATTRIB_WPOS][3] = oow; dst->attrib[VARYING_SLOT_POS][3] = oow;
} else { } else {
dst->attrib[FRAG_ATTRIB_WPOS][0] = s[0] * src->v.x + s[12]; dst->attrib[VARYING_SLOT_POS][0] = s[0] * src->v.x + s[12];
dst->attrib[FRAG_ATTRIB_WPOS][1] = s[5] * src->v.y + s[13]; dst->attrib[VARYING_SLOT_POS][1] = s[5] * src->v.y + s[13];
dst->attrib[FRAG_ATTRIB_WPOS][2] = s[10] * src->v.z + s[14]; dst->attrib[VARYING_SLOT_POS][2] = s[10] * src->v.z + s[14];
dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; dst->attrib[VARYING_SLOT_POS][3] = src->v.w;
} }
} else { } else {
dst->attrib[FRAG_ATTRIB_WPOS][0] = UNVIEWPORT_X( src->v.x ); dst->attrib[VARYING_SLOT_POS][0] = UNVIEWPORT_X( src->v.x );
dst->attrib[FRAG_ATTRIB_WPOS][1] = UNVIEWPORT_Y( src->v.y ); dst->attrib[VARYING_SLOT_POS][1] = UNVIEWPORT_Y( src->v.y );
dst->attrib[FRAG_ATTRIB_WPOS][2] = UNVIEWPORT_Z( src->v.z ); dst->attrib[VARYING_SLOT_POS][2] = UNVIEWPORT_Z( src->v.z );
dst->attrib[FRAG_ATTRIB_WPOS][3] = src->v.w; dst->attrib[VARYING_SLOT_POS][3] = src->v.w;
} }
dst->color[0] = src->v.color.red; dst->color[0] = src->v.color.red;
@ -131,55 +131,55 @@ void TAG(translate_vertex)(struct gl_context *ctx,
dst->color[2] = src->v.color.blue; dst->color[2] = src->v.color.blue;
dst->color[3] = src->v.color.alpha; dst->color[3] = src->v.color.alpha;
dst->attrib[FRAG_ATTRIB_COL1][0] = UBYTE_TO_FLOAT(src->v.specular.red); dst->attrib[VARYING_SLOT_COL1][0] = UBYTE_TO_FLOAT(src->v.specular.red);
dst->attrib[FRAG_ATTRIB_COL1][1] = UBYTE_TO_FLOAT(src->v.specular.green); dst->attrib[VARYING_SLOT_COL1][1] = UBYTE_TO_FLOAT(src->v.specular.green);
dst->attrib[FRAG_ATTRIB_COL1][2] = UBYTE_TO_FLOAT(src->v.specular.blue); dst->attrib[VARYING_SLOT_COL1][2] = UBYTE_TO_FLOAT(src->v.specular.blue);
dst->attrib[FRAG_ATTRIB_FOGC][0] = UBYTE_TO_FLOAT(src->v.specular.alpha); dst->attrib[VARYING_SLOT_FOGC][0] = UBYTE_TO_FLOAT(src->v.specular.alpha);
if (HAVE_PTEX_VERTICES && if (HAVE_PTEX_VERTICES &&
((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) || ((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) ||
(format == PROJ_TEX1_VERTEX_FORMAT))) { (format == PROJ_TEX1_VERTEX_FORMAT))) {
dst->attrib[FRAG_ATTRIB_TEX0][0] = src->pv.u0; dst->attrib[VARYING_SLOT_TEX0][0] = src->pv.u0;
dst->attrib[FRAG_ATTRIB_TEX0][1] = src->pv.v0; dst->attrib[VARYING_SLOT_TEX0][1] = src->pv.v0;
dst->attrib[FRAG_ATTRIB_TEX0][3] = src->pv.q0; dst->attrib[VARYING_SLOT_TEX0][3] = src->pv.q0;
dst->attrib[FRAG_ATTRIB_TEX1][0] = src->pv.u1; dst->attrib[VARYING_SLOT_TEX1][0] = src->pv.u1;
dst->attrib[FRAG_ATTRIB_TEX1][1] = src->pv.v1; dst->attrib[VARYING_SLOT_TEX1][1] = src->pv.v1;
dst->attrib[FRAG_ATTRIB_TEX1][3] = src->pv.q1; dst->attrib[VARYING_SLOT_TEX1][3] = src->pv.q1;
if (HAVE_TEX2_VERTICES) { if (HAVE_TEX2_VERTICES) {
dst->attrib[FRAG_ATTRIB_TEX2][0] = src->pv.u2; dst->attrib[VARYING_SLOT_TEX2][0] = src->pv.u2;
dst->attrib[FRAG_ATTRIB_TEX2][1] = src->pv.v2; dst->attrib[VARYING_SLOT_TEX2][1] = src->pv.v2;
dst->attrib[FRAG_ATTRIB_TEX2][3] = src->pv.q2; dst->attrib[VARYING_SLOT_TEX2][3] = src->pv.q2;
} }
if (HAVE_TEX3_VERTICES) { if (HAVE_TEX3_VERTICES) {
dst->attrib[FRAG_ATTRIB_TEX3][0] = src->pv.u3; dst->attrib[VARYING_SLOT_TEX3][0] = src->pv.u3;
dst->attrib[FRAG_ATTRIB_TEX3][1] = src->pv.v3; dst->attrib[VARYING_SLOT_TEX3][1] = src->pv.v3;
dst->attrib[FRAG_ATTRIB_TEX3][3] = src->pv.q3; dst->attrib[VARYING_SLOT_TEX3][3] = src->pv.q3;
} }
} }
else { else {
dst->attrib[FRAG_ATTRIB_TEX0][0] = src->v.u0; dst->attrib[VARYING_SLOT_TEX0][0] = src->v.u0;
dst->attrib[FRAG_ATTRIB_TEX0][1] = src->v.v0; dst->attrib[VARYING_SLOT_TEX0][1] = src->v.v0;
dst->attrib[FRAG_ATTRIB_TEX0][3] = 1.0; dst->attrib[VARYING_SLOT_TEX0][3] = 1.0;
dst->attrib[FRAG_ATTRIB_TEX1][0] = src->v.u1; dst->attrib[VARYING_SLOT_TEX1][0] = src->v.u1;
dst->attrib[FRAG_ATTRIB_TEX1][1] = src->v.v1; dst->attrib[VARYING_SLOT_TEX1][1] = src->v.v1;
dst->attrib[FRAG_ATTRIB_TEX1][3] = 1.0; dst->attrib[VARYING_SLOT_TEX1][3] = 1.0;
if (HAVE_TEX2_VERTICES) { if (HAVE_TEX2_VERTICES) {
dst->attrib[FRAG_ATTRIB_TEX2][0] = src->v.u2; dst->attrib[VARYING_SLOT_TEX2][0] = src->v.u2;
dst->attrib[FRAG_ATTRIB_TEX2][1] = src->v.v2; dst->attrib[VARYING_SLOT_TEX2][1] = src->v.v2;
dst->attrib[FRAG_ATTRIB_TEX2][3] = 1.0; dst->attrib[VARYING_SLOT_TEX2][3] = 1.0;
} }
if (HAVE_TEX3_VERTICES) { if (HAVE_TEX3_VERTICES) {
dst->attrib[FRAG_ATTRIB_TEX3][0] = src->v.u3; dst->attrib[VARYING_SLOT_TEX3][0] = src->v.u3;
dst->attrib[FRAG_ATTRIB_TEX3][1] = src->v.v3; dst->attrib[VARYING_SLOT_TEX3][1] = src->v.v3;
dst->attrib[FRAG_ATTRIB_TEX3][3] = 1.0; dst->attrib[VARYING_SLOT_TEX3][3] = 1.0;
} }
} }
} }