Make screen texture and depth texture work in Multiview
This commit is contained in:
parent
eaf306e0b1
commit
85c478e170
15 changed files with 103 additions and 23 deletions
|
|
@ -118,13 +118,13 @@ layout(location = 10) out flat uint instance_index_interp;
|
|||
// !BAS! This needs to become an input once we implement our fallback!
|
||||
#define ViewIndex 0
|
||||
#endif // has_VK_KHR_multiview
|
||||
vec3 normal_roughness_uv(vec2 uv) {
|
||||
vec3 multiview_uv(vec2 uv) {
|
||||
return vec3(uv, ViewIndex);
|
||||
}
|
||||
#else // USE_MULTIVIEW
|
||||
// Set to zero, not supported in non stereo
|
||||
#define ViewIndex 0
|
||||
vec2 normal_roughness_uv(vec2 uv) {
|
||||
vec2 multiview_uv(vec2 uv) {
|
||||
return uv;
|
||||
}
|
||||
#endif //USE_MULTIVIEW
|
||||
|
|
@ -550,13 +550,13 @@ layout(location = 10) in flat uint instance_index_interp;
|
|||
// !BAS! This needs to become an input once we implement our fallback!
|
||||
#define ViewIndex 0
|
||||
#endif // has_VK_KHR_multiview
|
||||
vec3 normal_roughness_uv(vec2 uv) {
|
||||
vec3 multiview_uv(vec2 uv) {
|
||||
return vec3(uv, ViewIndex);
|
||||
}
|
||||
#else // USE_MULTIVIEW
|
||||
// Set to zero, not supported in non stereo
|
||||
#define ViewIndex 0
|
||||
vec2 normal_roughness_uv(vec2 uv) {
|
||||
vec2 multiview_uv(vec2 uv) {
|
||||
return uv;
|
||||
}
|
||||
#endif //USE_MULTIVIEW
|
||||
|
|
|
|||
|
|
@ -271,15 +271,16 @@ layout(r32ui, set = 1, binding = 13) uniform restrict uimage3D geom_facing_grid;
|
|||
#define multiviewSampler sampler2D
|
||||
#else
|
||||
|
||||
layout(set = 1, binding = 10) uniform texture2D depth_buffer;
|
||||
layout(set = 1, binding = 11) uniform texture2D color_buffer;
|
||||
|
||||
#ifdef USE_MULTIVIEW
|
||||
layout(set = 1, binding = 10) uniform texture2DArray depth_buffer;
|
||||
layout(set = 1, binding = 11) uniform texture2DArray color_buffer;
|
||||
layout(set = 1, binding = 12) uniform texture2DArray normal_roughness_buffer;
|
||||
layout(set = 1, binding = 14) uniform texture2DArray ambient_buffer;
|
||||
layout(set = 1, binding = 15) uniform texture2DArray reflection_buffer;
|
||||
#define multiviewSampler sampler2DArray
|
||||
#else // USE_MULTIVIEW
|
||||
layout(set = 1, binding = 10) uniform texture2D depth_buffer;
|
||||
layout(set = 1, binding = 11) uniform texture2D color_buffer;
|
||||
layout(set = 1, binding = 12) uniform texture2D normal_roughness_buffer;
|
||||
layout(set = 1, binding = 14) uniform texture2D ambient_buffer;
|
||||
layout(set = 1, binding = 15) uniform texture2D reflection_buffer;
|
||||
|
|
|
|||
|
|
@ -112,9 +112,15 @@ layout(location = 9) out highp float dp_clip;
|
|||
// !BAS! This needs to become an input once we implement our fallback!
|
||||
#define ViewIndex 0
|
||||
#endif
|
||||
vec3 multiview_uv(vec2 uv) {
|
||||
return vec3(uv, ViewIndex);
|
||||
}
|
||||
#else
|
||||
// Set to zero, not supported in non stereo
|
||||
#define ViewIndex 0
|
||||
vec2 multiview_uv(vec2 uv) {
|
||||
return uv;
|
||||
}
|
||||
#endif //USE_MULTIVIEW
|
||||
|
||||
invariant gl_Position;
|
||||
|
|
@ -523,9 +529,15 @@ layout(location = 9) highp in float dp_clip;
|
|||
// !BAS! This needs to become an input once we implement our fallback!
|
||||
#define ViewIndex 0
|
||||
#endif
|
||||
vec3 multiview_uv(vec2 uv) {
|
||||
return vec3(uv, ViewIndex);
|
||||
}
|
||||
#else
|
||||
// Set to zero, not supported in non stereo
|
||||
#define ViewIndex 0
|
||||
vec2 multiview_uv(vec2 uv) {
|
||||
return uv;
|
||||
}
|
||||
#endif //USE_MULTIVIEW
|
||||
|
||||
//defines to keep compatibility with vertex
|
||||
|
|
|
|||
|
|
@ -154,8 +154,15 @@ layout(set = 1, binding = 5) uniform highp texture2D directional_shadow_atlas;
|
|||
// this needs to change to providing just the lightmap we're using..
|
||||
layout(set = 1, binding = 6) uniform texture2DArray lightmap_textures[MAX_LIGHTMAP_TEXTURES];
|
||||
|
||||
#ifdef USE_MULTIVIEW
|
||||
layout(set = 1, binding = 9) uniform highp texture2DArray depth_buffer;
|
||||
layout(set = 1, binding = 10) uniform mediump texture2DArray color_buffer;
|
||||
#define multiviewSampler sampler2DArray
|
||||
#else
|
||||
layout(set = 1, binding = 9) uniform highp texture2D depth_buffer;
|
||||
layout(set = 1, binding = 10) uniform mediump texture2D color_buffer;
|
||||
#define multiviewSampler sampler2D
|
||||
#endif // USE_MULTIVIEW
|
||||
|
||||
/* Set 2 Skeleton & Instancing (can change per item) */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue