From 3468fe86c07c18cf0d3ebc1acf6c0d07e2ff7a19 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 28 Oct 2016 13:26:03 -0400
Subject: [PATCH] P4 to Git Change 1333465 by gandryey@gera-w8 on 2016/10/28
13:16:32
SWDEV-95922 - OpenCL on PAL - GL/Depth interop
- Apply a workaround for interop with D24S8 format
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#16 edit
[ROCm/clr commit: 1b76bd77fe8b70445e0011dd9f32f16ab8efb5bf]
---
projects/clr/rocclr/runtime/device/pal/palresource.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/pal/palresource.cpp b/projects/clr/rocclr/runtime/device/pal/palresource.cpp
index e466cfe584..56691f4dee 100644
--- a/projects/clr/rocclr/runtime/device/pal/palresource.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palresource.cpp
@@ -698,7 +698,13 @@ Resource::create(MemoryType memType, CreateParams* params)
viewInfo.subresRange = ImgSubresRange;
dev().iDev()->CreateImageViewSrds(1, &viewInfo, hwState_);
-
+ //! It's a workaround for D24S8 format, since PAL doesn't support this format
+ //! and GSL decompresses 24bit DEPTH into D24S8 for OGL compatibility
+ if ((desc().format_.image_channel_order == CL_DEPTH_STENCIL) &&
+ (desc().format_.image_channel_data_type == CL_UNORM_INT24)) {
+ hwState_[1] &= ~0x3c000000;
+ hwState_[1] = (hwState_[1] & ~0x3f00000) | 0x1400000;
+ }
hwState_[8] = GetHSAILImageFormatType(desc().format_);
hwState_[9] = GetHSAILImageOrderType(desc().format_);
hwState_[10] = static_cast(desc().width_);