From fdf061e278720ec066a1fac8f1f35a22e817bf2d Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 21 Nov 2024 14:07:23 -0800 Subject: Add datalayout for constant buffers. (#5608) * Add datalayout for constant buffers. * Fixes. * Fix test. * Fix glsl codegen. * Update spirv-specific doc. * Fix test. * Fix binding in the presense of specialization constants. * address comments. * Add a test for constant buffer layout. --- source/slang/slang-ir-optix-entry-point-uniforms.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-ir-optix-entry-point-uniforms.cpp') diff --git a/source/slang/slang-ir-optix-entry-point-uniforms.cpp b/source/slang/slang-ir-optix-entry-point-uniforms.cpp index f29cbe222..dfa07ca67 100644 --- a/source/slang/slang-ir-optix-entry-point-uniforms.cpp +++ b/source/slang/slang-ir-optix-entry-point-uniforms.cpp @@ -253,7 +253,9 @@ struct CollectOptixEntryPointUniformParams : PerEntryPointPass // TODO: reconcile this with OptiX, as the current logic works, but is still focused on // VK/DXR.. // - auto constantBufferType = builder.getConstantBufferType(paramStructType); + auto constantBufferType = builder.getConstantBufferType( + paramStructType, + builder.getType(kIROp_DefaultBufferLayoutType)); collectedParam = builder.createParam(constantBufferType); // The global shader parameter should have the layout -- cgit v1.2.3