diff options
author | Ilia Mirkin <[email protected]> | 2014-07-01 20:54:01 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2014-07-09 19:26:32 -0400 |
commit | 4c97ed4411e3653a082875b79587fb308c284a99 (patch) | |
tree | bc6f1666166da83a51525f6460d49c7d6d473166 /src/gallium/drivers | |
parent | e3b16294cb56bc0f3ee4a68a525884db0ce6806d (diff) |
gallium: switch dedicated centroid field to interpolation location
The new location field can be either center, centroid, or sample, which
indicates the location that the shader should interpolate at.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/ilo/shader/toy_tgsi.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 2 | ||||
-rw-r--r-- | src/gallium/drivers/r600/r600_shader.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 6 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/ilo/shader/toy_tgsi.c b/src/gallium/drivers/ilo/shader/toy_tgsi.c index e816ab44c70..08fb10b9273 100644 --- a/src/gallium/drivers/ilo/shader/toy_tgsi.c +++ b/src/gallium/drivers/ilo/shader/toy_tgsi.c @@ -2298,7 +2298,7 @@ decl_add_in(struct toy_tgsi *tgsi, const struct tgsi_full_declaration *decl) tgsi->inputs[slot].semantic_index = index; } tgsi->inputs[slot].interp = interp->Interpolate; - tgsi->inputs[slot].centroid = interp->Centroid; + tgsi->inputs[slot].centroid = interp->Location == TGSI_INTERPOLATE_LOC_CENTROID; } } diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index af3a87ccf6a..93f96a1b731 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -950,7 +950,7 @@ bool Source::scanDeclaration(const struct tgsi_full_declaration *decl) default: break; } - if (decl->Interp.Centroid || info->io.sampleInterp) + if (decl->Interp.Location || info->io.sampleInterp) info->in[i].centroid = 1; } } diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c index 448ca8044de..6952e3c8226 100644 --- a/src/gallium/drivers/r600/r600_shader.c +++ b/src/gallium/drivers/r600/r600_shader.c @@ -579,7 +579,7 @@ static int tgsi_declaration(struct r600_shader_ctx *ctx) ctx->shader->input[i].name = d->Semantic.Name; ctx->shader->input[i].sid = d->Semantic.Index; ctx->shader->input[i].interpolate = d->Interp.Interpolate; - ctx->shader->input[i].centroid = d->Interp.Centroid; + ctx->shader->input[i].centroid = d->Interp.Location == TGSI_INTERPOLATE_LOC_CENTROID; ctx->shader->input[i].gpr = ctx->file_offset[TGSI_FILE_INPUT] + d->Range.First; if (ctx->type == TGSI_PROCESSOR_FRAGMENT) { ctx->shader->input[i].spi_sid = r600_spi_sid(&ctx->shader->input[i]); @@ -735,7 +735,7 @@ static int evergreen_gpr_count(struct r600_shader_ctx *ctx) ctx->input_linear = TRUE; if (ctx->info.input_interpolate[i] == TGSI_INTERPOLATE_PERSPECTIVE) ctx->input_perspective = TRUE; - if (ctx->info.input_centroid[i]) + if (ctx->info.input_interpolate_loc[i] == TGSI_INTERPOLATE_LOC_CENTROID) ctx->input_centroid = TRUE; } diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index f0650f4fe9d..07d9833bd1c 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -172,7 +172,7 @@ static int si_store_shader_io_attribs(struct si_shader *shader, shader->input[i].sid = d->Semantic.Index; shader->input[i].index = d->Range.First; shader->input[i].interpolate = d->Interp.Interpolate; - shader->input[i].centroid = d->Interp.Centroid; + shader->input[i].centroid = d->Interp.Location == TGSI_INTERPOLATE_LOC_CENTROID; return -1; case TGSI_FILE_OUTPUT: @@ -427,7 +427,7 @@ static void declare_input_fs( case TGSI_INTERPOLATE_LINEAR: if (si_shader_ctx->shader->key.ps.interp_at_sample) interp_param = LLVMGetParam(main_fn, SI_PARAM_LINEAR_SAMPLE); - else if (decl->Interp.Centroid) + else if (decl->Interp.Location == TGSI_INTERPOLATE_LOC_CENTROID) interp_param = LLVMGetParam(main_fn, SI_PARAM_LINEAR_CENTROID); else interp_param = LLVMGetParam(main_fn, SI_PARAM_LINEAR_CENTER); @@ -441,7 +441,7 @@ static void declare_input_fs( case TGSI_INTERPOLATE_PERSPECTIVE: if (si_shader_ctx->shader->key.ps.interp_at_sample) interp_param = LLVMGetParam(main_fn, SI_PARAM_PERSP_SAMPLE); - else if (decl->Interp.Centroid) + else if (decl->Interp.Location == TGSI_INTERPOLATE_LOC_CENTROID) interp_param = LLVMGetParam(main_fn, SI_PARAM_PERSP_CENTROID); else interp_param = LLVMGetParam(main_fn, SI_PARAM_PERSP_CENTER); |