mirror of
https://github.com/KhronosGroup/glslang
synced 2024-09-19 12:19:53 +00:00
ESSL/SPV: Fix #1856: Allow ESSL shaders to compile to OpenGL SPIR-V.
This commit is contained in:
parent
efd47a8fae
commit
df1d4ccf5f
@ -293,7 +293,7 @@ class TProgram
|
||||
|
||||
For just validating (not generating code), subsitute these calls:
|
||||
|
||||
```
|
||||
```cxx
|
||||
setEnvInput(EShSourceHlsl or EShSourceGlsl, stage, EShClientNone, 0);
|
||||
setEnvClient(EShClientNone, 0);
|
||||
setEnvTarget(EShTargetNone, 0);
|
||||
|
@ -1,6 +1,25 @@
|
||||
glspv.esversion.vert
|
||||
ERROR: #version: ES shaders for OpenGL SPIR-V are not supported
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80007
|
||||
// Id's are bound by 10
|
||||
|
||||
|
||||
SPIR-V is not generated for failed compile or link
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Vertex 4 "main" 8 9
|
||||
Source ESSL 310
|
||||
Name 4 "main"
|
||||
Name 8 "gl_VertexID"
|
||||
Name 9 "gl_InstanceID"
|
||||
Decorate 8(gl_VertexID) BuiltIn VertexId
|
||||
Decorate 9(gl_InstanceID) BuiltIn InstanceId
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 1
|
||||
7: TypePointer Input 6(int)
|
||||
8(gl_VertexID): 7(ptr) Variable Input
|
||||
9(gl_InstanceID): 7(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
|
@ -646,14 +646,9 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
|
||||
if (spvVersion.spv != 0) {
|
||||
switch (profile) {
|
||||
case EEsProfile:
|
||||
if (spvVersion.vulkan > 0 && version < 310) {
|
||||
if (version < 310) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: ES shaders for Vulkan SPIR-V require version 310 or higher");
|
||||
version = 310;
|
||||
}
|
||||
if (spvVersion.openGl >= 100) {
|
||||
correct = false;
|
||||
infoSink.info.message(EPrefixError, "#version: ES shaders for OpenGL SPIR-V are not supported");
|
||||
infoSink.info.message(EPrefixError, "#version: ES shaders for SPIR-V require version 310 or higher");
|
||||
version = 310;
|
||||
}
|
||||
break;
|
||||
|
@ -126,8 +126,8 @@ class TType;
|
||||
|
||||
typedef enum {
|
||||
EShSourceNone,
|
||||
EShSourceGlsl,
|
||||
EShSourceHlsl,
|
||||
EShSourceGlsl, // GLSL, includes ESSL (OpenGL ES GLSL)
|
||||
EShSourceHlsl, // HLSL
|
||||
} EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead
|
||||
|
||||
typedef enum {
|
||||
|
Loading…
Reference in New Issue
Block a user