aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3/ir3_nir.c
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2019-10-10 17:17:10 -0700
committerKristian H. Kristensen <[email protected]>2019-10-17 13:43:53 -0700
commit8e16fb152813d13121d13710f72ecce009c1885e (patch)
treee85c93fd326b3b0f724011607d85b8f4a77d0f77 /src/freedreno/ir3/ir3_nir.c
parent8f39985b01b34cbb6a84b4614f5cb732748954d1 (diff)
freedreno/ir3: Implement lowering passes for VS and GS
This introduces two new lowering passes. One to lower VS to explicit outputs using STLW and one to lower GS to load input using LDLW and implement the GS specific functionality. Signed-off-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/freedreno/ir3/ir3_nir.c')
-rw-r--r--src/freedreno/ir3/ir3_nir.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c
index 2f95b249c26..103821cd6b3 100644
--- a/src/freedreno/ir3/ir3_nir.c
+++ b/src/freedreno/ir3/ir3_nir.c
@@ -101,7 +101,8 @@ ir3_key_lowers_nir(const struct ir3_shader_key *key)
return key->fsaturate_s | key->fsaturate_t | key->fsaturate_r |
key->vsaturate_s | key->vsaturate_t | key->vsaturate_r |
key->ucp_enables | key->color_two_side |
- key->fclamp_color | key->vclamp_color;
+ key->fclamp_color | key->vclamp_color |
+ key->has_gs;
}
#define OPT(nir, pass, ...) ({ \
@@ -186,6 +187,19 @@ ir3_optimize_nir(struct ir3_shader *shader, nir_shader *s,
.lower_tg4_offsets = true,
};
+ if (key && key->has_gs) {
+ switch (shader->type) {
+ case MESA_SHADER_VERTEX:
+ NIR_PASS_V(s, ir3_nir_lower_vs_to_explicit_io, shader);
+ break;
+ case MESA_SHADER_GEOMETRY:
+ NIR_PASS_V(s, ir3_nir_lower_gs, shader);
+ break;
+ default:
+ break;
+ }
+ }
+
if (key) {
switch (shader->type) {
case MESA_SHADER_FRAGMENT: