From 696b8cf85d9863924a7aaff606890db496de263f Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 17 Sep 2019 14:49:47 -0400
Subject: [PATCH] P4 to Git Change 1999652 by gandryey@gera-win10 on 2019/09/17
14:43:58
SWDEV-190672 - [AMF][OpenCL] OpenCL runtime uses wrong pitch value to 10bits format
- Add missing recognition of RGB10 format in GSL path
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudefs.hpp#160 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#250 edit
[ROCm/clr commit: f1ca6e457b229ef1baa0abf8a1a3a682f178ab8f]
---
projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp | 4 +++-
projects/clr/rocclr/runtime/device/gpu/gpuresource.cpp | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp b/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp
index f616bd6ef5..25f64f8a15 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpudefs.hpp
@@ -279,7 +279,7 @@ static const MemoryFormat MemoryFormatMap[] = {
// RGB
{{CL_RGB, CL_UNORM_INT_101010}, {GSL_CHANNEL_ORDER_RGB, CM_SURF_FMT_BGR10_X2}},
// RGBA
- {{CL_RGBA, CL_UNORM_INT_101010}, {GSL_CHANNEL_ORDER_RGB, CM_SURF_FMT_RGB10_X2}},
+ {{CL_RGBA, CL_UNORM_INT_101010}, {GSL_CHANNEL_ORDER_RGBA, CM_SURF_FMT_RGB10_X2}},
// RGBA
{{CL_RGBA, CL_UNORM_INT8}, {GSL_CHANNEL_ORDER_RGBA, CM_SURF_FMT_RGBA8}},
@@ -443,6 +443,8 @@ static const MemFormatStruct MemoryFormatSize[] = {
{CM_SURF_FMT_BGR10_X2, 4, 4}, /**< 4 component, unnormalized signed 10-bit integer value per
component packed as (@c XXRRRRRRRRRRGGGGGGGGGGBBBBBBBBBB)*/
+ {CM_SURF_FMT_RGB10_X2, 4, 4}, /**< 4 component, unnormalized signed 10-bit integer value per
+ component packed as (@c XXRRRRRRRRRRGGGGGGGGGGBBBBBBBBBB)*/
{CM_SURF_FMT_DEPTH32F, 4, 1}, /**< A one component, 32 float value per component */
{CM_SURF_FMT_DEPTH16, 2, 1}, /**< A one component, 16 unsigned int value per component */
{CM_SURF_FMT_DEPTH24_STEN8, 4, 1}, /**< A one component, 32 float value per component */
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuresource.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuresource.cpp
index 84b2f21630..6310e88a0b 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuresource.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuresource.cpp
@@ -183,6 +183,7 @@ static uint32_t GetHSAILImageFormatType(cmSurfFmt format) {
formatType = HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT16;
break;
case CM_SURF_FMT_BGR10_X2:
+ case CM_SURF_FMT_RGB10_X2:
formatType = HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_SHORT_101010;
break;
case CM_SURF_FMT_sR8I: