diff options
Diffstat (limited to 'tools/gfx-unit-test/gfx-test-texture-util.cpp')
| -rw-r--r-- | tools/gfx-unit-test/gfx-test-texture-util.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/gfx-unit-test/gfx-test-texture-util.cpp b/tools/gfx-unit-test/gfx-test-texture-util.cpp index 24cd1c4a9..c7c85db58 100644 --- a/tools/gfx-unit-test/gfx-test-texture-util.cpp +++ b/tools/gfx-unit-test/gfx-test-texture-util.cpp @@ -1,4 +1,5 @@ #include "gfx-test-texture-util.h" +#include "gfx-test-util.h" #include "tools/unit-test/slang-unit-test.h" #include <slang-com-ptr.h> @@ -28,6 +29,13 @@ namespace gfx_test } } + uint32_t getTexelSize(Format format) + { + FormatInfo info; + GFX_CHECK_CALL_ABORT(gfxGetFormatInfo(format, &info)); + return info.blockSizeInBytes / info.pixelsPerBlock; + } + uint32_t getSubresourceIndex(uint32_t mipLevel, uint32_t mipLevelCount, uint32_t baseArrayLayer) { return baseArrayLayer * mipLevelCount + mipLevel; @@ -145,7 +153,7 @@ namespace gfx_test auto extents = texture->extents; auto arrayLayers = texture->arrayLayerCount; auto mipLevels = texture->mipLevelCount; - auto texelSize = texture->texelSize; + auto texelSize = getTexelSize(texture->format); for (uint32_t layer = 0; layer < arrayLayers; ++layer) { |
