Fix T103313: Resolve shader compilation failures when enabling GPU workarounds.

A number of paths resulted in compilation errors after porting EEVEE to use Create-Info. Namely the fallback path for cubemap support. A number of other strict compilation failures regarding format comparison also required fixing when this mode is enabled.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Maniphest Tasks: T96261, T103313

Differential Revision: https://developer.blender.org/D16819
This commit is contained in:
Jason Fielder
2022-12-20 14:18:13 +01:00
committed by Clément Foucault
parent 3efb31ee31
commit dedca2c994
14 changed files with 41 additions and 36 deletions

View File

@@ -16,11 +16,11 @@ void main(void)
const float end_gradient_threshold = 0.65;
#ifdef USE_INSTANCE
# define colStart (colid_doarrow[0] < 3 ? start_color : node_link_data.colors[colid_doarrow[0]])
# define colEnd (colid_doarrow[1] < 3 ? end_color : node_link_data.colors[colid_doarrow[1]])
# define colStart (colid_doarrow[0] < 3u ? start_color : node_link_data.colors[colid_doarrow[0]])
# define colEnd (colid_doarrow[1] < 3u ? end_color : node_link_data.colors[colid_doarrow[1]])
# define colShadow node_link_data.colors[colid_doarrow[2]]
# define doArrow (colid_doarrow[3] != 0)
# define doMuted (domuted[0] != 0)
# define doArrow (colid_doarrow[3] != 0u)
# define doMuted (domuted[0] != 0u)
#else
vec2 P0 = node_link_data.bezierPts[0].xy;
vec2 P1 = node_link_data.bezierPts[1].xy;

View File

@@ -1,13 +1,13 @@
/* Values in GPU_shader.h. */
#define GPU_KEYFRAME_SHAPE_DIAMOND (1 << 0)
#define GPU_KEYFRAME_SHAPE_CIRCLE (1 << 1)
#define GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL (1 << 2)
#define GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL (1 << 3)
#define GPU_KEYFRAME_SHAPE_INNER_DOT (1 << 4)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MAX (1 << 8)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIN (1 << 9)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIXED (1 << 10)
#define GPU_KEYFRAME_SHAPE_DIAMOND (1u << 0)
#define GPU_KEYFRAME_SHAPE_CIRCLE (1u << 1)
#define GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL (1u << 2)
#define GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL (1u << 3)
#define GPU_KEYFRAME_SHAPE_INNER_DOT (1u << 4)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MAX (1u << 8)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIN (1u << 9)
#define GPU_KEYFRAME_SHAPE_ARROW_END_MIXED (1u << 10)
#define GPU_KEYFRAME_SHAPE_SQUARE \
(GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)
@@ -18,7 +18,7 @@ const float minmax_scale = sqrt(1.0 / (1.0 + 1.0 / minmax_bias));
bool test(uint bit)
{
return (finalFlags & bit) != 0;
return (finalFlags & bit) != 0u;
}
void main()

View File

@@ -153,6 +153,9 @@ struct SStruct {
/* Texture-write functions. */
#define imageStore(_tex, _coord, _value) _texture_write_internal(_tex, _coord, _value)
/* Cubemap support always available when using Metal. */
#define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod)
/* Singular return values from texture functions of type DEPTH are often indexed with either .r or
* .x. This is a lightweight wrapper type for handling this syntax. */
union _msl_return_float {

View File

@@ -1,4 +1,11 @@
/* Cubemap support and fallback implementation declarations. */
#ifdef GPU_ARB_texture_cube_map_array
# define textureLod_cubemapArray(tex, co, lod) textureLod(tex, co, lod)
#else
# define samplerCubeArray sampler2DArray
#endif
/* Texture format tokens -- Type explicitness required by other Graphics APIs. */
#define depth2D sampler2D
#define depth2DArray sampler2DArray