EEVEE: Port existing EEVEE shaders and generated materials to use GPUShaderCreateInfo.

Required by Metal backend for efficient shader compilation. EEVEE material
resource binding permutations now controlled via CreateInfo and selected
based on material options. Other existing CreateInfo's also modified to
ensure explicitness for depth-writing mode. Other missing bindings also
addressed to ensure full compliance with the Metal backend.

Authored by Apple: Michael Parkin-White

Ref T96261

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D16243
This commit is contained in:
2022-12-08 21:07:28 +01:00
committed by Clément Foucault
parent 2efdbeb58b
commit 6b8bb26c45
160 changed files with 3116 additions and 1602 deletions

View File

@@ -60,7 +60,14 @@ vec3 cubemap_adj_xy(float face)
}
}
# ifdef GPU_METAL
template<typename T>
vec4 cubemap_seamless(thread _mtl_combined_image_sampler_2d_array<T, access::sample> *tex,
vec4 cubevec,
float lod)
# else
vec4 cubemap_seamless(sampler2DArray tex, vec4 cubevec, float lod)
# endif
{
/* Manual Cube map Layer indexing. */
float face = cubemap_face_index(cubevec.xyz);
@@ -116,7 +123,14 @@ vec4 cubemap_seamless(sampler2DArray tex, vec4 cubevec, float lod)
}
}
# ifdef GPU_METAL
template<typename T, access A>
vec4 textureLod_cubemapArray(thread _mtl_combined_image_sampler_2d_array<T, A> tex,
vec4 cubevec,
float lod)
# else
vec4 textureLod_cubemapArray(sampler2DArray tex, vec4 cubevec, float lod)
# endif
{
float lod1 = floor(lod);
float lod2 = ceil(lod);