diff options
author | Timothy Arceri <[email protected]> | 2018-02-09 21:09:35 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-02-10 10:46:28 +1100 |
commit | ce836487b80e94fd91932c0a4bfadf1d61f74ded (patch) | |
tree | b87b737a3d72193de38605137a10c5ee013f7dca | |
parent | 6a8efbe652c328c2367476069ff1435c358e6f78 (diff) |
radeonsi/nir: add depth layout to scan pass
Reviewed-by: Samuel Pitoiset <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_nir.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 04d07381f5d..f467ce282af 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -279,6 +279,25 @@ void si_nir_scan_shader(const struct nir_shader *nir, if (nir->info.stage == MESA_SHADER_FRAGMENT) { info->properties[TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL] = nir->info.fs.early_fragment_tests; info->properties[TGSI_PROPERTY_FS_POST_DEPTH_COVERAGE] = nir->info.fs.post_depth_coverage; + + if (nir->info.fs.depth_layout != FRAG_DEPTH_LAYOUT_NONE) { + switch (nir->info.fs.depth_layout) { + case FRAG_DEPTH_LAYOUT_ANY: + info->properties[TGSI_PROPERTY_FS_DEPTH_LAYOUT] = TGSI_FS_DEPTH_LAYOUT_ANY; + break; + case FRAG_DEPTH_LAYOUT_GREATER: + info->properties[TGSI_PROPERTY_FS_DEPTH_LAYOUT] = TGSI_FS_DEPTH_LAYOUT_GREATER; + break; + case FRAG_DEPTH_LAYOUT_LESS: + info->properties[TGSI_PROPERTY_FS_DEPTH_LAYOUT] = TGSI_FS_DEPTH_LAYOUT_LESS; + break; + case FRAG_DEPTH_LAYOUT_UNCHANGED: + info->properties[TGSI_PROPERTY_FS_DEPTH_LAYOUT] = TGSI_FS_DEPTH_LAYOUT_UNCHANGED; + break; + default: + unreachable("Unknow depth layout"); + } + } } if (nir->info.stage == MESA_SHADER_COMPUTE) { |