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
This commit is contained in:
John Kessenich 2015-05-22 01:21:31 +00:00
parent e61ed59726
commit ea543986f9
15 changed files with 30 additions and 15 deletions

View File

@ -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();

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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