P4 to Git Change 1094113 by gandryey@gera-dev-w7 on 2014/11/05 18:22:34

ECR #304775 - CL-GL depth buffer interop
	- Make the changes necessary for the depth buffer interop support. Currently the extension is disabled, because the conformance tests have multiple bugs.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#45 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_memobj.cpp#71 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#231 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#197 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#292 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp#66 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#101 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDeviceGL.cpp#20 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#113 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#217 edit
Этот коммит содержится в:
foreman
2014-11-05 18:30:40 -05:00
родитель dd6074f047
Коммит b7ee1dd66b
8 изменённых файлов: 25 добавлений и 17 удалений
+1 -2
Просмотреть файл
@@ -584,13 +584,12 @@ public:
uint supportRA_: 1; //!< Support RA channel order format
uint largeHostMemAlloc_: 1; //!< Allow large host mem allocations (> maxSingleAlloc)
uint waitCommand_: 1; //!< Enables a wait for every submitted command
uint depthMSAAInterop_: 1; //!< Enable depth-stencil and MSAA interop CL-GL inteorp
uint customHostAllocator_: 1;//!< True if device has custom host allocator
// that replaces generic OS allocation routines
uint customSvmAllocator_: 1; //!< True if device has custom SVM allocator
uint supportDepthsRGB_: 1; //!< Support DEPTH and sRGB channel order format
uint assumeAliases_: 1; //!< Assume aliases in the compilation process
uint reserved_: 23;
uint reserved_: 24;
};
uint value_;
};
+13 -3
Просмотреть файл
@@ -243,8 +243,12 @@ static uint32_t GetHSAILImageFormatType(cmSurfFmt format)
case CM_SURF_FMT_RG32F:
case CM_SURF_FMT_RGBA32F:
case CM_SURF_FMT_DEPTH32F:
case CM_SURF_FMT_DEPTH32F_X24_STEN8:
formatType = HSA_EXT_IMAGE_CHANNEL_TYPE_FLOAT;
break;
case CM_SURF_FMT_DEPTH24_STEN8:
formatType = HSA_EXT_IMAGE_CHANNEL_TYPE_UNORM_INT24;
break;
default:
assert(false);
}
@@ -252,7 +256,7 @@ static uint32_t GetHSAILImageFormatType(cmSurfFmt format)
return formatType;
}
static uint32_t GetHSAILImageOrderType(gslChannelOrder chOrder)
static uint32_t GetHSAILImageOrderType(gslChannelOrder chOrder, cmSurfFmt format)
{
uint32_t orderType = HSA_EXT_IMAGE_CHANNEL_ORDER_A;
@@ -301,7 +305,13 @@ static uint32_t GetHSAILImageOrderType(gslChannelOrder chOrder)
orderType = HSA_EXT_IMAGE_CHANNEL_ORDER_LUMINANCE;
break;
case GSL_CHANNEL_ORDER_REPLICATE_R:
orderType = HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH;
if ((format == CM_SURF_FMT_DEPTH32F_X24_STEN8) ||
(format == CM_SURF_FMT_DEPTH24_STEN8)) {
orderType = HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH_STENCIL;
}
else {
orderType = HSA_EXT_IMAGE_CHANNEL_ORDER_DEPTH;
}
break;
default:
assert(false);
@@ -976,7 +986,7 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap)
}
dev().fillImageHwState(gslResource, hwState_, 8 * sizeof(uint32_t));
hwState_[8] = GetHSAILImageFormatType(cal()->format_);
hwState_[9] = GetHSAILImageOrderType(cal()->channelOrder_);
hwState_[9] = GetHSAILImageOrderType(cal()->channelOrder_, cal()->format_);
hwState_[10] = static_cast<uint32_t>(cal()->width_);
// Workaround for depth view, change tileIndex to 0 for depth view
if ((memoryType() == ImageView) &&
+3 -4
Просмотреть файл
@@ -345,9 +345,8 @@ Settings::create(
rectLinearDMA_ = true;
if (AMD_DEPTH_MSAA_INTEROP) {
enableExtension(ClKhrGLDepthImages);
depthMSAAInterop_ = true;
if (oclVersion_ >= OpenCL20) {
//enableExtension(ClKhrGLDepthImages);
}
if (AMD_THREAD_TRACE_ENABLE) {
threadTraceEnable_ = true;
@@ -445,7 +444,7 @@ Settings::create(
if (apuSystem_ &&
((calAttr.totalVisibleHeap + calAttr.totalInvisibleHeap) < 150)) {
remoteAlloc_ = true;
remoteAlloc_ = true;
}
// Override current device settings
+1
Просмотреть файл
@@ -300,6 +300,7 @@ CALGSLContext::setInput(uint32 physUnit, gslMemObject mem)
m_textureResources[physUnit], physUnit);
}
m_textureResources[physUnit]->updateDepthTextureParam(mem);
m_textureResources[physUnit]->setMemObject(m_cs, GSL_COMPUTE_PROGRAM, mem);
if (mem != NULL)
+1
Просмотреть файл
@@ -1701,6 +1701,7 @@ CALGSLDevice::fillImageHwState(gslMemObject mem, void* hwState, uint32 hwStateSi
amd::ScopedLock k(gslDeviceOps());
intp channelOrder = mem->getAttribs().channelOrder;
convertInputChannelOrder(&channelOrder);
m_textureResource->updateDepthTextureParam(mem);
m_textureResource->getTextureSrd(m_cs, mem, reinterpret_cast<const char*>(&channelOrder),
hwState, hwStateSize);
}
+2 -2
Просмотреть файл
@@ -82,8 +82,8 @@ static const cmFormatXlateParams cmFormatXlateTable [] = {
{CM_SURF_FMT_DEPTH24F_X8, (cmSurfFmt)500, GSL_CHANNEL_ORDER_R},
{CM_SURF_FMT_DEPTH24_STEN8, CM_SURF_FMT_DEPTH24_STEN8, GSL_CHANNEL_ORDER_REPLICATE_R},
{CM_SURF_FMT_DEPTH24F_STEN8, (cmSurfFmt)500, GSL_CHANNEL_ORDER_R},
{CM_SURF_FMT_DEPTH32F_X24_STEN8, CM_SURF_FMT_RG32I, GSL_CHANNEL_ORDER_REPLICATE_R},
{CM_SURF_FMT_DEPTH32F, CM_SURF_FMT_R32F, GSL_CHANNEL_ORDER_REPLICATE_R},
{CM_SURF_FMT_DEPTH32F_X24_STEN8, CM_SURF_FMT_DEPTH32F_X24_STEN8, GSL_CHANNEL_ORDER_REPLICATE_R},
{CM_SURF_FMT_DEPTH32F, CM_SURF_FMT_DEPTH32F, GSL_CHANNEL_ORDER_REPLICATE_R},
{CM_SURF_FMT_sR11_sG11_sB10, (cmSurfFmt)500, GSL_CHANNEL_ORDER_R},
{CM_SURF_FMT_sU16, CM_SURF_FMT_sU16, GSL_CHANNEL_ORDER_R},
{CM_SURF_FMT_sUV16, CM_SURF_FMT_sUV16, GSL_CHANNEL_ORDER_RG},
+4 -4
Просмотреть файл
@@ -1102,11 +1102,11 @@ Image::getSupportedFormats(
bool
Image::Format::isSupported(const Context& context, cl_mem_object_type image_type) const
{
bool supportDepthMSAA = true;
bool supportDepth = true;
const std::vector<amd::Device*>& devices = context.devices();
for (size_t i = 0; i < devices.size(); i++) {
if (!devices[i]->settings().depthMSAAInterop_) {
supportDepthMSAA = false;
if (!devices[i]->settings().checkExtension(ClKhrGLDepthImages)) {
supportDepth = false;
}
}
@@ -1129,7 +1129,7 @@ Image::Format::isSupported(const Context& context, cl_mem_object_type image_type
delete image_formats;
if (supportDepthMSAA) {
if (supportDepth) {
for (cl_uint i = 0; i < sizeof(depthFormats) / sizeof(cl_image_format); i++) {
if (*this == depthFormats[i]) {
return true;
-2
Просмотреть файл
@@ -152,8 +152,6 @@ release(bool, GPU_USE_DEVICE_QUEUE, false, \
"Use a dedicated device queue for the actual submissions") \
release(bool, GPU_ENABLE_LARGE_ALLOCATION, false, \
"Enable >4GB single allocations") \
release(bool, AMD_DEPTH_MSAA_INTEROP, false, \
"Enable depth stencil and MSAA buffer interop") \
release(bool, AMD_THREAD_TRACE_ENABLE, false, \
"Enable thread trace extension") \
release(uint, OPENCL_VERSION, 200, \