Skip to content

Commit 1b03312

Browse files
committed
[Metal Shader Converter] Fix -auto-binding-space for dxil
1 parent a421dc5 commit 1b03312

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/FlyCube/HLSLCompiler/Compiler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ std::vector<uint8_t> Compile(const ShaderDesc& shader, ShaderBlobType blob_type)
101101
arguments.push_back(L"/Zi");
102102
arguments.push_back(L"/Qembed_debug");
103103
arguments.push_back(L"-Werror");
104-
uint32_t space = 0;
105104
if (blob_type == ShaderBlobType::kSPIRV) {
106105
arguments.emplace_back(L"-spirv");
107106
arguments.emplace_back(L"-fspv-target-env=vulkan1.2");
@@ -113,9 +112,9 @@ std::vector<uint8_t> Compile(const ShaderDesc& shader, ShaderBlobType blob_type)
113112
arguments.emplace_back(L"-fspv-extension=SPV_GOOGLE_user_type");
114113
arguments.emplace_back(L"-fvk-use-dx-layout");
115114
arguments.emplace_back(L"-fspv-reflect");
116-
space = static_cast<uint32_t>(shader.type);
117115
}
118116

117+
uint32_t space = static_cast<uint32_t>(shader.type);
119118
arguments.emplace_back(L"-auto-binding-space");
120119
dynamic_arguments.emplace_back(std::to_wstring(space));
121120
arguments.emplace_back(dynamic_arguments.back().c_str());

0 commit comments

Comments
 (0)