Commit ea543986 by John Kessenich

glslang -> SPV: translate the source profile to the SPV source language.

parent e61ed597
...@@ -130,6 +130,21 @@ protected: ...@@ -130,6 +130,21 @@ protected:
// Helper functions for translating glslang representations to SPIR-V enumerants. // Helper functions for translating glslang representations to SPIR-V enumerants.
// //
// Translate glslang profile to SPIR-V source language.
spv::SourceLanguage TranslateSourceLanguage(EProfile profile)
{
switch (profile) {
case ENoProfile:
case ECoreProfile:
case ECompatibilityProfile:
return spv::SourceLanguageGLSL;
case EEsProfile:
return spv::SourceLanguageESSL;
default:
return spv::SourceLanguageUnknown;
}
}
// Translate glslang language (stage) to SPIR-V execution model. // Translate glslang language (stage) to SPIR-V execution model.
spv::ExecutionModel TranslateExecutionModel(EShLanguage stage) spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
{ {
...@@ -339,7 +354,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls ...@@ -339,7 +354,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage()); spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
builder.clearAccessChain(); builder.clearAccessChain();
builder.setSource(spv::SourceLanguageGLSL, glslangIntermediate->getVersion()); builder.setSource(TranslateSourceLanguage(glslangIntermediate->getProfile()), glslangIntermediate->getVersion());
stdBuiltins = builder.import("GLSL.std.450"); stdBuiltins = builder.import("GLSL.std.450");
builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450);
shaderEntry = builder.makeMain(); shaderEntry = builder.makeMain();
......
...@@ -10,7 +10,7 @@ Linked fragment stage: ...@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 48 // Id's are bound by 48
Source GLSL 100 Source ESSL 100
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 41 // Id's are bound by 41
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
...@@ -10,7 +10,7 @@ Linked fragment stage: ...@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 38 // Id's are bound by 38
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 112 // Id's are bound by 112
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 26 // Id's are bound by 26
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 48 // Id's are bound by 48
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 49 // Id's are bound by 49
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 26 // Id's are bound by 26
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
...@@ -10,7 +10,7 @@ Linked fragment stage: ...@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 59 // Id's are bound by 59
Source GLSL 100 Source ESSL 100
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4
......
...@@ -10,7 +10,7 @@ Linked fragment stage: ...@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 111 // Id's are bound by 111
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4
......
...@@ -11,7 +11,7 @@ Linked fragment stage: ...@@ -11,7 +11,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 249 // Id's are bound by 249
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4
......
...@@ -10,7 +10,7 @@ Linked fragment stage: ...@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 206 // Id's are bound by 206
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 EntryPoint Fragment 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 43 // Id's are bound by 43
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
...@@ -10,7 +10,7 @@ Linked vertex stage: ...@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb // Generated by (magic number): 51a00bb
// Id's are bound by 24 // Id's are bound by 24
Source GLSL 300 Source ESSL 300
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Vertex 4 EntryPoint Vertex 4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment