summaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-07-06 15:48:46 -0700
committerEric Anholt <[email protected]>2018-07-09 11:48:32 -0700
commitbeeb94402f9d33081147c88de2b9d4c4ea24e842 (patch)
tree16b9c11668b6a0fe39c667b229aebceb8dfd2a01 /src/broadcom
parent4b4795be9de7a73ebc89916753d18a2d0f2ef7a3 (diff)
v3d: Implement noperspective varyings on V3D 4.x.
Fixes a bunch of piglit interpolation tests, and reduces my concern about some MSAA blit shaders with noperspective varyings.
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/cle/v3d_packet_v33.xml2
-rw-r--r--src/broadcom/compiler/nir_to_vir.c4
-rw-r--r--src/broadcom/compiler/v3d_compiler.h4
-rw-r--r--src/broadcom/compiler/vir.c3
4 files changed, 9 insertions, 4 deletions
diff --git a/src/broadcom/cle/v3d_packet_v33.xml b/src/broadcom/cle/v3d_packet_v33.xml
index f93b8245dce..eef29dab30d 100644
--- a/src/broadcom/cle/v3d_packet_v33.xml
+++ b/src/broadcom/cle/v3d_packet_v33.xml
@@ -668,7 +668,7 @@
<packet code="100" name="Non-perspective Flags" min_ver="41">
<field name="Non-perspective Flags for varyings V0*24" size="24" start="8" type="uint"/>
<field name="Action for Non-perspective Flags of higher numbered varyings" size="2" start="6" type="Varying Flags Action"/>
- <field name="Action for Non-perspectivey Flags of lower numbered varyings" size="2" start="4" type="Varying Flags Action"/>
+ <field name="Action for Non-perspective Flags of lower numbered varyings" size="2" start="4" type="Varying Flags Action"/>
<field name="Varying offset V0" size="4" start="0" type="uint"/>
</packet>
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c
index 89e4bc9fafa..426b41e2be8 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -443,9 +443,7 @@ emit_fragment_varying(struct v3d_compile *c, nir_variable *var,
return vir_FADD(c, vir_FMUL(c, vary, c->payload_w), r5);
}
case INTERP_MODE_NOPERSPECTIVE:
- /* C appears after the mov from the varying.
- XXX: improve ldvary setup.
- */
+ BITSET_SET(c->noperspective_flags, i);
return vir_FADD(c, vir_MOV(c, vary), r5);
case INTERP_MODE_FLAT:
BITSET_SET(c->flat_shade_flags, i);
diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h
index 24af18e8f9e..f3e3875c87c 100644
--- a/src/broadcom/compiler/v3d_compiler.h
+++ b/src/broadcom/compiler/v3d_compiler.h
@@ -476,6 +476,8 @@ struct v3d_compile {
*/
uint32_t flat_shade_flags[BITSET_WORDS(V3D_MAX_FS_INPUTS)];
+ uint32_t noperspective_flags[BITSET_WORDS(V3D_MAX_FS_INPUTS)];
+
uint32_t centroid_flags[BITSET_WORDS(V3D_MAX_FS_INPUTS)];
bool uses_center_w;
@@ -659,6 +661,8 @@ struct v3d_fs_prog_data {
*/
uint32_t flat_shade_flags[((V3D_MAX_FS_INPUTS - 1) / 24) + 1];
+ uint32_t noperspective_flags[((V3D_MAX_FS_INPUTS - 1) / 24) + 1];
+
uint32_t centroid_flags[((V3D_MAX_FS_INPUTS - 1) / 24) + 1];
bool writes_z;
diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c
index 2754924e6c1..ee0f329040e 100644
--- a/src/broadcom/compiler/vir.c
+++ b/src/broadcom/compiler/vir.c
@@ -759,6 +759,9 @@ v3d_set_fs_prog_data_inputs(struct v3d_compile *c,
if (BITSET_TEST(c->flat_shade_flags, i))
prog_data->flat_shade_flags[i / 24] |= 1 << (i % 24);
+ if (BITSET_TEST(c->noperspective_flags, i))
+ prog_data->noperspective_flags[i / 24] |= 1 << (i % 24);
+
if (BITSET_TEST(c->centroid_flags, i))
prog_data->centroid_flags[i / 24] |= 1 << (i % 24);
}