From 42f49937ffa69c82e333e886952eed027e12340e Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 16 Aug 2022 17:11:54 -0700 Subject: Add gfx interface definition in Slang. (#2364) * Add gfx interface definition in Slang. - add gfx interface definitons in Slang. - fix slang compiler to correctly type-check `out` interface argument. - modify gfx interface to be fully COM compatible - add convenient ShaderProgram creation methods to gfx. * Fix compile errors and warnings. * Update project files * Fix cuda. * Properly implement queryInterface in command encoder impls. Co-authored-by: Yong He --- tools/gfx-unit-test/gfx-test-util.cpp | 2 +- tools/gfx-unit-test/instanced-draw-tests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/gfx-unit-test') diff --git a/tools/gfx-unit-test/gfx-test-util.cpp b/tools/gfx-unit-test/gfx-test-util.cpp index e9f683524..9a6a7c4f6 100644 --- a/tools/gfx-unit-test/gfx-test-util.cpp +++ b/tools/gfx-unit-test/gfx-test-util.cpp @@ -151,7 +151,7 @@ namespace gfx_test void compareComputeResultFuzzy(const float* result, float* expectedResult, size_t expectedBufferSize) { - for (int i = 0; i < expectedBufferSize / sizeof(float); ++i) + for (size_t i = 0; i < expectedBufferSize / sizeof(float); ++i) { SLANG_CHECK(abs(result[i] - expectedResult[i]) <= 0.01); } diff --git a/tools/gfx-unit-test/instanced-draw-tests.cpp b/tools/gfx-unit-test/instanced-draw-tests.cpp index 1e2fa1037..6491e8944 100644 --- a/tools/gfx-unit-test/instanced-draw-tests.cpp +++ b/tools/gfx-unit-test/instanced-draw-tests.cpp @@ -387,7 +387,7 @@ namespace gfx_test encoder->setPrimitiveTopology(PrimitiveTopology::TriangleList); uint32_t maxDrawCount = 1; - uint64_t argOffset = offsetof(IndirectArgData, args); + Offset argOffset = offsetof(IndirectArgData, args); encoder->drawIndirect(maxDrawCount, indirectBuffer, argOffset); encoder->endEncoding(); @@ -464,7 +464,7 @@ namespace gfx_test encoder->setPrimitiveTopology(PrimitiveTopology::TriangleList); uint32_t maxDrawCount = 1; - uint64_t argOffset = offsetof(IndexedIndirectArgData, args); + Offset argOffset = offsetof(IndexedIndirectArgData, args); encoder->drawIndexedIndirect(maxDrawCount, indirectBuffer, argOffset); encoder->endEncoding(); -- cgit v1.2.3