Discussion:
[PATCH] radv/gfx9: use correct stencil format for tc compat htile.
Add Reply
Dave Airlie
2017-12-27 01:24:28 UTC
Reply
Permalink
Raw Message
From: Dave Airlie <***@redhat.com>

This needs to correspond to the bit depth of the Z plane.

noticed in passing reading amdvlk.

Signed-off-by: Dave Airlie <***@redhat.com>
---
src/amd/vulkan/radv_image.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 219f641c73..2c990c8f22 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -419,9 +419,12 @@ si_make_texture_descriptor(struct radv_device *device,
/* S8 with Z32 HTILE needs a special format. */
if (device->physical_device->rad_info.chip_class >= GFX9 &&
vk_format == VK_FORMAT_S8_UINT &&
- image->tc_compatible_htile)
- data_format = V_008F14_IMG_DATA_FORMAT_S8_32;
-
+ image->tc_compatible_htile) {
+ if (image->vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT)
+ data_format = V_008F14_IMG_DATA_FORMAT_S8_32;
+ else if (image->vk_format == VK_FORMAT_D16_UNORM_S8_UINT)
+ data_format = V_008F14_IMG_DATA_FORMAT_S8_16;
+ }
type = radv_tex_dim(image->type, view_type, image->info.array_size, image->info.samples,
is_storage_image, device->physical_device->rad_info.chip_class >= GFX9);
if (type == V_008F1C_SQ_RSRC_IMG_1D_ARRAY) {
--
2.14.3
Bas Nieuwenhuizen
2017-12-27 11:16:10 UTC
Reply
Permalink
Raw Message
Post by Dave Airlie
This needs to correspond to the bit depth of the Z plane.
noticed in passing reading amdvlk.
---
src/amd/vulkan/radv_image.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 219f641c73..2c990c8f22 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -419,9 +419,12 @@ si_make_texture_descriptor(struct radv_device *device,
/* S8 with Z32 HTILE needs a special format. */
if (device->physical_device->rad_info.chip_class >= GFX9 &&
vk_format == VK_FORMAT_S8_UINT &&
- image->tc_compatible_htile)
- data_format = V_008F14_IMG_DATA_FORMAT_S8_32;
-
+ image->tc_compatible_htile) {
+ if (image->vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT)
+ data_format = V_008F14_IMG_DATA_FORMAT_S8_32;
+ else if (image->vk_format == VK_FORMAT_D16_UNORM_S8_UINT)
+ data_format = V_008F14_IMG_DATA_FORMAT_S8_16;
+ }
type = radv_tex_dim(image->type, view_type, image->info.array_size, image->info.samples,
is_storage_image, device->physical_device->rad_info.chip_class >= GFX9);
if (type == V_008F1C_SQ_RSRC_IMG_1D_ARRAY) {
--
2.14.3
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Samuel Pitoiset
2017-12-27 17:31:41 UTC
Reply
Permalink
Raw Message
Post by Dave Airlie
This needs to correspond to the bit depth of the Z plane.
noticed in passing reading amdvlk.
---
src/amd/vulkan/radv_image.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 219f641c73..2c990c8f22 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -419,9 +419,12 @@ si_make_texture_descriptor(struct radv_device *device,
/* S8 with Z32 HTILE needs a special format. */
Can you update the comment?
Post by Dave Airlie
if (device->physical_device->rad_info.chip_class >= GFX9 &&
vk_format == VK_FORMAT_S8_UINT &&
- image->tc_compatible_htile)
- data_format = V_008F14_IMG_DATA_FORMAT_S8_32;
-
+ image->tc_compatible_htile) {
+ if (image->vk_format == VK_FORMAT_D32_SFLOAT_S8_UINT)
+ data_format = V_008F14_IMG_DATA_FORMAT_S8_32;
+ else if (image->vk_format == VK_FORMAT_D16_UNORM_S8_UINT)
+ data_format = V_008F14_IMG_DATA_FORMAT_S8_16;
+ }
type = radv_tex_dim(image->type, view_type, image->info.array_size, image->info.samples,
is_storage_image, device->physical_device->rad_info.chip_class >= GFX9);
if (type == V_008F1C_SQ_RSRC_IMG_1D_ARRAY) {
Loading...