From c701ec00ccce6dfa8094d6550ce2db929fc8cefe Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 1 Jul 2025 19:09:29 -0700 Subject: Defer immutable buffer loads when emitting spirv. (#7579) * Defer immutable buffer loads when emitting spirv. * Fix. * Fix. * Fix. * Fix tests. * Fix test. --- tests/spirv/large-struct.slang | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/spirv/large-struct.slang') diff --git a/tests/spirv/large-struct.slang b/tests/spirv/large-struct.slang index 7738a5fcf..2d79c0aaf 100644 --- a/tests/spirv/large-struct.slang +++ b/tests/spirv/large-struct.slang @@ -3,9 +3,8 @@ //TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-d3d12 -compute -output-using-type //TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-cpu -compute -output-using-type -// Check that when generating spirv directly, we use a loop -// to copy large arrays in input data out into a local variable, instead of emitting -// unrolled code that reads each element of the array individually. +// Check that when generating spirv directly, we do not load the entire big array +// from the constant buffer into registers. struct WorkData { @@ -21,7 +20,9 @@ ConstantBuffer input; //TEST_INPUT:set resultBuffer = out ubuffer(data=[0 0 0 0], stride=4) RWStructuredBuffer resultBuffer; -// CHECK: OpLoopMerge +// CHECK-NOT: OpLoopMerge +// CHECK-NOT: OpCompositeConstruct +// CHECK-COUNT-1: OpStore [numthreads(2, 1, 1)] void computeMain(uint3 tid: SV_DispatchThreadID) -- cgit v1.2.3