From 3f05dba83fc96ea17ddafda17374ea4c81e8a4a4 Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 11 Sep 2018 03:58:48 -0400
Subject: [PATCH] P4 to Git Change 1603998 by eboumaou@eboumaou_ugl_stg on
2018/09/11 03:45:45
SWDEV-164509 - [Dassault][Catia] Adding 8-bits internal format support for sL8 format in OpenGL
For glTextureView support, GL_LUMINANCE8 internal format needs to return 8_BITS view compatibility class.
Add 3 new surface formats, CM_SURF_FMT_L8_SRGB, CM_SURF_FMT_R8_SRGB and CM_SURF_FMT_RG8_SRGB. For the moment, only L8_SRGB is supported by GLL.
Keep L8_X24_SRGB format because of side effects, especially outside the GL driver (CAL)
ReviewBoardURL = http://ocltc.amd.com/reviews/r/15757/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp#32 edit
[ROCm/clr commit: 8914124cc8220cf2d29afa57f940ae88656792d3]
---
.../runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp
index 6c3ad49e37..0567fac016 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp
@@ -237,6 +237,9 @@ static const cmFormatXlateParams cmFormatXlateTable [] = {
{CM_SURF_FMT_L8_X16_A8_SRGB, (cmSurfFmt)500, GSL_CHANNEL_ORDER_RGBA},
{CM_SURF_FMT_L8_X24_SRGB, (cmSurfFmt)500, GSL_CHANNEL_ORDER_RGBA},
{CM_SURF_FMT_STENCIL8, CM_SURF_FMT_R8I, GSL_CHANNEL_ORDER_R},
+ {CM_SURF_FMT_L8_SRGB, (cmSurfFmt)500, GSL_CHANNEL_ORDER_R},
+ {CM_SURF_FMT_R8_SRGB, (cmSurfFmt)500, GSL_CHANNEL_ORDER_R},
+ {CM_SURF_FMT_RG8_SRGB, (cmSurfFmt)500, GSL_CHANNEL_ORDER_RG},
};
FINLINE void
@@ -469,6 +472,9 @@ dummyAssertIfCmSurfFmtChanges(void)
COMPILE_TIME_ASSERT(219 == CM_SURF_FMT_L8_X16_A8_SRGB);
COMPILE_TIME_ASSERT(220 == CM_SURF_FMT_L8_X24_SRGB);
COMPILE_TIME_ASSERT(221 == CM_SURF_FMT_STENCIL8);
+ COMPILE_TIME_ASSERT(222 == CM_SURF_FMT_L8_SRGB);
+ COMPILE_TIME_ASSERT(223 == CM_SURF_FMT_R8_SRGB);
+ COMPILE_TIME_ASSERT(224 == CM_SURF_FMT_RG8_SRGB);
#else
COMPILE_TIME_ASSERT(126 == CM_SURF_FMT_sRGBX32I);
COMPILE_TIME_ASSERT(127 == CM_SURF_FMT_sALPHA32I);
@@ -565,8 +571,11 @@ dummyAssertIfCmSurfFmtChanges(void)
COMPILE_TIME_ASSERT(218 == CM_SURF_FMT_L8_X16_A8_SRGB);
COMPILE_TIME_ASSERT(219 == CM_SURF_FMT_L8_X24_SRGB);
COMPILE_TIME_ASSERT(220 == CM_SURF_FMT_STENCIL8);
+ COMPILE_TIME_ASSERT(221 == CM_SURF_FMT_L8_SRGB);
+ COMPILE_TIME_ASSERT(222 == CM_SURF_FMT_R8_SRGB);
+ COMPILE_TIME_ASSERT(223 == CM_SURF_FMT_RG8_SRGB);
#endif
- COMPILE_TIME_ASSERT(cmSurfFmt_LAST == CM_SURF_FMT_STENCIL8);
+ COMPILE_TIME_ASSERT(cmSurfFmt_LAST == CM_SURF_FMT_RG8_SRGB);
COMPILE_TIME_ASSERT(cmSurfFmt_LAST < 501);
}