diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/i915/i915_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_screen.c | 1 | ||||
-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 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/codegen/nv50_ir_driver.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_screen.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_surface.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_program.c | 37 | ||||
-rw-r--r-- | src/gallium/drivers/nvc0/nvc0_screen.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/r300/r300_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/radeonsi_pipe.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/softpipe/sp_screen.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_screen.c | 2 |
16 files changed, 52 insertions, 59 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 5310fc7fdf8..5ff132dac72 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -165,6 +165,8 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_TEXTURE_MULTISAMPLE: case PIPE_CAP_USER_CONSTANT_BUFFERS: return 1; + case PIPE_CAP_TGSI_TEXCOORD: + return 0; case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: return 256; diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c index eb96e9e13b0..13aa91c29bd 100644 --- a/src/gallium/drivers/i915/i915_screen.c +++ b/src/gallium/drivers/i915/i915_screen.c @@ -184,6 +184,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap) case PIPE_CAP_USER_INDEX_BUFFERS: case PIPE_CAP_USER_CONSTANT_BUFFERS: return 1; + case PIPE_CAP_TGSI_TEXCOORD: + return 0; /* Unsupported features (boolean caps). */ case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 93e125da38d..5ec1df659b8 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -208,6 +208,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: + case PIPE_CAP_TGSI_TEXCOORD: return 0; case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT: 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; } diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h b/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h index c5a5b23c320..51ed9c1e1ae 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_driver.h @@ -70,8 +70,6 @@ struct nv50_ir_varying #endif #define NV50_SEMANTIC_CLIPDISTANCE (TGSI_SEMANTIC_COUNT + 0) -#define NV50_SEMANTIC_TEXCOORD (TGSI_SEMANTIC_COUNT + 1) -#define NV50_SEMANTIC_POINTCOORD (TGSI_SEMANTIC_COUNT + 2) #define NV50_SEMANTIC_VIEWPORTINDEX (TGSI_SEMANTIC_COUNT + 4) #define NV50_SEMANTIC_LAYER (TGSI_SEMANTIC_COUNT + 5) #define NV50_SEMANTIC_INVOCATIONID (TGSI_SEMANTIC_COUNT + 6) diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index aed1dd56eb5..fb29b2290c2 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -184,6 +184,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: + case PIPE_CAP_TGSI_TEXCOORD: case PIPE_CAP_TEXTURE_MULTISAMPLE: return 0; default: diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 7a0470c4294..117d3d1894b 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -494,7 +494,7 @@ nv50_blitter_make_vp(struct nv50_blitter *blit) blit->vp.out[1].hw = 2; blit->vp.out[1].mask = 0x7; blit->vp.out[1].sn = TGSI_SEMANTIC_GENERIC; - blit->vp.out[1].si = 8; + blit->vp.out[1].si = 0; blit->vp.vp.attrs[0] = 0x73; blit->vp.vp.psiz = 0x40; blit->vp.vp.edgeflag = 0x40; @@ -536,9 +536,8 @@ nv50_blitter_make_fp(struct pipe_context *pipe, return NULL; out = ureg_DECL_output(ureg, TGSI_SEMANTIC_COLOR, 0); - /* NOTE: use GENERIC[8] so we don't use the TEXCOORD slots on nvc0 */ tc = ureg_DECL_fs_input( - ureg, TGSI_SEMANTIC_GENERIC, 8, TGSI_INTERPOLATE_LINEAR); + ureg, TGSI_SEMANTIC_GENERIC, 0, TGSI_INTERPOLATE_LINEAR); data = ureg_DECL_temporary(ureg); 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; diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c index 7d034797eef..e77b819b651 100644 --- a/src/gallium/drivers/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nvc0/nvc0_screen.c @@ -114,6 +114,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_TWO_SIDED_STENCIL: case PIPE_CAP_DEPTH_CLIP_DISABLE: case PIPE_CAP_POINT_SPRITE: + case PIPE_CAP_TGSI_TEXCOORD: return 1; case PIPE_CAP_SM3: return 1; diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 06ed1cb5b5b..46fb869cb72 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -172,6 +172,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: return r300screen->caps.has_tcl; + case PIPE_CAP_TGSI_TEXCOORD: + return 0; /* Texturing. */ case PIPE_CAP_MAX_COMBINED_SAMPLERS: diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c index 60a0247d5dd..9ed88148c49 100644 --- a/src/gallium/drivers/r600/r600_pipe.c +++ b/src/gallium/drivers/r600/r600_pipe.c @@ -565,6 +565,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS: case PIPE_CAP_TEXTURE_BUFFER_OBJECTS: return 1; + case PIPE_CAP_TGSI_TEXCOORD: + return 0; case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT: return R600_MAP_BUFFER_ALIGNMENT; diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.c b/src/gallium/drivers/radeonsi/radeonsi_pipe.c index 2abfce476a2..859843867ce 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_pipe.c +++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.c @@ -330,6 +330,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param) case PIPE_CAP_START_INSTANCE: case PIPE_CAP_NPOT_TEXTURES: return 1; + case PIPE_CAP_TGSI_TEXCOORD: + return 0; case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT: return 64; diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 16aba5a630d..937035e5511 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -173,6 +173,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) return 1; case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT: return 0; + case PIPE_CAP_TGSI_TEXCOORD: + return 0; } /* should only get here on unhandled cases */ debug_printf("Unexpected PIPE_CAP %d query\n", param); diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 3e71ac3c6bf..f0831b9f2fe 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -150,6 +150,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) return 1; case PIPE_CAP_POINT_SPRITE: return 1; + case PIPE_CAP_TGSI_TEXCOORD: + return 0; case PIPE_CAP_MAX_RENDER_TARGETS: if(!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_RENDER_TARGETS, &result)) return 1; |