Skip to content
Snippets Groups Projects
Commit ea543986 authored by John Kessenich's avatar John Kessenich
Browse files

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

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31265 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent e61ed597
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 15 deletions
......@@ -130,6 +130,21 @@ protected:
// 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.
spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
{
......@@ -339,7 +354,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
builder.clearAccessChain();
builder.setSource(spv::SourceLanguageGLSL, glslangIntermediate->getVersion());
builder.setSource(TranslateSourceLanguage(glslangIntermediate->getProfile()), glslangIntermediate->getVersion());
stdBuiltins = builder.import("GLSL.std.450");
builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450);
shaderEntry = builder.makeMain();
......
......@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 48
Source GLSL 100
Source ESSL 100
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 41
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
......@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 38
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 112
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 26
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 48
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 49
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 26
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
......@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 59
Source GLSL 100
Source ESSL 100
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4
......
......@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 111
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4
......
......@@ -11,7 +11,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 249
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4
......
......@@ -10,7 +10,7 @@ Linked fragment stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 206
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 43
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
......@@ -10,7 +10,7 @@ Linked vertex stage:
// Generated by (magic number): 51a00bb
// Id's are bound by 24
Source GLSL 300
Source ESSL 300
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment