summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_nir_lower_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_nir_lower_io.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_nir_lower_io.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/gallium/drivers/vc4/vc4_nir_lower_io.c b/src/gallium/drivers/vc4/vc4_nir_lower_io.c
index 31ac64b..a98d70d 100644
--- a/src/gallium/drivers/vc4/vc4_nir_lower_io.c
+++ b/src/gallium/drivers/vc4/vc4_nir_lower_io.c
@@ -22,8 +22,6 @@
*/
#include "vc4_qir.h"
-#include "nir/tgsi_to_nir.h"
-#include "tgsi/tgsi_info.h"
#include "glsl/nir/nir_builder.h"
/**
@@ -72,11 +70,6 @@ vc4_nir_lower_input(struct vc4_compile *c, nir_builder *b,
}
}
assert(input_var);
- unsigned semantic_name, semantic_index;
-
- varying_slot_to_tgsi_semantic(input_var->data.location,
- &semantic_name, &semantic_index);
-
/* All TGSI-to-NIR inputs are vec4. */
assert(intr->num_components == 4);
@@ -96,8 +89,7 @@ vc4_nir_lower_input(struct vc4_compile *c, nir_builder *b,
switch (c->stage) {
case QSTAGE_FRAG:
- switch (semantic_name) {
- case TGSI_SEMANTIC_FACE:
+ if (input_var->data.location == VARYING_SLOT_FACE) {
dests[0] = nir_fsub(b,
nir_imm_float(b, 1.0),
nir_fmul(b,
@@ -106,10 +98,10 @@ vc4_nir_lower_input(struct vc4_compile *c, nir_builder *b,
dests[1] = nir_imm_float(b, 0.0);
dests[2] = nir_imm_float(b, 0.0);
dests[3] = nir_imm_float(b, 1.0);
- break;
- case TGSI_SEMANTIC_GENERIC:
+ } else if (input_var->data.location >= VARYING_SLOT_VAR0) {
if (c->fs_key->point_sprite_mask &
- (1 << semantic_index)) {
+ (1 << (input_var->data.location -
+ VARYING_SLOT_VAR0))) {
if (!c->fs_key->is_points) {
dests[0] = nir_imm_float(b, 0.0);
dests[1] = nir_imm_float(b, 0.0);
@@ -122,7 +114,6 @@ vc4_nir_lower_input(struct vc4_compile *c, nir_builder *b,
dests[2] = nir_imm_float(b, 0.0);
dests[3] = nir_imm_float(b, 1.0);
}
- break;
}
break;
case QSTAGE_COORD:
@@ -145,20 +136,18 @@ vc4_nir_lower_output(struct vc4_compile *c, nir_builder *b,
}
}
assert(output_var);
- unsigned semantic_name, semantic_index;
-
- varying_slot_to_tgsi_semantic(output_var->data.location,
- &semantic_name, &semantic_index);
if (c->stage == QSTAGE_COORD &&
- (semantic_name != TGSI_SEMANTIC_POSITION &&
- semantic_name != TGSI_SEMANTIC_PSIZE)) {
+ output_var->data.location != VARYING_SLOT_POS &&
+ output_var->data.location != VARYING_SLOT_PSIZ) {
nir_instr_remove(&intr->instr);
return;
}
/* Color output is lowered by vc4_nir_lower_blend(). */
- if (c->stage == QSTAGE_FRAG && semantic_name == TGSI_SEMANTIC_COLOR) {
+ if (c->stage == QSTAGE_FRAG &&
+ (output_var->data.location == FRAG_RESULT_COLOR ||
+ output_var->data.location == FRAG_RESULT_DATA0)) {
intr->const_index[0] *= 4;
return;
}