mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 18:08:40 +02:00
i915: Add support for varying inputs.
This commit is contained in:
parent
7d4b7460b0
commit
f9f31b2574
2 changed files with 23 additions and 2 deletions
|
|
@ -142,7 +142,7 @@ i915CreateContext(const __GLcontextModes * mesaVis,
|
|||
ctx->Const.MaxTextureUnits = I915_TEX_UNITS;
|
||||
ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS;
|
||||
ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS;
|
||||
|
||||
ctx->Const.MaxVarying = I915_TEX_UNITS;
|
||||
|
||||
/* Advertise the full hardware capabilities. The new memory
|
||||
* manager should cope much better with overload situations:
|
||||
|
|
|
|||
|
|
@ -122,6 +122,19 @@ src_vector(struct i915_fragment_program *p,
|
|||
src = i915_emit_decl(p, REG_TYPE_T,
|
||||
T_TEX0 + (source->Index - FRAG_ATTRIB_TEX0),
|
||||
D0_CHANNEL_ALL);
|
||||
break;
|
||||
|
||||
case FRAG_ATTRIB_VAR0:
|
||||
case FRAG_ATTRIB_VAR0 + 1:
|
||||
case FRAG_ATTRIB_VAR0 + 2:
|
||||
case FRAG_ATTRIB_VAR0 + 3:
|
||||
case FRAG_ATTRIB_VAR0 + 4:
|
||||
case FRAG_ATTRIB_VAR0 + 5:
|
||||
case FRAG_ATTRIB_VAR0 + 6:
|
||||
case FRAG_ATTRIB_VAR0 + 7:
|
||||
src = i915_emit_decl(p, REG_TYPE_T,
|
||||
T_TEX0 + (source->Index - FRAG_ATTRIB_VAR0),
|
||||
D0_CHANNEL_ALL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -909,7 +922,7 @@ check_wpos(struct i915_fragment_program *p)
|
|||
p->wpos_tex = -1;
|
||||
|
||||
for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) {
|
||||
if (inputs & FRAG_BIT_TEX(i))
|
||||
if (inputs & (FRAG_BIT_TEX(i) | FRAG_BIT_VAR(i)))
|
||||
continue;
|
||||
else if (inputs & FRAG_BIT_WPOS) {
|
||||
p->wpos_tex = i;
|
||||
|
|
@ -1140,6 +1153,14 @@ i915ValidateFragmentProgram(struct i915_context *i915)
|
|||
|
||||
EMIT_ATTR(_TNL_ATTRIB_TEX0 + i, EMIT_SZ(sz), 0, sz * 4);
|
||||
}
|
||||
else if (inputsRead & FRAG_BIT_VAR(i)) {
|
||||
int sz = VB->AttribPtr[_TNL_ATTRIB_GENERIC0 + i]->size;
|
||||
|
||||
s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK);
|
||||
s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(sz));
|
||||
|
||||
EMIT_ATTR(_TNL_ATTRIB_GENERIC0 + i, EMIT_SZ(sz), 0, sz * 4);
|
||||
}
|
||||
else if (i == p->wpos_tex) {
|
||||
|
||||
/* If WPOS is required, duplicate the XYZ position data in an
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue