Skip to content

Commit 2222fa0

Browse files
committed
[HLSL] Add option for VK layouts
We add the options to the driver, so that the one option that is being implemented at this time can be used. Issue an error for the other options. When we start to implement the other options, we will have to figure out how to pass which option is active to clang.
1 parent d43662d commit 2222fa0

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9323,13 +9323,13 @@ def fspv_extension_EQ
93239323
def fvk_use_dx_layout
93249324
: DXCFlag<"fvk-use-dx-layout">,
93259325
HelpText<"Use DirectX memory layout for Vulkan resources.">;
9326-
def fvk_use_gl_layout
9327-
: DXCFlag<"fvk-use-gl-layout">,
9328-
HelpText<"Use strict OpenGL std140/std430 memory layout for Vulkan resources.">;
9326+
def fvk_use_gl_layout : DXCFlag<"fvk-use-gl-layout">,
9327+
HelpText<"Use strict OpenGL std140/std430 memory "
9328+
"layout for Vulkan resources.">;
93299329
def fvk_use_scalar_layout
93309330
: DXCFlag<"fvk-use-scalar-layout">,
93319331
HelpText<"Use scalar memory layout for Vulkan resources.">;
9332-
9332+
93339333
def no_wasm_opt : Flag<["--"], "no-wasm-opt">,
93349334
Group<m_Group>,
93359335
HelpText<"Disable the wasm-opt optimizer">,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// No errors. Otherwise nothing observable.
2+
// RUN: %clang_dxc -fvk-use-dx-layout -spirv -Tlib_6_7 -### %s
3+
4+
// RUN: not %clang_dxc -fvk-use-scalar-layout -spirv -Tlib_6_7 -### %s 2>&1 | FileCheck %s -check-prefix=SCALAR
5+
// SCALAR: error: the clang compiler does not support '-fvk-use-scalar-layout'
6+
7+
// RUN: not %clang_dxc -fvk-use-gl-layout -spirv -Tlib_6_7 -### %s 2>&1 | FileCheck %s -check-prefix=GL
8+
// GL: error: the clang compiler does not support '-fvk-use-gl-layout'

0 commit comments

Comments
 (0)