From: Rob Clark Date: Wed, 3 Apr 2019 23:55:34 +0000 (-0400) Subject: compiler: rename SYSTEM_VALUE_VARYING_COORD X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4d08c1b595e36c0a8f64410b7328fc0c9b6cbeb6;p=mesa.git compiler: rename SYSTEM_VALUE_VARYING_COORD And add corresponding enums for different sorts of varying interpolation. Signed-off-by: Rob Clark --- diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c index 15ab6d81dae..451f1b758de 100644 --- a/src/compiler/shader_enums.c +++ b/src/compiler/shader_enums.c @@ -247,7 +247,10 @@ gl_system_value_name(gl_system_value sysval) ENUM(SYSTEM_VALUE_DEVICE_INDEX), ENUM(SYSTEM_VALUE_VIEW_INDEX), ENUM(SYSTEM_VALUE_VERTEX_CNT), - ENUM(SYSTEM_VALUE_VARYING_COORD), + ENUM(SYSTEM_VALUE_BARYCENTRIC_PIXEL), + ENUM(SYSTEM_VALUE_BARYCENTRIC_SAMPLE), + ENUM(SYSTEM_VALUE_BARYCENTRIC_CENTROID), + ENUM(SYSTEM_VALUE_BARYCENTRIC_SIZE), }; STATIC_ASSERT(ARRAY_SIZE(names) == SYSTEM_VALUE_MAX); return NAME(sysval); diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h index f9a4006f072..ac293af4519 100644 --- a/src/compiler/shader_enums.h +++ b/src/compiler/shader_enums.h @@ -621,10 +621,16 @@ typedef enum SYSTEM_VALUE_VERTEX_CNT, /** - * Driver internal varying-coord, used for varying-fetch instructions. + * Driver internal varying-coords, used for varying-fetch instructions. * Not externally visible. + * + * The _SIZE value is "primitive size", used to scale i/j in primitive + * space to pixel space. */ - SYSTEM_VALUE_VARYING_COORD, + SYSTEM_VALUE_BARYCENTRIC_PIXEL, + SYSTEM_VALUE_BARYCENTRIC_SAMPLE, + SYSTEM_VALUE_BARYCENTRIC_CENTROID, + SYSTEM_VALUE_BARYCENTRIC_SIZE, SYSTEM_VALUE_MAX /**< Number of values */ } gl_system_value; diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index e375f3c2421..41d297a4c33 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -2577,7 +2577,7 @@ emit_instructions(struct ir3_context *ctx) * because sysvals need to be appended after varyings: */ if (vcoord) { - add_sysval_input_compmask(ctx, SYSTEM_VALUE_VARYING_COORD, + add_sysval_input_compmask(ctx, SYSTEM_VALUE_BARYCENTRIC_PIXEL, 0x3, vcoord); } diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c index b2329899bac..03c3e31f913 100644 --- a/src/freedreno/ir3/ir3_shader.c +++ b/src/freedreno/ir3/ir3_shader.c @@ -408,7 +408,7 @@ ir3_shader_disasm(struct ir3_shader_variant *so, uint32_t *bin, FILE *out) break; case MESA_SHADER_FRAGMENT: dump_reg(out, "pos (bary)", - ir3_find_sysval_regid(so, SYSTEM_VALUE_VARYING_COORD)); + ir3_find_sysval_regid(so, SYSTEM_VALUE_BARYCENTRIC_PIXEL)); 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 2df032923cf..d5daa12ddea 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -690,7 +690,7 @@ tu6_emit_fs_system_values(struct tu_cs *cs, ? (fragcoord_xy_regid + 2) : fragcoord_xy_regid; const uint32_t varyingcoord_regid = - ir3_find_sysval_regid(fs, SYSTEM_VALUE_VARYING_COORD); + ir3_find_sysval_regid(fs, SYSTEM_VALUE_BARYCENTRIC_PIXEL); tu_cs_emit_pkt4(cs, REG_A6XX_HLSQ_CONTROL_1_REG, 5); tu_cs_emit(cs, 0x7); diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_program.c b/src/gallium/drivers/freedreno/a3xx/fd3_program.c index 7df1f77a3ca..af7f19d59ba 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_program.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_program.c @@ -211,7 +211,7 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit, face_regid = ir3_find_sysval_regid(fp, SYSTEM_VALUE_FRONT_FACE); coord_regid = ir3_find_sysval_regid(fp, SYSTEM_VALUE_FRAG_COORD); zwcoord_regid = (coord_regid == regid(63,0)) ? regid(63,0) : (coord_regid + 2); - vcoord_regid = ir3_find_sysval_regid(fp, SYSTEM_VALUE_VARYING_COORD); + vcoord_regid = ir3_find_sysval_regid(fp, SYSTEM_VALUE_BARYCENTRIC_PIXEL); /* adjust regids for alpha output formats. there is no alpha render * format, so it's just treated like red diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_program.c b/src/gallium/drivers/freedreno/a4xx/fd4_program.c index 2d230faff19..5fa1f8e0200 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_program.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_program.c @@ -245,7 +245,7 @@ fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit, face_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRONT_FACE); coord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRAG_COORD); zwcoord_regid = (coord_regid == regid(63,0)) ? regid(63,0) : (coord_regid + 2); - vcoord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_VARYING_COORD); + vcoord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_BARYCENTRIC_PIXEL); /* we could probably divide this up into things that need to be * emitted if frag-prog is dirty vs if vert-prog is dirty.. diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_program.c b/src/gallium/drivers/freedreno/a5xx/fd5_program.c index 3dba15fc56a..918c6585ac4 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_program.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_program.c @@ -357,7 +357,7 @@ fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring, face_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRONT_FACE); coord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRAG_COORD); zwcoord_regid = (coord_regid == regid(63,0)) ? regid(63,0) : (coord_regid + 2); - vcoord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_VARYING_COORD); + vcoord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_BARYCENTRIC_PIXEL); /* we could probably divide this up into things that need to be * emitted if frag-prog is dirty vs if vert-prog is dirty.. diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c index 44c9e8a689b..3c4192ba19a 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c @@ -337,7 +337,7 @@ setup_stateobj(struct fd_ringbuffer *ring, face_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRONT_FACE); coord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_FRAG_COORD); zwcoord_regid = next_regid(coord_regid, 2); - vcoord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_VARYING_COORD); + vcoord_regid = ir3_find_sysval_regid(s[FS].v, SYSTEM_VALUE_BARYCENTRIC_PIXEL); posz_regid = ir3_find_output_regid(s[FS].v, FRAG_RESULT_DEPTH); /* we could probably divide this up into things that need to be diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 37e78406c5c..f2344703d71 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -5827,7 +5827,10 @@ _mesa_sysval_to_semantic(unsigned sysval) case SYSTEM_VALUE_LOCAL_INVOCATION_INDEX: case SYSTEM_VALUE_GLOBAL_INVOCATION_ID: case SYSTEM_VALUE_VERTEX_CNT: - case SYSTEM_VALUE_VARYING_COORD: + case SYSTEM_VALUE_BARYCENTRIC_PIXEL: + case SYSTEM_VALUE_BARYCENTRIC_SAMPLE: + case SYSTEM_VALUE_BARYCENTRIC_CENTROID: + case SYSTEM_VALUE_BARYCENTRIC_SIZE: default: assert(!"Unexpected SYSTEM_VALUE_ enum"); return TGSI_SEMANTIC_COUNT;