summaryrefslogtreecommitdiffstats
path: root/tools/gfx-unit-test/gfx-test-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx-unit-test/gfx-test-util.h')
-rw-r--r--tools/gfx-unit-test/gfx-test-util.h23
1 files changed, 4 insertions, 19 deletions
diff --git a/tools/gfx-unit-test/gfx-test-util.h b/tools/gfx-unit-test/gfx-test-util.h
index 04c602359..3be47bc82 100644
--- a/tools/gfx-unit-test/gfx-test-util.h
+++ b/tools/gfx-unit-test/gfx-test-util.h
@@ -30,7 +30,8 @@ namespace gfx_test
void compareComputeResult(
gfx::IDevice* device,
gfx::IBufferResource* buffer,
- uint8_t* expectedResult,
+ size_t offset,
+ const void* expectedResult,
size_t expectedBufferSize);
/// Reads back the content of `buffer` and compares it against `expectedResult`.
@@ -38,7 +39,7 @@ namespace gfx_test
gfx::IDevice* device,
gfx::ITextureResource* texture,
gfx::ResourceState state,
- float* expectedResult,
+ void* expectedResult,
size_t expectedResultRowPitch,
size_t rowCount);
@@ -65,24 +66,8 @@ namespace gfx_test
expectedBuffer.setCount(bufferSize);
memcpy(expectedBuffer.getBuffer(), expectedResult.begin(), bufferSize);
if (std::is_same<T, float>::value) return compareComputeResultFuzzy(device, buffer, (float*)expectedBuffer.getBuffer(), bufferSize);
- return compareComputeResult(device, buffer, expectedBuffer.getBuffer(), bufferSize);
+ return compareComputeResult(device, buffer, 0, expectedBuffer.getBuffer(), bufferSize);
}
-
-// TODO: Implement compareComputeResultFuzzy() and keep or just directly use compareComputeResult() above and add a second overload for uint/int?
-// template<typename T, Slang::Index count>
-// void compareComputeResult(
-// gfx::IDevice* device,
-// gfx::ITextureResource* texture,
-// gfx::ResourceState state,
-// Slang::Array<T, count> expectedResult)
-// {
-// Slang::List<uint8_t> expectedBuffer;
-// size_t bufferSize = sizeof(T) * count;
-// expectedBuffer.setCount(bufferSize);
-// memcpy(expectedBuffer.getBuffer(), expectedResult.begin(), bufferSize);
-// if (std::is_same<T, float>::value) return compareComputeResultFuzzy(device, buffer, (float*)expectedBuffer.getBuffer(), bufferSize);
-// return compareComputeResult(device, texture, state, expectedBuffer.getBuffer(), bufferSize);
-// }
Slang::ComPtr<gfx::IDevice> createTestingDevice(UnitTestContext* context, Slang::RenderApiFlag::Enum api);