Add support for SPV_KHR_multiview.
This commit is contained in:
Родитель
d36bd4fb9c
Коммит
d7f38ab4bf
|
@ -0,0 +1,15 @@
|
|||
#version 310 es
|
||||
#extension GL_OVR_multiview2 : require
|
||||
|
||||
layout(binding = 0, std140) uniform MVPs
|
||||
{
|
||||
mat4 MVP[2];
|
||||
} _19;
|
||||
|
||||
layout(location = 0) in vec4 Position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = _19.MVP[gl_ViewID_OVR] * Position;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_multiview : require
|
||||
|
||||
layout(set = 0, binding = 0, std140) uniform MVPs
|
||||
{
|
||||
mat4 MVP[2];
|
||||
} _19;
|
||||
|
||||
layout(location = 0) in vec4 Position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = _19.MVP[gl_ViewIndex] * Position;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#version 310 es
|
||||
#extension GL_EXT_multiview : require
|
||||
|
||||
layout(std140, binding = 0) uniform MVPs
|
||||
{
|
||||
mat4 MVP[2];
|
||||
};
|
||||
|
||||
layout(location = 0) in vec4 Position;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP[gl_ViewIndex] * Position;
|
||||
}
|
|
@ -3619,6 +3619,18 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
|
|||
SPIRV_CROSS_THROW("gl_SamplePosition not supported before GLSL 400.");
|
||||
return "gl_SamplePosition";
|
||||
|
||||
case BuiltInViewIndex:
|
||||
if (options.vulkan_semantics)
|
||||
{
|
||||
require_extension("GL_EXT_multiview");
|
||||
return "gl_ViewIndex";
|
||||
}
|
||||
else
|
||||
{
|
||||
require_extension("GL_OVR_multiview2");
|
||||
return "gl_ViewID_OVR";
|
||||
}
|
||||
|
||||
default:
|
||||
return join("gl_BuiltIn_", convert_to_string(builtin));
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче