GPU: Make use of the C++ stubs in some shaders

This commit is contained in:
Clément Foucault
2024-10-05 10:17:30 +02:00
committed by Clément Foucault
parent fd47edfb86
commit 42e8cbb921
9 changed files with 17 additions and 1 deletions

View File

@@ -18,6 +18,8 @@
#include "workbench_shadow_lib.glsl"
VERTEX_SHADER_CREATE_INFO(workbench_shadow_fail_manifold_caps)
void emit_cap(bool front,
bool invert,
VertOut geom_in_0,

View File

@@ -10,6 +10,8 @@
#include "gpu_shader_math_vector_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"
SHADER_LIBRARY_CREATE_INFO(workbench_shadow_common)
struct VertIn {
/* Local position. */
vec3 lP;

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
/* WORKAROUND: to guard against double include in EEVEE. */
#ifndef COMMON_MATH_LIB_GLSL
# define COMMON_MATH_LIB_GLSL

View File

@@ -6,7 +6,7 @@
#include "draw_view_lib.glsl"
#ifndef DRAW_MODELMAT_CREATE_INFO
#if !defined(DRAW_MODELMAT_CREATE_INFO) && !defined(GLSL_CPP_STUBS)
# error Missing draw_modelmat additional create info on shader create info
#endif

View File

@@ -9,6 +9,8 @@
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
COMPUTE_SHADER_CREATE_INFO(draw_resource_finalize)
void main()
{
uint resource_id = gl_GlobalInvocationID.x;

View File

@@ -8,6 +8,8 @@
#include "common_math_lib.glsl"
COMPUTE_SHADER_CREATE_INFO(draw_view_finalize)
void projmat_dimensions(mat4 winmat,
out float r_left,
out float r_right,

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
#if !defined(DRAW_VIEW_CREATE_INFO) && !defined(GLSL_CPP_STUBS)
# error Missing draw_view additional create info on shader create info
#endif

View File

@@ -11,6 +11,8 @@
#include "common_math_lib.glsl"
#include "common_view_lib.glsl"
COMPUTE_SHADER_CREATE_INFO(draw_visibility_compute)
void mask_visibility_bit(uint view_id)
{
if (view_len > 1) {

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
/* WORKAROUND: to guard against double include in EEVEE. */
#ifndef GPU_SHADER_MATH_BASE_LIB_GLSL
# define GPU_SHADER_MATH_BASE_LIB_GLSL