P4 to Git Change 1057445 by rili@rili_opencl_stg on 2014/07/21 14:11:34
EPR #399808 - Add CL_RGB, CL_UNORM_INT_101010 support
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpublit.cpp#105 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudefs.hpp#111 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#186 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#106 edit
[ROCm/clr commit: 1b9e65b27b]
Esse commit está contido em:
@@ -917,6 +917,7 @@ static const FormatConvertion RejectedData[] =
|
||||
{ CL_FLOAT, CL_UNSIGNED_INT32 },
|
||||
{ CL_SIGNED_INT8, CL_UNSIGNED_INT8 },
|
||||
{ CL_SIGNED_INT16, CL_UNSIGNED_INT16 },
|
||||
{ CL_UNORM_INT_101010, CL_UNSIGNED_INT8 },
|
||||
{ CL_SIGNED_INT32, CL_UNSIGNED_INT32 }
|
||||
};
|
||||
|
||||
@@ -927,6 +928,7 @@ static const FormatConvertion RejectedOrder[] =
|
||||
{ CL_RA, CL_RG },
|
||||
{ CL_LUMINANCE, CL_R },
|
||||
{ CL_INTENSITY, CL_R },
|
||||
{ CL_RGB, CL_RGBA },
|
||||
{ CL_BGRA, CL_RGBA },
|
||||
{ CL_ARGB, CL_RGBA },
|
||||
{ CL_sRGB, CL_RGBA },
|
||||
|
||||
@@ -259,6 +259,12 @@ MemoryFormatMap[] = {
|
||||
{ { CL_RA, CL_FLOAT },
|
||||
{ GSL_CHANNEL_ORDER_RA, CM_SURF_FMT_RG32F } },
|
||||
|
||||
// RGB
|
||||
{ { CL_RGB, CL_UNORM_INT_101010 },
|
||||
{ GSL_CHANNEL_ORDER_RGB, CM_SURF_FMT_BGR10_X2 } },
|
||||
{ { CL_RGB, CL_UNSIGNED_INT8 }, // This is used only by blit kernel
|
||||
{ GSL_CHANNEL_ORDER_RGBA, CM_SURF_FMT_RGBA8UI } },
|
||||
|
||||
// RGBA
|
||||
{ { CL_RGBA, CL_UNORM_INT8 },
|
||||
{ GSL_CHANNEL_ORDER_RGBA, CM_SURF_FMT_RGBA8 } },
|
||||
@@ -427,6 +433,7 @@ MemoryFormatSize[] = {
|
||||
{ CM_SURF_FMT_RG16F, 4, 2 }, /**< A 2 component, 16-bit float value per component */
|
||||
{ CM_SURF_FMT_RGBA16F, 8, 4 }, /**< A 4 component, 16-bit float value per component */
|
||||
|
||||
{ CM_SURF_FMT_BGR10_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 */
|
||||
|
||||
@@ -197,6 +197,9 @@ static uint32_t GetHSAILImageFormatType(cmSurfFmt format)
|
||||
formatType = 6;
|
||||
break;
|
||||
*/
|
||||
case CM_SURF_FMT_BGR10_X2:
|
||||
formatType = 7;
|
||||
break;
|
||||
case CM_SURF_FMT_sR8:
|
||||
case CM_SURF_FMT_sRG8:
|
||||
case CM_SURF_FMT_sRGBA8:
|
||||
@@ -285,6 +288,9 @@ static uint32_t GetHSAILImageOrderType(gslChannelOrder chOrder)
|
||||
case HSA_IMAGE_FMT_R10G10B10_UNORM:
|
||||
orderType = 6;
|
||||
break;*/
|
||||
case GSL_CHANNEL_ORDER_RGB:
|
||||
orderType = 7;
|
||||
break;
|
||||
case GSL_CHANNEL_ORDER_RGBA:
|
||||
orderType = 8;
|
||||
break;
|
||||
|
||||
@@ -760,6 +760,8 @@ Image::Format::getElementSize() const
|
||||
break;
|
||||
|
||||
case CL_UNORM_INT_101010:
|
||||
bytesPerPixel = 4;
|
||||
break;
|
||||
case CL_SIGNED_INT32:
|
||||
case CL_UNSIGNED_INT32:
|
||||
case CL_FLOAT:
|
||||
@@ -916,6 +918,9 @@ Image::supportedFormats[] = {
|
||||
|
||||
{CL_RG, CL_HALF_FLOAT}, {CL_RG, CL_FLOAT},
|
||||
|
||||
// RGB
|
||||
{CL_RGB, CL_UNORM_INT_101010},
|
||||
|
||||
// RGBA
|
||||
{CL_RGBA, CL_SNORM_INT8}, {CL_RGBA, CL_SNORM_INT16},
|
||||
{CL_RGBA, CL_UNORM_INT8}, {CL_RGBA, CL_UNORM_INT16},
|
||||
@@ -1334,9 +1339,9 @@ Image::Format::formatColor(const void* colorRGBA, void* colorFormat) const
|
||||
|
||||
union t101010 {
|
||||
struct {
|
||||
uint32_t r_: 10;
|
||||
uint32_t g_: 10;
|
||||
uint32_t b_: 10;
|
||||
uint32_t g_: 10;
|
||||
uint32_t r_: 10;
|
||||
uint32_t a_: 2;
|
||||
};
|
||||
uint32_t rgba_;
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário