SWDEV-465162 - Fix some issue with image support

Fix some small issues regarding image and mipmap support

Change-Id: I8e64223d44f37c2dbb115cbb343441a48021ba7b
This commit is contained in:
taosang2
2024-06-10 17:11:08 -04:00
committed by Tao Sang
orang tua 544c45364f
melakukan 1566ff7639
3 mengubah file dengan 18 tambahan dan 5 penghapusan
+1 -1
Melihat File
@@ -921,7 +921,7 @@ amd::Image* ihipImageCreate(const cl_channel_order channelOrder,
const std::vector<amd::Device*>& devices = context.devices();
if (!devices[0]->info().imageSupport_) {
LogPrintfError("Device: 0x%x does not support image", devices[0]);
status = hipErrorInvalidValue;
status = hipErrorNotSupported;
return nullptr;
}
+16 -3
Melihat File
@@ -110,9 +110,22 @@ hipError_t ihipCreateTextureObject(hipTextureObject_t* pTexObject,
// If hipResourceDesc::resType is set to hipResourceTypeMipmappedArray,
// hipResourceDesc::res::mipmap::mipmap must be set to a valid HIP mipmapped array handle
// and hipTextureDesc::normalizedCoords must be set to true.
if ((pResDesc->resType == hipResourceTypeMipmappedArray) &&
((pResDesc->res.mipmap.mipmap == nullptr) || (pTexDesc->normalizedCoords == 0))) {
return hipErrorInvalidValue;
if (pResDesc->resType == hipResourceTypeMipmappedArray) {
bool mipMapSupport = true;
amd::Context& context = *hip::getCurrentDevice()->asContext();
const std::vector<amd::Device*>& devices = context.devices();
for (auto& dev : devices) {
if (!dev->settings().checkExtension(ClKhrMipMapImage)) {
mipMapSupport = false; // Now PAL-backend can support mipmap, Rocm-backend cannot.
}
}
if (mipMapSupport == false) {
LogInfo("Mipmap not supported on the device");
return hipErrorNotSupported;
}
if (pResDesc->res.mipmap.mipmap == nullptr || pTexDesc->normalizedCoords == 0) {
return hipErrorInvalidValue;
}
}
// If hipResourceDesc::resType is set to hipResourceTypeLinear,
+1 -1
Melihat File
@@ -393,7 +393,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
enableExtension(ClKhrSubGroups);
enableExtension(ClKhrDepthImages);
if (GPU_MIPMAP) {
if (GPU_MIPMAP && imageSupport_) {
enableExtension(ClKhrMipMapImage);
enableExtension(ClKhrMipMapImageWrites);
}