From 35f8e092f2aa3ed5e3cf03387e712f798ff4850e Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Thu, 21 Aug 2025 08:47:18 +0300 Subject: Introduce CDataLayout & -fvk-use-c-layout (#8136) Closes #8112. ~~The issue asks for a "C layout", but in this PR I use the term "CPU layout" because this naming was pre-existing in the codebase as `kCPULayoutRulesImpl_`. The primary purpose of this layout is to match CPU-side struct definitions with the shader side. I'm open to better naming suggestions, though.~~ Edit: switched back to using `CDataLayout` & `-fvk-use-c-layout`, as the CPU target depends on the object layout rules of existing CPU layout rules, but they're incompatible with actual shaders. So a new `kCLayoutRulesImpl_` was needed anyway. --------- Co-authored-by: Ellie Hermaszewska --- source/slang/slang-end-to-end-request.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-end-to-end-request.cpp') diff --git a/source/slang/slang-end-to-end-request.cpp b/source/slang/slang-end-to-end-request.cpp index 725fc1854..fc2d6d55e 100644 --- a/source/slang/slang-end-to-end-request.cpp +++ b/source/slang/slang-end-to-end-request.cpp @@ -894,6 +894,11 @@ void EndToEndCompileRequest::setTargetForceDXLayout(int targetIndex, bool value) getTargetOptionSet(targetIndex).set(CompilerOptionName::ForceDXLayout, value); } +void EndToEndCompileRequest::setTargetForceCLayout(int targetIndex, bool value) +{ + getTargetOptionSet(targetIndex).set(CompilerOptionName::ForceCLayout, value); +} + void EndToEndCompileRequest::setTargetFloatingPointMode( int targetIndex, SlangFloatingPointMode mode) -- cgit v1.2.3