Skip to content

Commit

Permalink
Fixed lang clipspace option
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardodoria committed Aug 7, 2021
1 parent 137f14f commit 60d1f7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/spirvcross.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,20 @@ bool supershader::compile_to_lang(std::vector<spirvcross_t>& spirvcrossvec, cons
spirv_cross::CompilerGLSL::Options opts = compiler->get_common_options();

opts.flatten_multidimensional_arrays = true;
opts.vertex.fixup_clipspace = false;
opts.vertex.flip_vert_y = false;

if (args.lang == LANG_GLSL) {

opts.emit_line_directives = false;
opts.vertex.fixup_clipspace = false;
opts.enable_420pack_extension = false;
opts.es = args.es;
opts.version = args.version;

} else if (args.lang == LANG_HLSL) {

opts.emit_line_directives = true;
opts.vertex.fixup_clipspace = true;

spirv_cross::CompilerHLSL* hlsl = (spirv_cross::CompilerHLSL*)compiler.get();
spirv_cross::CompilerHLSL::Options hlsl_opts = hlsl->get_hlsl_options();
Expand All @@ -291,6 +292,7 @@ bool supershader::compile_to_lang(std::vector<spirvcross_t>& spirvcrossvec, cons
} else if (args.lang == LANG_MSL) {

opts.emit_line_directives = true;
opts.vertex.fixup_clipspace = true;

spirv_cross::CompilerMSL* msl = (spirv_cross::CompilerMSL*)compiler.get();
spirv_cross::CompilerMSL::Options msl_opts = msl->get_msl_options();
Expand Down

0 comments on commit 60d1f7d

Please sign in to comment.