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

@@ -22,6 +22,8 @@
#include "gpu_shader_create_info.hh"
#include "gpu_shader_dependency_private.h"
#include "GPU_context.h"
extern "C" {
#define SHADER_SOURCE(datatoc, filename, filepath) extern char datatoc[];
#include "glsl_compositor_source_list.h"
@@ -268,6 +270,12 @@ struct GPUSource {
int64_t last_pos = 0;
const bool is_cpp = filename.endswith(".hh");
/* Metal Shading language is based on C++ and supports C++-style enumerations.
* For these cases, we do not need to perform auto-replacement. */
if (is_cpp && GPU_backend_get_type() == GPU_BACKEND_METAL) {
return;
}
while (true) {
cursor = find_keyword(input, "enum ", cursor + 1);
if (cursor == -1) {