diff options
author | Christoph Bumiller <[email protected]> | 2013-03-15 22:11:31 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2013-03-20 12:25:21 +0100 |
commit | 8acaf862dfeac62550514b0e46f5aa6212b08992 (patch) | |
tree | 742186f981a608ef42f62aff6271aeec6451b7bc /src/gallium/drivers/nvc0/nvc0_program.c | |
parent | 3eaf823b9086ae400a000a1f639e74d2f2be9166 (diff) |
gallium: add TGSI_SEMANTIC_TEXCOORD,PCOORD v3
This makes it possible to identify gl_TexCoord and gl_PointCoord
for drivers where sprite coordinate replacement is restricted.
The new PIPE_CAP_TGSI_TEXCOORD decides whether these varyings
should be hidden behind the GENERIC semantic or not.
With this patch only nvc0 and nv30 will request that they be used.
v2: introduce a CAP so other drivers don't have to bother with
the new semantic
v3: adapt to introduction gl_varying_slot enum
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_program.c')
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_program.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c index 2f4eae8f052..2f1b41704a5 100644 --- a/src/gallium/drivers/nvc0/nvc0_program.c +++ b/src/gallium/drivers/nvc0/nvc0_program.c @@ -27,33 +27,6 @@ #include "nv50/codegen/nv50_ir_driver.h" #include "nve4_compute.h" -/* If only they told use the actual semantic instead of just GENERIC ... */ -static void -nvc0_mesa_varying_hack(struct nv50_ir_varying *var) -{ - unsigned c; - - if (var->sn != TGSI_SEMANTIC_GENERIC) - return; - - if (var->si <= 7) /* gl_TexCoord */ - for (c = 0; c < 4; ++c) - var->slot[c] = (0x300 + var->si * 0x10 + c * 0x4) / 4; - else - if (var->si == 9) /* gl_PointCoord */ - for (c = 0; c < 4; ++c) - var->slot[c] = (0x2e0 + c * 0x4) / 4; - else - if (var->si <= 39) - for (c = 0; c < 4; ++c) /* move down user varyings (first has index 8) */ - var->slot[c] -= 0x80 / 4; - else { - NOUVEAU_ERR("too many varyings / invalid location: %u !\n", var->si); - for (c = 0; c < 4; ++c) - var->slot[c] = (0x270 + c * 0x4) / 4; /* catch invalid indices */ - } -} - static uint32_t nvc0_shader_input_address(unsigned sn, unsigned si, unsigned ubase) { @@ -69,11 +42,11 @@ nvc0_shader_input_address(unsigned sn, unsigned si, unsigned ubase) case NV50_SEMANTIC_CLIPDISTANCE: return 0x2c0 + si * 0x4; case TGSI_SEMANTIC_CLIPDIST: return 0x2c0 + si * 0x10; case TGSI_SEMANTIC_CLIPVERTEX: return 0x260; - case NV50_SEMANTIC_POINTCOORD: return 0x2e0; + case TGSI_SEMANTIC_PCOORD: return 0x2e0; case NV50_SEMANTIC_TESSCOORD: return 0x2f0; case TGSI_SEMANTIC_INSTANCEID: return 0x2f8; case TGSI_SEMANTIC_VERTEXID: return 0x2fc; - case NV50_SEMANTIC_TEXCOORD: return 0x300 + si * 0x10; + case TGSI_SEMANTIC_TEXCOORD: return 0x300 + si * 0x10; case TGSI_SEMANTIC_FACE: return 0x3fc; case NV50_SEMANTIC_INVOCATIONID: return ~0; default: @@ -99,7 +72,7 @@ nvc0_shader_output_address(unsigned sn, unsigned si, unsigned ubase) case NV50_SEMANTIC_CLIPDISTANCE: return 0x2c0 + si * 0x4; case TGSI_SEMANTIC_CLIPDIST: return 0x2c0 + si * 0x10; case TGSI_SEMANTIC_CLIPVERTEX: return 0x260; - case NV50_SEMANTIC_TEXCOORD: return 0x300 + si * 0x10; + case TGSI_SEMANTIC_TEXCOORD: return 0x300 + si * 0x10; case TGSI_SEMANTIC_EDGEFLAG: return ~0; default: assert(!"invalid TGSI output semantic"); @@ -149,8 +122,6 @@ nvc0_sp_assign_input_slots(struct nv50_ir_prog_info *info) for (c = 0; c < 4; ++c) info->in[i].slot[c] = (offset + c * 0x4) / 4; - - nvc0_mesa_varying_hack(&info->in[i]); } return 0; @@ -194,8 +165,6 @@ nvc0_sp_assign_output_slots(struct nv50_ir_prog_info *info) for (c = 0; c < 4; ++c) info->out[i].slot[c] = (offset + c * 0x4) / 4; - - nvc0_mesa_varying_hack(&info->out[i]); } return 0; |