P4 to Git Change 1126532 by gandryey@gera-dev-w7 on 2015/03/02 17:19:16

ECR #304775 - Don't report depth stencil write support

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl.cpp#46 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_gl_amd.hpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#117 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#88 edit


[ROCm/clr commit: 006d563073]
This commit is contained in:
foreman
2015-03-02 17:54:56 -05:00
vanhempi d88974c144
commit 7e798ff57e
2 muutettua tiedostoa jossa 19 lisäystä ja 18 poistoa
@@ -1029,7 +1029,9 @@ Image::numSupportedFormats(const Context& context, cl_mem_object_type image_type
}
if (supportDepthStencil) {
numFormats += sizeof(supportedDepthStencilFormats) / sizeof(cl_image_format);
if (flags & CL_MEM_READ_ONLY) {
numFormats += sizeof(supportedDepthStencilFormats) / sizeof(cl_image_format);
}
}
return numFormats;
@@ -1058,7 +1060,8 @@ Image::getSupportedFormats(
if (devices[i]->settings().supportDepthsRGB_) {
supportDepthsRGB = true;
}
if (devices[i]->settings().checkExtension(ClKhrGLDepthImages)) {
if (devices[i]->settings().checkExtension(ClKhrGLDepthImages) &&
(context.info().flags_ & Context::GLDeviceKhr)) {
supportDepthStencil = true;
}
}
@@ -1113,38 +1116,35 @@ Image::getSupportedFormats(
}
if (supportDepthStencil) {
for (uint i = 0; i < sizeof(supportedDepthStencilFormats) / sizeof(cl_image_format); i++) {
if (numFormats == num_entries) {
break;
if (flags & CL_MEM_READ_ONLY) {
for (uint i = 0; i < sizeof(supportedDepthStencilFormats) / sizeof(cl_image_format); i++) {
if (numFormats == num_entries) {
break;
}
*format++ = amd::Image::supportedDepthStencilFormats[i];
numFormats++;
}
*format++ = amd::Image::supportedDepthStencilFormats[i];
}
}
return numFormats;
}
bool
Image::Format::isSupported(const Context& context, cl_mem_object_type image_type) const
Image::Format::isSupported(const Context& context,
cl_mem_object_type image_type, cl_mem_flags flags) const
{
uint numFormats = numSupportedFormats(context, image_type) ;
uint numFormats = numSupportedFormats(context, image_type, flags) ;
cl_image_format *image_formats = new cl_image_format[numFormats];
std::vector<cl_image_format> image_formats(numFormats);
if (image_formats == NULL) {
return false;
}
getSupportedFormats(context, image_type, numFormats, image_formats) ;
getSupportedFormats(context, image_type, numFormats, image_formats.data(), flags);
for (uint i = 0; i < numFormats; i++) {
if (*this == image_formats[i]) {
delete image_formats;
return true;
}
}
delete image_formats;
return false;
}
@@ -465,7 +465,8 @@ public:
bool isValid() const;
//! Returns true if this format is supported by runtime, false otherwise
bool isSupported(const Context& context, cl_mem_object_type image_type=0) const;
bool isSupported(const Context& context,
cl_mem_object_type image_type = 0, cl_mem_flags flags = 0) const;
//! Compare 2 image formats.
bool operator == (const Format& rhs) const {