aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorArcady Goldmints-Orlov <[email protected]>2020-05-07 19:34:56 -0500
committerArcady Goldmints-Orlov <[email protected]>2020-06-19 20:24:11 -0500
commit04f77595f0bb5adc31e9e0ff2114c1ed5b60371d (patch)
tree5662b41a6d014df380c7655999931abec024a57a /src/intel
parent19b2ac2bb9e1ddc22956920d661f0e47aa49d718 (diff)
intel/compiler: Always apply sample mask on Vulkan.
With OpenGL, shader writes to the sample mask are ignored when not rendering to a multisample render target. However, on Vulkan, writes to the sample mask have still have their effect in that case. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3016 Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5156>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/compiler/brw_compiler.h1
-rw-r--r--src/intel/compiler/brw_fs.cpp4
-rw-r--r--src/intel/vulkan/anv_pipeline.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h
index 963d8fa2fc8..d5ec740225e 100644
--- a/src/intel/compiler/brw_compiler.h
+++ b/src/intel/compiler/brw_compiler.h
@@ -457,6 +457,7 @@ struct brw_wm_prog_key {
bool high_quality_derivatives:1;
bool force_dual_color_blend:1;
bool coherent_fb_fetch:1;
+ bool ignore_sample_mask_out:1;
uint8_t color_outputs_valid;
uint64_t input_slots_valid;
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index a41d15270b9..d3dc1f45110 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -8565,8 +8565,8 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
*/
prog_data->uses_kill = shader->info.fs.uses_discard ||
key->alpha_test_func;
- prog_data->uses_omask = key->multisample_fbo &&
- shader->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK);
+ prog_data->uses_omask = !key->ignore_sample_mask_out &&
+ (shader->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_SAMPLE_MASK));
prog_data->computed_depth_mode = computed_depth_mode(shader);
prog_data->computed_stencil =
shader->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_STENCIL);
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 9ddb2ebabeb..856c018d10e 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -516,6 +516,8 @@ populate_wm_prog_key(const struct gen_device_info *devinfo,
/* XXX Vulkan doesn't appear to specify */
key->clamp_fragment_color = false;
+ key->ignore_sample_mask_out = false;
+
assert(subpass->color_count <= MAX_RTS);
for (uint32_t i = 0; i < subpass->color_count; i++) {
if (subpass->color_attachments[i].attachment != VK_ATTACHMENT_UNUSED)