summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-17 13:23:45 -0800
committerKenneth Graunke <[email protected]>2016-02-26 15:55:59 -0800
commitb3cb6e78aa219ad73c145a25ee1bb48fd8b025d0 (patch)
treeaa6c103d2e1957cf11c63f5dedb0f1d640e3d8a2 /src
parent7428e6f86ab5022ba07f562e124642245c63a72f (diff)
i965/nir: Do lower_io late for fragment shaders
The Vulkan driver wants to be able to delete fragment outputs that are beyond key.nr_color_regions; this is a lot easier if we lower outputs at specialization time rather than link time. (Rationale added to commit message by Ken) Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp1
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index b5060408d95..6c9ba36a696 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -5594,6 +5594,7 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
nir_shader *shader = nir_shader_clone(mem_ctx, src_shader);
shader = brw_nir_apply_sampler_key(shader, compiler->devinfo, &key->tex,
true);
+ shader = brw_nir_lower_io(shader, compiler->devinfo, true, false, NULL);
shader = brw_postprocess_nir(shader, compiler->devinfo, true);
/* key->alpha_test_func means simulating alpha testing via discards,
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index 41059b3227e..61acf38988c 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -627,7 +627,8 @@ brw_create_nir(struct brw_context *brw,
if (nir->stage != MESA_SHADER_VERTEX &&
nir->stage != MESA_SHADER_TESS_CTRL &&
- nir->stage != MESA_SHADER_TESS_EVAL) {
+ nir->stage != MESA_SHADER_TESS_EVAL &&
+ nir->stage != MESA_SHADER_FRAGMENT) {
nir = brw_nir_lower_io(nir, devinfo, is_scalar, false, NULL);
}