mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Merge pull request #11334 from weihuoya/glslang-args
Some glslang options for vulkan
This commit is contained in:
commit
d91637390d
@ -1040,6 +1040,8 @@ bool GLSLtoSPV(const VkShaderStageFlagBits shader_type,
|
||||
|
||||
glslang::TProgram program;
|
||||
const char *shaderStrings[1];
|
||||
EProfile profile = ECoreProfile;
|
||||
int defaultVersion = 450;
|
||||
TBuiltInResource Resources;
|
||||
init_resources(Resources);
|
||||
|
||||
@ -1052,7 +1054,7 @@ bool GLSLtoSPV(const VkShaderStageFlagBits shader_type,
|
||||
shaderStrings[0] = pshader;
|
||||
shader.setStrings(shaderStrings, 1);
|
||||
|
||||
if (!shader.parse(&Resources, 100, false, messages)) {
|
||||
if (!shader.parse(&Resources, defaultVersion, profile, false, true, messages)) {
|
||||
puts(shader.getInfoLog());
|
||||
puts(shader.getInfoDebugLog());
|
||||
if (errorMessage) {
|
||||
@ -1076,7 +1078,11 @@ bool GLSLtoSPV(const VkShaderStageFlagBits shader_type,
|
||||
}
|
||||
|
||||
// Can't fail, parsing worked, "linking" worked.
|
||||
glslang::GlslangToSpv(*program.getIntermediate(stage), spirv);
|
||||
glslang::SpvOptions options;
|
||||
options.disableOptimizer = false;
|
||||
options.optimizeSize = false;
|
||||
options.generateDebugInfo = false;
|
||||
glslang::GlslangToSpv(*program.getIntermediate(stage), spirv, &options);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user