mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
r600: Handle texcoord semantics in LDS index evaluation
With NIR the texcoord semantic is enabled, and hence we have to handle index evaluation differently here. Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
This commit is contained in:
parent
7d476a1360
commit
096a026354
3 changed files with 12 additions and 10 deletions
|
|
@ -703,7 +703,7 @@ static int r600_spi_sid(struct r600_shader_io * io)
|
|||
};
|
||||
|
||||
/* we need this to get a common lds index for vs/tcs/tes input/outputs */
|
||||
int r600_get_lds_unique_index(unsigned semantic_name, unsigned index)
|
||||
int r600_get_lds_unique_index(unsigned semantic_name, unsigned index, bool texcoord_semantics)
|
||||
{
|
||||
switch (semantic_name) {
|
||||
case TGSI_SEMANTIC_POSITION:
|
||||
|
|
@ -715,7 +715,7 @@ int r600_get_lds_unique_index(unsigned semantic_name, unsigned index)
|
|||
return 2 + index;
|
||||
case TGSI_SEMANTIC_GENERIC:
|
||||
if (index <= 63-4)
|
||||
return 4 + index - 9;
|
||||
return 4 + index - (texcoord_semantics ? 0 : 9);
|
||||
else
|
||||
/* same explanation as in the default statement,
|
||||
* the only user hitting this is st/nine.
|
||||
|
|
@ -1183,7 +1183,7 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx)
|
|||
break;
|
||||
else if (d->Semantic.Name == TGSI_SEMANTIC_TESSINNER ||
|
||||
d->Semantic.Name == TGSI_SEMANTIC_TESSOUTER) {
|
||||
int param = r600_get_lds_unique_index(d->Semantic.Name, 0);
|
||||
int param = r600_get_lds_unique_index(d->Semantic.Name, 0, false);
|
||||
int dreg = d->Semantic.Name == TGSI_SEMANTIC_TESSINNER ? 3 : 2;
|
||||
unsigned temp_reg = r600_get_temp(ctx);
|
||||
|
||||
|
|
@ -2089,11 +2089,11 @@ static int r600_get_byte_address(struct r600_shader_ctx *ctx, int temp_reg,
|
|||
return r;
|
||||
|
||||
param = r600_get_lds_unique_index(name[first],
|
||||
index[first]);
|
||||
index[first], false);
|
||||
|
||||
} else {
|
||||
param = r600_get_lds_unique_index(name[reg.Register.Index],
|
||||
index[reg.Register.Index]);
|
||||
index[reg.Register.Index], false);
|
||||
}
|
||||
|
||||
/* add to base_addr - passed in temp_reg.x */
|
||||
|
|
@ -3036,7 +3036,8 @@ static int emit_lds_vs_writes(struct r600_shader_ctx *ctx)
|
|||
|
||||
for (i = 0; i < ctx->shader->noutput; i++) {
|
||||
struct r600_bytecode_alu alu;
|
||||
int param = r600_get_lds_unique_index(ctx->shader->output[i].name, ctx->shader->output[i].sid);
|
||||
int param = r600_get_lds_unique_index(ctx->shader->output[i].name,
|
||||
ctx->shader->output[i].sid, false);
|
||||
|
||||
if (param) {
|
||||
r = single_alu_op2(ctx, ALU_OP2_ADD_INT,
|
||||
|
|
@ -3170,7 +3171,7 @@ static int r600_tess_factor_read(struct r600_shader_ctx *ctx,
|
|||
int dreg = ctx->shader->output[output_idx].gpr;
|
||||
int r;
|
||||
|
||||
param = r600_get_lds_unique_index(name, 0);
|
||||
param = r600_get_lds_unique_index(name, 0, false);
|
||||
r = get_lds_offset0(ctx, 1, temp_reg, true);
|
||||
if (r)
|
||||
return r;
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ struct r600_pipe_shader {
|
|||
TGSI_INTERPOLATE_LOC_CENTER/SAMPLE/COUNT. Other input values return -1. */
|
||||
int eg_get_interpolator_index(unsigned interpolate, unsigned location);
|
||||
|
||||
int r600_get_lds_unique_index(unsigned semantic_name, unsigned index);
|
||||
int r600_get_lds_unique_index(unsigned semantic_name, unsigned index, bool texcoord_semantics);
|
||||
|
||||
int generate_gs_copy_shader(struct r600_context *rctx,
|
||||
struct r600_pipe_shader *gs,
|
||||
|
|
|
|||
|
|
@ -956,6 +956,7 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
|
|||
case PIPE_SHADER_TESS_CTRL:
|
||||
sel->lds_patch_outputs_written_mask = 0;
|
||||
sel->lds_outputs_written_mask = 0;
|
||||
bool texxcoord_semantic = ctx->screen->get_param(ctx->screen, PIPE_CAP_TGSI_TEXCOORD);
|
||||
|
||||
for (i = 0; i < sel->info.num_outputs; i++) {
|
||||
unsigned name = sel->info.output_semantic_name[i];
|
||||
|
|
@ -966,11 +967,11 @@ static void *r600_create_shader_state(struct pipe_context *ctx,
|
|||
case TGSI_SEMANTIC_TESSOUTER:
|
||||
case TGSI_SEMANTIC_PATCH:
|
||||
sel->lds_patch_outputs_written_mask |=
|
||||
1ull << r600_get_lds_unique_index(name, index);
|
||||
1ull << r600_get_lds_unique_index(name, index, texxcoord_semantic);
|
||||
break;
|
||||
default:
|
||||
sel->lds_outputs_written_mask |=
|
||||
1ull << r600_get_lds_unique_index(name, index);
|
||||
1ull << r600_get_lds_unique_index(name, index, texxcoord_semantic);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue