diff options
author | Samuel Pitoiset <[email protected]> | 2020-01-27 18:45:26 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-29 09:49:50 +0000 |
commit | 15d53d8294bf5cfd0685422de99e8398bb52fdb8 (patch) | |
tree | c3833e0407b299d83e2194110d5a1c844fcee206 /src/freedreno | |
parent | 5c053cc6ec310481e61631515e0ae7044faf9335 (diff) |
compiler: add PERSP to the existing barycentric system values
We need the LINEAR versions for AMD_shader_explicit_vertex_parameter.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3578>
Diffstat (limited to 'src/freedreno')
-rw-r--r-- | src/freedreno/ir3/ir3_compiler_nir.c | 10 | ||||
-rw-r--r-- | src/freedreno/ir3/ir3_depth.c | 2 | ||||
-rw-r--r-- | src/freedreno/ir3/ir3_shader.c | 6 | ||||
-rw-r--r-- | src/freedreno/vulkan/tu_pipeline.c | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 51715025561..1ae1dfd8e63 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -1268,7 +1268,7 @@ get_barycentric_centroid(struct ir3_context *ctx) struct ir3_instruction *xy[2]; struct ir3_instruction *ij; - ij = create_sysval_input(ctx, SYSTEM_VALUE_BARYCENTRIC_CENTROID, 0x3); + ij = create_sysval_input(ctx, SYSTEM_VALUE_BARYCENTRIC_PERSP_CENTROID, 0x3); ir3_split_dest(ctx->block, xy, ij, 0, 2); ctx->ij_centroid = ir3_create_collect(ctx, xy, 2); @@ -1284,7 +1284,7 @@ get_barycentric_sample(struct ir3_context *ctx) struct ir3_instruction *xy[2]; struct ir3_instruction *ij; - ij = create_sysval_input(ctx, SYSTEM_VALUE_BARYCENTRIC_SAMPLE, 0x3); + ij = create_sysval_input(ctx, SYSTEM_VALUE_BARYCENTRIC_PERSP_SAMPLE, 0x3); ir3_split_dest(ctx->block, xy, ij, 0, 2); ctx->ij_sample = ir3_create_collect(ctx, xy, 2); @@ -1509,7 +1509,7 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr) case nir_intrinsic_load_size_ir3: if (!ctx->ij_size) { ctx->ij_size = - create_sysval_input(ctx, SYSTEM_VALUE_BARYCENTRIC_SIZE, 0x1); + create_sysval_input(ctx, SYSTEM_VALUE_BARYCENTRIC_PERSP_SIZE, 0x1); } dst[0] = ctx->ij_size; break; @@ -3059,7 +3059,7 @@ emit_instructions(struct ir3_context *ctx) * because sysvals need to be appended after varyings: */ if (vcoord) { - add_sysval_input_compmask(ctx, SYSTEM_VALUE_BARYCENTRIC_PIXEL, + add_sysval_input_compmask(ctx, SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL, 0x3, vcoord); } @@ -3462,7 +3462,7 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler, int idx = 0; foreach_input(instr, ir) { - if (instr->input.sysval != SYSTEM_VALUE_BARYCENTRIC_PIXEL) + if (instr->input.sysval != SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL) continue; assert(idx < ARRAY_SIZE(precolor)); diff --git a/src/freedreno/ir3/ir3_depth.c b/src/freedreno/ir3/ir3_depth.c index d2ab9feaa45..f1f7b94b2fc 100644 --- a/src/freedreno/ir3/ir3_depth.c +++ b/src/freedreno/ir3/ir3_depth.c @@ -224,7 +224,7 @@ compute_depth_and_remove_unused(struct ir3 *ir, struct ir3_shader_variant *so) */ if (so->num_sampler_prefetch && (instr->opc == OPC_META_INPUT) && - (instr->input.sysval == SYSTEM_VALUE_BARYCENTRIC_PIXEL)) + (instr->input.sysval == SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL)) continue; instr->flags |= IR3_INSTR_UNUSED; } diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c index 3ee0617bf4b..559a017d747 100644 --- a/src/freedreno/ir3/ir3_shader.c +++ b/src/freedreno/ir3/ir3_shader.c @@ -470,11 +470,11 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin, FILE *out) break; case MESA_SHADER_FRAGMENT: dump_reg(out, "pos (ij_pixel)", - ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_PIXEL)); + ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL)); dump_reg(out, "pos (ij_centroid)", - ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_CENTROID)); + ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_PERSP_CENTROID)); dump_reg(out, "pos (ij_size)", - ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_SIZE)); + ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_PERSP_SIZE)); dump_output(out, so, FRAG_RESULT_DEPTH, "posz"); if (so->color0_mrt) { dump_output(out, so, FRAG_RESULT_COLOR, "color"); diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 0aff134637a..a0e22e7bce8 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -760,10 +760,10 @@ tu6_emit_fs_inputs(struct tu_cs *cs, const struct ir3_shader_variant *fs) face_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_FRONT_FACE); coord_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_FRAG_COORD); zwcoord_regid = VALIDREG(coord_regid) ? coord_regid + 2 : regid(63, 0); - ij_pix_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PIXEL); - ij_samp_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_SAMPLE); - ij_cent_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_CENTROID); - ij_size_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_SIZE); + ij_pix_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PERSP_PIXEL); + ij_samp_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PERSP_SAMPLE); + ij_cent_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PERSP_CENTROID); + ij_size_regid = ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PERSP_SIZE); if (fs->num_sampler_prefetch > 0) { assert(VALIDREG(ij_pix_regid)); |