From 006e853f2b098826c9ac4f040e30abd053187368 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Fri, 13 Jun 2025 05:25:46 +0200 Subject: [PATCH] Revert "fix: set correct bindless offsets for L0 bindless images extension wi... This reverts commit 83e92017c54e2b0e6a4e7bff7923154e8fb51f2c. Signed-off-by: Compute-Runtime-Validation --- .../source/helpers/bindless_heaps_helper.cpp | 8 ----- shared/source/helpers/bindless_heaps_helper.h | 1 - .../common/mocks/mock_bindless_heaps_helper.h | 1 - .../helpers/bindless_heaps_helper_tests.cpp | 30 ++----------------- 4 files changed, 2 insertions(+), 38 deletions(-) diff --git a/shared/source/helpers/bindless_heaps_helper.cpp b/shared/source/helpers/bindless_heaps_helper.cpp index c480a56f85..092c5e516d 100644 --- a/shared/source/helpers/bindless_heaps_helper.cpp +++ b/shared/source/helpers/bindless_heaps_helper.cpp @@ -11,7 +11,6 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gmm_helper/gmm_helper.h" -#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/driver_model_type.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/string.h" @@ -78,9 +77,6 @@ BindlessHeapsHelper::BindlessHeapsHelper(Device *rootDevice, bool isMultiOsConte memcpy_s(borderColorStates->getUnderlyingBuffer(), sizeof(borderColorDefault), borderColorDefault, sizeof(borderColorDefault)); float borderColorAlpha[4] = {0, 0, 0, 1.0}; memcpy_s(ptrOffset(borderColorStates->getUnderlyingBuffer(), borderColorAlphaOffset), sizeof(borderColorAlpha), borderColorAlpha, sizeof(borderColorDefault)); - - auto &hwInfo = *rootDevice->getRootDeviceEnvironment().getHardwareInfo(); - this->heaplessEnabled = rootDevice->getRootDeviceEnvironment().getHelper().isHeaplessModeEnabled(hwInfo); } std::optional BindlessHeapsHelper::reserveMemoryRange(size_t size, size_t alignment, HeapIndex heapIndex) { @@ -239,10 +235,6 @@ SurfaceStateInHeapInfo BindlessHeapsHelper::allocateSSInHeap(size_t ssSize, Grap memset(ptrInHeap, 0, ssSize); auto bindlessOffset = heap->getGraphicsAllocation()->getGpuAddress() - heap->getGraphicsAllocation()->getGpuBaseAddress() + heap->getUsed() - ssSize; - if (this->heaplessEnabled) { - bindlessOffset += heap->getGraphicsAllocation()->getGpuBaseAddress(); - } - bindlesInfo = SurfaceStateInHeapInfo{heap->getGraphicsAllocation(), bindlessOffset, ptrInHeap, ssSize}; } diff --git a/shared/source/helpers/bindless_heaps_helper.h b/shared/source/helpers/bindless_heaps_helper.h index 68df921b93..246a7d4386 100644 --- a/shared/source/helpers/bindless_heaps_helper.h +++ b/shared/source/helpers/bindless_heaps_helper.h @@ -105,7 +105,6 @@ class BindlessHeapsHelper : NEO::NonCopyableAndNonMovableClass { bool isMultiOsContextCapable = false; bool reservedMemoryInitialized = false; bool useReservedMemory = false; - bool heaplessEnabled = false; }; static_assert(NEO::NonCopyableAndNonMovable); diff --git a/shared/test/common/mocks/mock_bindless_heaps_helper.h b/shared/test/common/mocks/mock_bindless_heaps_helper.h index 8028159bf4..bf62486038 100644 --- a/shared/test/common/mocks/mock_bindless_heaps_helper.h +++ b/shared/test/common/mocks/mock_bindless_heaps_helper.h @@ -36,7 +36,6 @@ class MockBindlesHeapsHelper : public BindlessHeapsHelper { using BaseClass::globalBindlessDsh; using BaseClass::growHeap; using BaseClass::heapFrontWindow; - using BaseClass::heaplessEnabled; using BaseClass::heapRegular; using BaseClass::initializeReservedMemory; using BaseClass::isMultiOsContextCapable; diff --git a/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp b/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp index b8fbc67ac9..aeafd2e790 100644 --- a/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp +++ b/shared/test/unit_test/helpers/bindless_heaps_helper_tests.cpp @@ -217,9 +217,6 @@ TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenGetAlphaBorderColorO TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenAllocateSsInSpecialHeapThenFirstSlotIsAtOffsetZero) { auto bindlessHeapHelper = std::make_unique(getDevice(), false); - if (bindlessHeapHelper->heaplessEnabled) { - GTEST_SKIP(); - } MockGraphicsAllocation alloc; size_t size = 0x40; auto ssInHeapInfo = bindlessHeapHelper->allocateSSInHeap(size, &alloc, BindlessHeapsHelper::BindlesHeapType::specialSsh); @@ -229,32 +226,13 @@ TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenAllocateSsInSpecialH EXPECT_EQ(bindlessHeapHelper->getGlobalHeapsBase(), ssInHeapInfo.heapAllocation->getGpuBaseAddress()); } -TEST_F(BindlessHeapsHelperTests, givenHeaplessAndBindlessHeapHelperWhenAllocateSsInSpecialHeapThenFirstSlotIsAtOffsetOfHeapBaseAddress) { - - auto bindlessHeapHelper = std::make_unique(getDevice(), false); - if (!bindlessHeapHelper->heaplessEnabled) { - GTEST_SKIP(); - } - MockGraphicsAllocation alloc; - size_t size = 0x40; - auto ssInHeapInfo = bindlessHeapHelper->allocateSSInHeap(size, &alloc, BindlessHeapsHelper::BindlesHeapType::specialSsh); - - EXPECT_EQ(ssInHeapInfo.heapAllocation->getGpuBaseAddress(), ssInHeapInfo.surfaceStateOffset); - EXPECT_EQ(ssInHeapInfo.heapAllocation->getGpuAddress(), ssInHeapInfo.heapAllocation->getGpuBaseAddress()); - EXPECT_EQ(bindlessHeapHelper->getGlobalHeapsBase(), ssInHeapInfo.heapAllocation->getGpuBaseAddress()); -} - TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenAllocateSsInGlobalHeapThenOffsetLessThanHeapSize) { auto bindlessHeapHelper = std::make_unique(getDevice(), false); MockGraphicsAllocation alloc; size_t size = 0x40; auto ssInHeapInfo = bindlessHeapHelper->allocateSSInHeap(size, &alloc, BindlessHeapsHelper::BindlesHeapType::globalSsh); EXPECT_LE(0u, ssInHeapInfo.surfaceStateOffset); - if (bindlessHeapHelper->heaplessEnabled) { - EXPECT_GT(MemoryConstants::max32BitAddress, ssInHeapInfo.surfaceStateOffset - ssInHeapInfo.heapAllocation->getGpuBaseAddress()); - } else { - EXPECT_GT(MemoryConstants::max32BitAddress, ssInHeapInfo.surfaceStateOffset); - } + EXPECT_GT(MemoryConstants::max32BitAddress, ssInHeapInfo.surfaceStateOffset); } TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenAllocateSsInGlobalDshThenOffsetLessThanHeapSize) { @@ -263,11 +241,7 @@ TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenAllocateSsInGlobalDs size_t size = 0x40; auto ssInHeapInfo = bindlessHeapHelper->allocateSSInHeap(size, &alloc, BindlessHeapsHelper::BindlesHeapType::globalDsh); EXPECT_LE(0u, ssInHeapInfo.surfaceStateOffset); - if (bindlessHeapHelper->heaplessEnabled) { - EXPECT_GT(MemoryConstants::max32BitAddress, ssInHeapInfo.surfaceStateOffset - ssInHeapInfo.heapAllocation->getGpuBaseAddress()); - } else { - EXPECT_GT(MemoryConstants::max32BitAddress, ssInHeapInfo.surfaceStateOffset); - } + EXPECT_GT(MemoryConstants::max32BitAddress, ssInHeapInfo.surfaceStateOffset); } TEST_F(BindlessHeapsHelperTests, givenBindlessHeapHelperWhenFreeGraphicsMemoryIsCalledThenSSinHeapInfoShouldBePlacedInReuseVector) {