diff options
Diffstat (limited to 'src/gallium/drivers/nv30')
-rw-r--r-- | src/gallium/drivers/nv30/nv30_screen.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nv30/nvfx_fragprog.c | 42 | ||||
-rw-r--r-- | src/gallium/drivers/nv30/nvfx_vertprog.c | 7 |
3 files changed, 30 insertions, 20 deletions
diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c index 90c367280d4..e17ee76fbd1 100644 --- a/src/gallium/drivers/nv30/nv30_screen.c +++ b/src/gallium/drivers/nv30/nv30_screen.c @@ -79,6 +79,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER: case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER: + case PIPE_CAP_TGSI_TEXCOORD: case PIPE_CAP_USER_CONSTANT_BUFFERS: case PIPE_CAP_USER_INDEX_BUFFERS: return 1; diff --git a/src/gallium/drivers/nv30/nvfx_fragprog.c b/src/gallium/drivers/nv30/nvfx_fragprog.c index 935804e8e14..4be7dec2c03 100644 --- a/src/gallium/drivers/nv30/nvfx_fragprog.c +++ b/src/gallium/drivers/nv30/nvfx_fragprog.c @@ -927,15 +927,17 @@ nvfx_fragprog_parse_decl_input(struct nv30_context *nvfx, struct nvfx_fpc *fpc, case TGSI_SEMANTIC_FACE: hw = NV40_FP_OP_INPUT_SRC_FACING; break; - case TGSI_SEMANTIC_GENERIC: - if (fdec->Semantic.Index >= 8) - return TRUE; - + case TGSI_SEMANTIC_TEXCOORD: + assert(fdec->Semantic.Index < 8); fpc->fp->texcoord[fdec->Semantic.Index] = fdec->Semantic.Index; fpc->fp->texcoords |= (1 << fdec->Semantic.Index); fpc->fp->vp_or |= (0x00004000 << fdec->Semantic.Index); hw = NVFX_FP_OP_INPUT_SRC_TC(fdec->Semantic.Index); break; + case TGSI_SEMANTIC_GENERIC: + case TGSI_SEMANTIC_PCOORD: + /* will be assigned to remaining TC slots later */ + return TRUE; default: assert(0); return FALSE; @@ -955,22 +957,24 @@ nvfx_fragprog_assign_generic(struct nv30_context *nvfx, struct nvfx_fpc *fpc, switch (fdec->Semantic.Name) { case TGSI_SEMANTIC_GENERIC: - if (fdec->Semantic.Index >= 8) { - for (hw = 0; hw < num_texcoords; hw++) { - if (fpc->fp->texcoord[hw] == 0xffff) { - fpc->fp->texcoord[hw] = fdec->Semantic.Index; - if (hw <= 7) { - fpc->fp->texcoords |= (0x1 << hw); - fpc->fp->vp_or |= (0x00004000 << hw); - } else { - fpc->fp->vp_or |= (0x00001000 << (hw - 8)); - } - if (fdec->Semantic.Index == 9) - fpc->fp->point_sprite_control |= (0x00000100 << hw); - hw = NVFX_FP_OP_INPUT_SRC_TC(hw); - fpc->r_input[idx] = nvfx_reg(NVFXSR_INPUT, hw); - return TRUE; + case TGSI_SEMANTIC_PCOORD: + for (hw = 0; hw < num_texcoords; hw++) { + if (fpc->fp->texcoord[hw] == 0xffff) { + if (hw <= 7) { + fpc->fp->texcoords |= (0x1 << hw); + fpc->fp->vp_or |= (0x00004000 << hw); + } else { + fpc->fp->vp_or |= (0x00001000 << (hw - 8)); + } + if (fdec->Semantic.Name == TGSI_SEMANTIC_PCOORD) { + fpc->fp->texcoord[hw] = 0xfffe; + fpc->fp->point_sprite_control |= (0x00000100 << hw); + } else { + fpc->fp->texcoord[hw] = fdec->Semantic.Index + 8; } + hw = NVFX_FP_OP_INPUT_SRC_TC(hw); + fpc->r_input[idx] = nvfx_reg(NVFXSR_INPUT, hw); + return TRUE; } return FALSE; } diff --git a/src/gallium/drivers/nv30/nvfx_vertprog.c b/src/gallium/drivers/nv30/nvfx_vertprog.c index 74dba38001c..b73d4184045 100644 --- a/src/gallium/drivers/nv30/nvfx_vertprog.c +++ b/src/gallium/drivers/nv30/nvfx_vertprog.c @@ -819,6 +819,7 @@ nvfx_vertprog_parse_decl_output(struct nv30_context *nv30, struct nvfx_vpc *vpc, { unsigned num_texcoords = nv30->is_nv4x ? 10 : 8; unsigned idx = fdec->Range.First; + unsigned semantic_index = fdec->Semantic.Index; int hw = 0, i; switch (fdec->Semantic.Name) { @@ -860,8 +861,12 @@ nvfx_vertprog_parse_decl_output(struct nv30_context *nv30, struct nvfx_vpc *vpc, hw = NVFX_VP(INST_DEST_PSZ); break; case TGSI_SEMANTIC_GENERIC: + /* this is really an identifier for VP/FP linkage */ + semantic_index += 8; + /* fall through */ + case TGSI_SEMANTIC_TEXCOORD: for (i = 0; i < num_texcoords; i++) { - if (vpc->vp->texcoord[i] == fdec->Semantic.Index) { + if (vpc->vp->texcoord[i] == semantic_index) { hw = NVFX_VP(INST_DEST_TC(i)); break; } |