fix(ocl): use correct surface state index for bindless offset in setArgImage

Related-To: NEO-11156
Signed-off-by: Fabian Zwoliński <fabian.zwolinski@intel.com>
This commit is contained in:
Fabian Zwoliński
2024-08-27 09:05:05 +00:00
committed by Compute-Runtime-Automation
parent ad0d6f5435
commit 90bc6c10ea
2 changed files with 35 additions and 5 deletions

View File

@@ -1701,9 +1701,12 @@ cl_int Kernel::setArgImageWithMipLevel(uint32_t argIndex,
void *surfaceState = nullptr;
if (isValidOffset(argAsImg.bindless)) {
auto &gfxCoreHelper = this->getGfxCoreHelper();
auto surfaceStateSize = gfxCoreHelper.getRenderSurfaceStateSize();
surfaceState = ptrOffset(getSurfaceStateHeap(), surfaceStateSize * argIndex);
auto ssIndex = getSurfaceStateIndexForBindlessOffset(argAsImg.bindless);
if (ssIndex < std::numeric_limits<uint32_t>::max()) {
auto &gfxCoreHelper = this->getGfxCoreHelper();
auto surfaceStateSize = gfxCoreHelper.getRenderSurfaceStateSize();
surfaceState = ptrOffset(getSurfaceStateHeap(), ssIndex * surfaceStateSize);
}
} else {
DEBUG_BREAK_IF(isUndefinedOffset(argAsImg.bindful));
surfaceState = ptrOffset(getSurfaceStateHeap(), argAsImg.bindful);