GPU: GLSL compilation as C++ for eevee static shaders

Rel #127983

Pull Request: https://projects.blender.org/blender/blender/pulls/130298
This commit is contained in:
Clément Foucault
2024-12-02 21:26:15 +01:00
committed by Clément Foucault
parent 977387ef0d
commit 2c3ccdf77a
188 changed files with 1750 additions and 531 deletions

View File

@@ -147,8 +147,9 @@ add_subdirectory(blenlib)
add_subdirectory(bmesh)
add_subdirectory(draw)
add_subdirectory(draw/intern/shaders)
add_subdirectory(draw/engines/workbench/shaders)
add_subdirectory(draw/engines/eevee_next/shaders)
add_subdirectory(draw/engines/gpencil/shaders)
add_subdirectory(draw/engines/workbench/shaders)
add_subdirectory(render)
add_subdirectory(blenfont)
add_subdirectory(blentranslation)

View File

@@ -327,7 +327,12 @@ set(LIB
set(GLSL_SRC
engines/eevee_next/shaders/eevee_ambient_occlusion_lib.glsl
engines/eevee_next/shaders/eevee_ambient_occlusion_pass_comp.glsl
engines/eevee_next/shaders/eevee_attributes_lib.glsl
engines/eevee_next/shaders/eevee_attributes_curves_lib.glsl
engines/eevee_next/shaders/eevee_attributes_gpencil_lib.glsl
engines/eevee_next/shaders/eevee_attributes_mesh_lib.glsl
engines/eevee_next/shaders/eevee_attributes_point_cloud_lib.glsl
engines/eevee_next/shaders/eevee_attributes_volume_lib.glsl
engines/eevee_next/shaders/eevee_attributes_world_lib.glsl
engines/eevee_next/shaders/eevee_bxdf_lib.glsl
engines/eevee_next/shaders/eevee_bxdf_microfacet_lib.glsl
engines/eevee_next/shaders/eevee_bxdf_diffuse_lib.glsl

View File

@@ -15,9 +15,13 @@
# define IS_CPP 1
#endif
#if IS_CPP
#if IS_CPP || defined(GLSL_CPP_STUBS)
# pragma once
# include "eevee_defines.hh"
#endif
#if IS_CPP
# include "BLI_math_bits.h"
# include "BLI_memory_utils.hh"
@@ -26,8 +30,6 @@
# include "draw_manager.hh"
# include "draw_pass.hh"
# include "eevee_defines.hh"
# include "GPU_shader_shared.hh"
namespace blender::eevee {
@@ -2146,8 +2148,10 @@ BLI_STATIC_ASSERT_ALIGN(UniformData, 16)
# define UTIL_TEXEL vec2(gl_FragCoord.xy)
# elif defined(GPU_COMPUTE_SHADER)
# define UTIL_TEXEL vec2(gl_GlobalInvocationID.xy)
# else
# elif defined(GPU_VERTEX_SHADER)
# define UTIL_TEXEL vec2(gl_VertexID, 0)
# elif defined(GPU_LIBRARY_SHADER)
# define UTIL_TEXEL vec2(0)
# endif
/* Fetch texel. Wrapping if above range. */

View File

@@ -0,0 +1,247 @@
# SPDX-FileCopyrightText: 2024 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# avoid noisy warnings
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
add_c_flag(
"-Wno-unused-result"
)
remove_cc_flag(
"-Wmissing-declarations"
)
endif()
set(INC_GLSL
.
..
# For variadic macros
../../../../blenlib
../../../intern
../../../intern/shaders
../../../../gpu
../../../../gpu/intern
../../../../gpu/shaders
../../../../gpu/shaders/infos
../../../../gpu/shaders/common
)
set(SRC_GLSL_VERT
eevee_debug_irradiance_grid_vert.glsl
eevee_debug_surfels_vert.glsl
eevee_depth_of_field_scatter_vert.glsl
eevee_display_lightprobe_planar_vert.glsl
eevee_display_lightprobe_sphere_vert.glsl
eevee_display_lightprobe_volume_vert.glsl
eevee_geom_curves_vert.glsl
# eevee_geom_gpencil_vert.glsl # Not yet supported
eevee_geom_mesh_vert.glsl
eevee_geom_point_cloud_vert.glsl
eevee_geom_volume_vert.glsl
eevee_geom_world_vert.glsl
eevee_lookdev_display_vert.glsl
eevee_shadow_page_tile_vert.glsl
eevee_shadow_tag_usage_vert.glsl
)
set(SRC_GLSL_FRAG
eevee_debug_gbuffer_frag.glsl
eevee_debug_irradiance_grid_frag.glsl
eevee_debug_surfels_frag.glsl
eevee_deferred_capture_frag.glsl
eevee_deferred_combine_frag.glsl
eevee_deferred_light_frag.glsl
eevee_deferred_planar_frag.glsl
eevee_deferred_thickness_amend_frag.glsl
eevee_deferred_tile_classify_frag.glsl
eevee_depth_of_field_scatter_frag.glsl
eevee_display_lightprobe_planar_frag.glsl
eevee_display_lightprobe_sphere_frag.glsl
eevee_display_lightprobe_volume_frag.glsl
eevee_film_copy_frag.glsl
eevee_film_frag.glsl
eevee_hiz_debug_frag.glsl
eevee_light_culling_debug_frag.glsl
eevee_lookdev_display_frag.glsl
eevee_occupancy_convert_frag.glsl
eevee_renderpass_clear_frag.glsl
eevee_shadow_debug_frag.glsl
eevee_shadow_page_tile_frag.glsl
eevee_shadow_tag_usage_frag.glsl
eevee_surf_capture_frag.glsl
eevee_surf_deferred_frag.glsl
eevee_surf_depth_frag.glsl
eevee_surf_forward_frag.glsl
eevee_surf_hybrid_frag.glsl
eevee_surf_occupancy_frag.glsl
eevee_surf_shadow_frag.glsl
eevee_surf_volume_frag.glsl
eevee_surf_world_frag.glsl
eevee_volume_resolve_frag.glsl
)
set(SRC_GLSL_COMP
eevee_ambient_occlusion_pass_comp.glsl
eevee_depth_of_field_bokeh_lut_comp.glsl
eevee_depth_of_field_downsample_comp.glsl
eevee_depth_of_field_filter_comp.glsl
eevee_depth_of_field_gather_comp.glsl
eevee_depth_of_field_hole_fill_comp.glsl
eevee_depth_of_field_reduce_comp.glsl
eevee_depth_of_field_resolve_comp.glsl
eevee_depth_of_field_setup_comp.glsl
eevee_depth_of_field_stabilize_comp.glsl
eevee_depth_of_field_tiles_dilate_comp.glsl
eevee_depth_of_field_tiles_flatten_comp.glsl
eevee_film_comp.glsl
eevee_film_cryptomatte_post_comp.glsl
eevee_film_pass_convert_comp.glsl
eevee_hiz_update_comp.glsl
eevee_horizon_denoise_comp.glsl
eevee_horizon_resolve_comp.glsl
eevee_horizon_scan_comp.glsl
eevee_horizon_setup_comp.glsl
eevee_light_culling_select_comp.glsl
eevee_light_culling_sort_comp.glsl
eevee_light_culling_tile_comp.glsl
eevee_light_culling_zbin_comp.glsl
eevee_light_shadow_setup_comp.glsl
eevee_lightprobe_sphere_convolve_comp.glsl
eevee_lightprobe_sphere_irradiance_comp.glsl
eevee_lightprobe_sphere_remap_comp.glsl
eevee_lightprobe_sphere_select_comp.glsl
eevee_lightprobe_sphere_sunlight_comp.glsl
eevee_lightprobe_volume_bounds_comp.glsl
eevee_lightprobe_volume_load_comp.glsl
eevee_lightprobe_volume_offset_comp.glsl
eevee_lightprobe_volume_ray_comp.glsl
eevee_lightprobe_volume_world_comp.glsl
eevee_lut_comp.glsl
eevee_motion_blur_dilate_comp.glsl
eevee_motion_blur_flatten_comp.glsl
eevee_motion_blur_gather_comp.glsl
eevee_ray_denoise_bilateral_comp.glsl
eevee_ray_denoise_spatial_comp.glsl
eevee_ray_denoise_temporal_comp.glsl
eevee_ray_generate_comp.glsl
eevee_ray_tile_classify_comp.glsl
eevee_ray_tile_compact_comp.glsl
eevee_ray_trace_fallback_comp.glsl
eevee_ray_trace_planar_comp.glsl
eevee_ray_trace_screen_comp.glsl
eevee_shadow_clipmap_clear_comp.glsl
eevee_shadow_page_allocate_comp.glsl
eevee_shadow_page_clear_comp.glsl
eevee_shadow_page_defrag_comp.glsl
eevee_shadow_page_free_comp.glsl
eevee_shadow_page_mask_comp.glsl
eevee_shadow_tag_update_comp.glsl
eevee_shadow_tag_usage_comp.glsl
eevee_shadow_tag_usage_surfels_comp.glsl
eevee_shadow_tag_usage_volume_comp.glsl
eevee_shadow_tilemap_amend_comp.glsl
eevee_shadow_tilemap_bounds_comp.glsl
eevee_shadow_tilemap_finalize_comp.glsl
eevee_shadow_tilemap_init_comp.glsl
eevee_shadow_tilemap_rendermap_comp.glsl
eevee_shadow_visibility_comp.glsl
eevee_subsurface_convolve_comp.glsl
eevee_subsurface_setup_comp.glsl
eevee_surfel_cluster_build_comp.glsl
eevee_surfel_light_comp.glsl
eevee_surfel_list_build_comp.glsl
eevee_surfel_list_sort_comp.glsl
eevee_surfel_ray_comp.glsl
eevee_vertex_copy_comp.glsl
eevee_volume_integration_comp.glsl
eevee_volume_scatter_comp.glsl
)
set(SRC_GLSL_LIB
eevee_ambient_occlusion_lib.glsl
eevee_attributes_curves_lib.glsl
eevee_attributes_gpencil_lib.glsl
eevee_attributes_mesh_lib.glsl
eevee_attributes_point_cloud_lib.glsl
eevee_attributes_volume_lib.glsl
eevee_attributes_world_lib.glsl
eevee_bxdf_diffuse_lib.glsl
eevee_bxdf_lib.glsl
eevee_bxdf_microfacet_lib.glsl
eevee_camera_lib.glsl
eevee_closure_lib.glsl
eevee_colorspace_lib.glsl
eevee_cryptomatte_lib.glsl
eevee_depth_of_field_accumulator_lib.glsl
eevee_depth_of_field_lib.glsl
eevee_film_lib.glsl
eevee_filter_lib.glsl
# eevee_forward_lib.glsl
eevee_gbuffer_lib.glsl
eevee_horizon_scan_eval_lib.glsl
eevee_horizon_scan_lib.glsl
eevee_light_eval_lib.glsl
eevee_light_iter_lib.glsl
eevee_light_lib.glsl
eevee_lightprobe_eval_lib.glsl
eevee_lightprobe_lib.glsl
eevee_lightprobe_sphere_eval_lib.glsl
eevee_lightprobe_sphere_lib.glsl
eevee_lightprobe_sphere_mapping_lib.glsl
eevee_lightprobe_volume_eval_lib.glsl
eevee_ltc_lib.glsl
eevee_motion_blur_lib.glsl
# eevee_nodetree_lib.glsl # Has dependency on draw_model_lib that is hard to resolve
eevee_occupancy_lib.glsl
eevee_octahedron_lib.glsl
eevee_ray_generate_lib.glsl
eevee_ray_trace_screen_lib.glsl
eevee_ray_types_lib.glsl
eevee_renderpass_lib.glsl
eevee_sampling_lib.glsl
eevee_shadow_lib.glsl
eevee_shadow_page_ops_lib.glsl
eevee_shadow_tag_usage_lib.glsl
eevee_shadow_tilemap_lib.glsl
eevee_shadow_tracing_lib.glsl
eevee_spherical_harmonics_lib.glsl
eevee_subsurface_lib.glsl
eevee_surf_lib.glsl
eevee_surfel_list_lib.glsl
eevee_thickness_lib.glsl
# eevee_transparency_lib.glsl # Require Fragment shader include
# eevee_velocity_lib.glsl # Has dependency on draw_model_lib that is hard to resolve
eevee_volume_lib.glsl
)
add_definitions(-DGPU_SHADER)
# TODO Remove
add_definitions(-DUSE_GPU_SHADER_CREATE_INFO)
function(compile_sources_as_cpp
executable
sources
define
)
foreach(glsl_file ${sources})
set_source_files_properties(${glsl_file} PROPERTIES LANGUAGE CXX)
endforeach()
add_library(${executable} OBJECT ${sources})
set_target_properties(${executable} PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(${executable} PUBLIC ${INC_GLSL})
target_compile_definitions(${executable} PRIVATE ${define})
endfunction()
# Compile shaders with shader code.
if (WITH_GPU_SHADER_CPP_COMPILATION)
compile_sources_as_cpp(eevee_cpp_shaders_vert "${SRC_GLSL_VERT}" "GPU_VERTEX_SHADER")
compile_sources_as_cpp(eevee_cpp_shaders_frag "${SRC_GLSL_FRAG}" "GPU_FRAGMENT_SHADER")
compile_sources_as_cpp(eevee_cpp_shaders_comp "${SRC_GLSL_COMP}" "GPU_COMPUTE_SHADER")
compile_sources_as_cpp(eevee_cpp_shaders_lib "${SRC_GLSL_LIB}" "GPU_LIBRARY_SHADER")
endif()

View File

@@ -4,6 +4,12 @@
#pragma once
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_utility_texture)
SHADER_LIBRARY_CREATE_INFO(eevee_global_ubo)
SHADER_LIBRARY_CREATE_INFO(eevee_hiz_data)
#include "draw_math_geom_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_ray_types_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_ambient_occlusion_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ambient_occlusion_pass)
#include "eevee_horizon_scan_eval_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"

View File

@@ -0,0 +1,91 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "draw_object_infos_info.hh"
#ifdef GPU_LIBRARY_SHADER
# define HAIR_SHADER
# define DRW_HAIR_INFO
#endif
SHADER_LIBRARY_CREATE_INFO(draw_modelmat_new)
SHADER_LIBRARY_CREATE_INFO(draw_resource_handle_new)
SHADER_LIBRARY_CREATE_INFO(draw_hair_new)
#include "common_hair_lib.glsl" /* TODO rename to curve. */
#include "draw_model_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
#ifdef GPU_VERTEX_SHADER
/* -------------------------------------------------------------------- */
/** \name Curve
*
* Curve objects loads attributes from buffers through sampler buffers.
* Per attribute scope follows loading order.
* \{ */
# ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
vec3 P = hair_get_strand_pos();
vec3 lP = transform_point(ModelMatrixInverse, P);
return OrcoTexCoFactors[0].xyz + lP * OrcoTexCoFactors[1].xyz;
}
# endif
int g_curves_attr_id = 0;
/* Return the index to use for looking up the attribute value in the sampler
* based on the attribute scope (point or spline). */
int curves_attribute_element_id()
{
int id = curve_interp_flat.strand_id;
if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0u) {
# ifdef COMMON_HAIR_LIB
id = hair_get_base_id();
# endif
}
g_curves_attr_id += 1;
return id;
}
vec4 attr_load_tangent(samplerBuffer cd_buf)
{
/* Not supported for the moment. */
return vec4(0.0, 0.0, 0.0, 1.0);
}
vec3 attr_load_uv(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curve_interp_flat.strand_id).rgb;
}
vec4 attr_load_color(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curve_interp_flat.strand_id).rgba;
}
vec4 attr_load_vec4(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).rgba;
}
vec3 attr_load_vec3(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).rgb;
}
vec2 attr_load_vec2(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).rg;
}
float attr_load_float(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).r;
}
/** \} */
#endif

View File

@@ -0,0 +1,64 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "draw_object_infos_info.hh"
#ifdef GPU_LIBRARY_SHADER
SHADER_LIBRARY_CREATE_INFO(draw_modelmat_new)
#endif
#include "draw_model_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
/* -------------------------------------------------------------------- */
/** \name Grease Pencil
*
* Grease Pencil objects have one uv and one color attribute layer.
* \{ */
/* Globals to feed the load functions. */
packed_float2 g_uvs;
packed_float4 g_color;
#ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
vec3 lP = point_world_to_object(interp.P);
return OrcoTexCoFactors[0].xyz + lP * OrcoTexCoFactors[1].xyz;
}
#endif
vec4 attr_load_tangent(vec4 tangent)
{
return vec4(0.0, 0.0, 0.0, 1.0);
}
vec3 attr_load_uv(vec3 dummy)
{
return vec3(g_uvs, 0.0);
}
vec4 attr_load_color(vec4 dummy)
{
return g_color;
}
vec4 attr_load_vec4(vec4 attr)
{
return vec4(0.0);
}
vec3 attr_load_vec3(vec3 attr)
{
return vec3(0.0);
}
vec2 attr_load_vec2(vec2 attr)
{
return vec2(0.0);
}
float attr_load_float(float attr)
{
return 0.0;
}
/** \} */

View File

@@ -1,362 +0,0 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "draw_model_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
/* MAT_GEOM_POINT_CLOUD */
#include "common_pointcloud_lib.glsl"
/* MAT_GEOM_CURVES */
#include "common_hair_lib.glsl" /* TODO rename to curve. */
#define EEVEE_ATTRIBUTE_LIB
/* All attributes are loaded in order. This allow us to use a global counter to retrieve the
* correct grid xform. */
/* TODO(fclem): This is very dangerous as it requires a reset for each time `attrib_load` is
* called. Instead, the right attribute index should be passed to attr_load_* functions. */
int g_attr_id = 0;
/* Point clouds and curves are not compatible with volume grids.
* They will fallback to their own attributes loading. */
#if defined(MAT_VOLUME) && !defined(MAT_GEOM_CURVES) && !defined(MAT_GEOM_POINT_CLOUD)
# if defined(VOLUME_INFO_LIB) && !defined(MAT_GEOM_WORLD)
# define GRID_ATTRIBUTES
# endif
/* -------------------------------------------------------------------- */
/** \name Volume
*
* Volume objects loads attributes from "grids" in the form of 3D textures.
* Per grid transform order is following loading order.
* \{ */
# ifdef GRID_ATTRIBUTES
vec3 g_lP = vec3(0.0);
# else
vec3 g_wP = vec3(0.0);
# endif
vec3 grid_coordinates()
{
# ifdef GRID_ATTRIBUTES
vec3 co = (drw_volume.grids_xform[g_attr_id] * vec4(g_lP, 1.0)).xyz;
# else
/* Only for test shaders. All the runtime shaders require `draw_object_infos` and
* `draw_volume_infos`. */
vec3 co = vec3(0.0);
# endif
g_attr_id += 1;
return co;
}
vec3 attr_load_orco(sampler3D tex)
{
g_attr_id += 1;
# ifdef GRID_ATTRIBUTES
return OrcoTexCoFactors[0].xyz + g_lP * OrcoTexCoFactors[1].xyz;
# else
return g_wP;
# endif
}
vec4 attr_load_tangent(sampler3D tex)
{
g_attr_id += 1;
return vec4(0);
}
vec4 attr_load_vec4(sampler3D tex)
{
return texture(tex, grid_coordinates());
}
vec3 attr_load_vec3(sampler3D tex)
{
return texture(tex, grid_coordinates()).rgb;
}
vec2 attr_load_vec2(sampler3D tex)
{
return texture(tex, grid_coordinates()).rg;
}
float attr_load_float(sampler3D tex)
{
return texture(tex, grid_coordinates()).r;
}
vec4 attr_load_color(sampler3D tex)
{
return texture(tex, grid_coordinates());
}
vec3 attr_load_uv(sampler3D attr)
{
g_attr_id += 1;
return vec3(0);
}
/** \} */
#elif defined(MAT_GEOM_MESH)
/* -------------------------------------------------------------------- */
/** \name Mesh
*
* Mesh objects attributes are loaded using vertex input attributes.
* \{ */
# ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
# ifdef GPU_VERTEX_SHADER
/* We know when there is no orco layer when orco.w is 1.0 because it uses the generic vertex
* attribute (which is [0,0,0,1]). */
if (orco.w == 1.0) {
/* If the object does not have any deformation, the orco layer calculation is done on the fly
* using the orco_madd factors. */
return OrcoTexCoFactors[0].xyz + pos * OrcoTexCoFactors[1].xyz;
}
# endif
return orco.xyz * 0.5 + 0.5;
}
# endif
vec4 attr_load_tangent(vec4 tangent)
{
tangent.xyz = safe_normalize(drw_normal_object_to_world(tangent.xyz));
return tangent;
}
vec4 attr_load_vec4(vec4 attr)
{
return attr;
}
vec3 attr_load_vec3(vec3 attr)
{
return attr;
}
vec2 attr_load_vec2(vec2 attr)
{
return attr;
}
float attr_load_float(float attr)
{
return attr;
}
vec4 attr_load_color(vec4 attr)
{
return attr;
}
vec3 attr_load_uv(vec3 attr)
{
return attr;
}
/** \} */
#elif defined(MAT_GEOM_POINT_CLOUD)
/* -------------------------------------------------------------------- */
/** \name Point Cloud
*
* Point Cloud objects loads attributes from buffers through sampler buffers.
* \{ */
# ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
vec3 P = pointcloud_get_pos();
vec3 lP = transform_point(ModelMatrixInverse, P);
return OrcoTexCoFactors[0].xyz + lP * OrcoTexCoFactors[1].xyz;
}
# endif
vec4 attr_load_tangent(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec4(cd_buf);
}
vec3 attr_load_uv(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec3(cd_buf);
}
vec4 attr_load_color(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec4(cd_buf);
}
vec4 attr_load_vec4(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec4(cd_buf);
}
vec3 attr_load_vec3(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec3(cd_buf);
}
vec2 attr_load_vec2(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec2(cd_buf);
}
float attr_load_float(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_float(cd_buf);
}
/** \} */
#elif defined(MAT_GEOM_GPENCIL)
/* -------------------------------------------------------------------- */
/** \name Grease Pencil
*
* Grease Pencil objects have one uv and one color attribute layer.
* \{ */
/* Globals to feed the load functions. */
packed_float2 g_uvs;
packed_float4 g_color;
# ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
vec3 lP = point_world_to_object(interp.P);
return OrcoTexCoFactors[0].xyz + lP * OrcoTexCoFactors[1].xyz;
}
# endif
vec4 attr_load_tangent(vec4 tangent)
{
return vec4(0.0, 0.0, 0.0, 1.0);
}
vec3 attr_load_uv(vec3 dummy)
{
return vec3(g_uvs, 0.0);
}
vec4 attr_load_color(vec4 dummy)
{
return g_color;
}
vec4 attr_load_vec4(vec4 attr)
{
return vec4(0.0);
}
vec3 attr_load_vec3(vec3 attr)
{
return vec3(0.0);
}
vec2 attr_load_vec2(vec2 attr)
{
return vec2(0.0);
}
float attr_load_float(float attr)
{
return 0.0;
}
/** \} */
#elif defined(MAT_GEOM_CURVES) && defined(GPU_VERTEX_SHADER)
/* -------------------------------------------------------------------- */
/** \name Curve
*
* Curve objects loads attributes from buffers through sampler buffers.
* Per attribute scope follows loading order.
* \{ */
# ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
vec3 P = hair_get_strand_pos();
vec3 lP = transform_point(ModelMatrixInverse, P);
return OrcoTexCoFactors[0].xyz + lP * OrcoTexCoFactors[1].xyz;
}
# endif
int g_curves_attr_id = 0;
/* Return the index to use for looking up the attribute value in the sampler
* based on the attribute scope (point or spline). */
int curves_attribute_element_id()
{
int id = curve_interp_flat.strand_id;
if (drw_curves.is_point_attribute[g_curves_attr_id][0] != 0u) {
# ifdef COMMON_HAIR_LIB
id = hair_get_base_id();
# endif
}
g_curves_attr_id += 1;
return id;
}
vec4 attr_load_tangent(samplerBuffer cd_buf)
{
/* Not supported for the moment. */
return vec4(0.0, 0.0, 0.0, 1.0);
}
vec3 attr_load_uv(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curve_interp_flat.strand_id).rgb;
}
vec4 attr_load_color(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curve_interp_flat.strand_id).rgba;
}
vec4 attr_load_vec4(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).rgba;
}
vec3 attr_load_vec3(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).rgb;
}
vec2 attr_load_vec2(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).rg;
}
float attr_load_float(samplerBuffer cd_buf)
{
return texelFetch(cd_buf, curves_attribute_element_id()).r;
}
/** \} */
#elif defined(MAT_GEOM_WORLD)
/* -------------------------------------------------------------------- */
/** \name World
*
* World has no attributes other than orco.
* \{ */
vec3 attr_load_orco(vec4 orco)
{
return -g_data.N;
}
vec4 attr_load_tangent(vec4 tangent)
{
return vec4(0);
}
vec4 attr_load_vec4(vec4 attr)
{
return vec4(0);
}
vec3 attr_load_vec3(vec3 attr)
{
return vec3(0);
}
vec2 attr_load_vec2(vec2 attr)
{
return vec2(0);
}
float attr_load_float(float attr)
{
return 0.0;
}
vec4 attr_load_color(vec4 attr)
{
return vec4(0);
}
vec3 attr_load_uv(vec3 attr)
{
return vec3(0);
}
/** \} */
#endif

View File

@@ -0,0 +1,69 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "draw_object_infos_info.hh"
#ifdef GPU_LIBRARY_SHADER
SHADER_LIBRARY_CREATE_INFO(draw_modelmat_new)
#endif
#include "draw_model_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
/* -------------------------------------------------------------------- */
/** \name Mesh
*
* Mesh objects attributes are loaded using vertex input attributes.
* \{ */
#ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
# ifdef GPU_VERTEX_SHADER
/* We know when there is no orco layer when orco.w is 1.0 because it uses the generic vertex
* attribute (which is [0,0,0,1]). */
if (orco.w == 1.0) {
/* If the object does not have any deformation, the orco layer calculation is done on the fly
* using the orco_madd factors. */
return OrcoTexCoFactors[0].xyz + pos * OrcoTexCoFactors[1].xyz;
}
# endif
return orco.xyz * 0.5 + 0.5;
}
#endif
vec4 attr_load_tangent(vec4 tangent)
{
tangent.xyz = safe_normalize(drw_normal_object_to_world(tangent.xyz));
return tangent;
}
vec4 attr_load_vec4(vec4 attr)
{
return attr;
}
vec3 attr_load_vec3(vec3 attr)
{
return attr;
}
vec2 attr_load_vec2(vec2 attr)
{
return attr;
}
float attr_load_float(float attr)
{
return attr;
}
vec4 attr_load_color(vec4 attr)
{
return attr;
}
vec3 attr_load_uv(vec3 attr)
{
return attr;
}
/** \} */

View File

@@ -0,0 +1,68 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "draw_object_infos_info.hh"
#ifdef GPU_LIBRARY_SHADER
# define POINTCLOUD_SHADER
# define DRW_POINTCLOUD_INFO
#endif
SHADER_LIBRARY_CREATE_INFO(draw_modelmat_new)
SHADER_LIBRARY_CREATE_INFO(draw_resource_handle_new)
SHADER_LIBRARY_CREATE_INFO(draw_pointcloud_new)
#include "draw_model_lib.glsl"
#include "draw_pointcloud_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
/* -------------------------------------------------------------------- */
/** \name Point Cloud
*
* Point Cloud objects loads attributes from buffers through sampler buffers.
* \{ */
#ifdef OBINFO_LIB
vec3 attr_load_orco(vec4 orco)
{
vec3 P = pointcloud_get_pos();
vec3 lP = transform_point(ModelMatrixInverse, P);
return OrcoTexCoFactors[0].xyz + lP * OrcoTexCoFactors[1].xyz;
}
#endif
vec4 attr_load_tangent(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec4(cd_buf);
}
vec3 attr_load_uv(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec3(cd_buf);
}
vec4 attr_load_color(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec4(cd_buf);
}
vec4 attr_load_vec4(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec4(cd_buf);
}
vec3 attr_load_vec3(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec3(cd_buf);
}
vec2 attr_load_vec2(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_vec2(cd_buf);
}
float attr_load_float(samplerBuffer cd_buf)
{
return pointcloud_get_customdata_float(cd_buf);
}
/** \} */

View File

@@ -0,0 +1,98 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "draw_object_infos_info.hh"
#ifdef GPU_LIBRARY_SHADER
SHADER_LIBRARY_CREATE_INFO(draw_modelmat_new)
#endif
#include "draw_model_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
/* All attributes are loaded in order. This allow us to use a global counter to retrieve the
* correct grid xform. */
/* TODO(fclem): This is very dangerous as it requires a reset for each time `attrib_load` is
* called. Instead, the right attribute index should be passed to attr_load_* functions. */
int g_attr_id = 0;
/* Point clouds and curves are not compatible with volume grids.
* They will fallback to their own attributes loading. */
#if defined(MAT_VOLUME) && !defined(MAT_GEOM_CURVES) && !defined(MAT_GEOM_POINT_CLOUD)
# if defined(VOLUME_INFO_LIB) && !defined(MAT_GEOM_WORLD)
# define GRID_ATTRIBUTES
# endif
/* -------------------------------------------------------------------- */
/** \name Volume
*
* Volume objects loads attributes from "grids" in the form of 3D textures.
* Per grid transform order is following loading order.
* \{ */
# ifdef GRID_ATTRIBUTES
vec3 g_lP = vec3(0.0);
# else
vec3 g_wP = vec3(0.0);
# endif
vec3 grid_coordinates()
{
# ifdef GRID_ATTRIBUTES
vec3 co = (drw_volume.grids_xform[g_attr_id] * vec4(g_lP, 1.0)).xyz;
# else
/* Only for test shaders. All the runtime shaders require `draw_object_infos` and
* `draw_volume_infos`. */
vec3 co = vec3(0.0);
# endif
g_attr_id += 1;
return co;
}
vec3 attr_load_orco(sampler3D tex)
{
g_attr_id += 1;
# ifdef GRID_ATTRIBUTES
return OrcoTexCoFactors[0].xyz + g_lP * OrcoTexCoFactors[1].xyz;
# else
return g_wP;
# endif
}
vec4 attr_load_tangent(sampler3D tex)
{
g_attr_id += 1;
return vec4(0);
}
vec4 attr_load_vec4(sampler3D tex)
{
return texture(tex, grid_coordinates());
}
vec3 attr_load_vec3(sampler3D tex)
{
return texture(tex, grid_coordinates()).rgb;
}
vec2 attr_load_vec2(sampler3D tex)
{
return texture(tex, grid_coordinates()).rg;
}
float attr_load_float(sampler3D tex)
{
return texture(tex, grid_coordinates()).r;
}
vec4 attr_load_color(sampler3D tex)
{
return texture(tex, grid_coordinates());
}
vec3 attr_load_uv(sampler3D attr)
{
g_attr_id += 1;
return vec3(0);
}
/** \} */
#endif

View File

@@ -0,0 +1,50 @@
/* SPDX-FileCopyrightText: 2022-2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
/* -------------------------------------------------------------------- */
/** \name World
*
* World has no attributes other than orco.
* \{ */
vec3 attr_load_orco(vec4 orco)
{
return -g_data.N;
}
vec4 attr_load_tangent(vec4 tangent)
{
return vec4(0);
}
vec4 attr_load_vec4(vec4 attr)
{
return vec4(0);
}
vec3 attr_load_vec3(vec3 attr)
{
return vec3(0);
}
vec2 attr_load_vec2(vec2 attr)
{
return vec2(0);
}
float attr_load_float(float attr)
{
return 0.0;
}
vec4 attr_load_color(vec4 attr)
{
return vec4(0);
}
vec3 attr_load_uv(vec3 attr)
{
return vec3(0);
}
/** \} */

View File

@@ -4,6 +4,8 @@
#pragma once
#include "infos/eevee_common_info.hh"
/**
* BxDF evaluation functions.
*/

View File

@@ -4,6 +4,10 @@
#pragma once
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_utility_texture)
#include "eevee_bxdf_lib.glsl"
#include "eevee_thickness_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"

View File

@@ -4,6 +4,8 @@
#pragma once
#include "infos/eevee_common_info.hh"
/**
* Camera projection / uv functions and utils.
*/

View File

@@ -4,6 +4,10 @@
#pragma once
#include "infos/eevee_film_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_film)
/** Storing/merging and sorting cryptomatte samples. */
bool cryptomatte_can_merge_sample(vec2 dst, vec2 src)

View File

@@ -7,6 +7,10 @@
* This also fills the different render passes.
*/
#include "infos/eevee_deferred_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_debug_gbuffer)
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "eevee_renderpass_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_volume_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_debug_irradiance_grid)
void main()
{
out_color = interp_color;

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_volume_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_debug_irradiance_grid)
#include "draw_view_lib.glsl"
#include "eevee_lightprobe_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_volume_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_debug_surfels)
#include "eevee_sampling_lib.glsl"
#include "gpu_shader_debug_gradients_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_volume_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_debug_surfels)
#include "draw_view_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Compute light objects lighting contribution using captured Gbuffer data.
*/
#include "infos/eevee_deferred_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_deferred_capture_eval)
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "eevee_light_eval_lib.glsl"

View File

@@ -7,6 +7,10 @@
* This also fills the different render passes.
*/
#include "infos/eevee_deferred_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_deferred_combine)
#include "eevee_colorspace_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "eevee_renderpass_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Compute light objects lighting contribution using Gbuffer data.
*/
#include "infos/eevee_deferred_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_deferred_light)
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "eevee_light_eval_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Compute light objects lighting contribution using captured Gbuffer data.
*/
#include "infos/eevee_deferred_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_deferred_planar_eval)
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "eevee_light_eval_lib.glsl"

View File

@@ -10,6 +10,10 @@
* - tilemaps_tx
*/
#include "infos/eevee_deferred_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_deferred_thickness_amend)
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "eevee_light_iter_lib.glsl"

View File

@@ -7,6 +7,10 @@
* lighting complexity.
*/
#include "infos/eevee_deferred_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_deferred_tile_classify)
#include "eevee_gbuffer_lib.glsl"
void main()

View File

@@ -10,6 +10,13 @@
* One is for the half-resolution gather passes and the other one for slight in focus regions.
*/
#include "infos/eevee_depth_of_field_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_depth_of_field_lut)
#ifdef GPU_LIBRARY_SHADER
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_gather)
#endif
#include "draw_view_lib.glsl"
#include "eevee_colorspace_lib.glsl"
#include "eevee_depth_of_field_lib.glsl"
@@ -68,7 +75,7 @@ struct DofGatherData {
float layer_opacity;
#ifdef GPU_METAL
#if defined(GPU_METAL) || defined(GLSL_CPP_STUBS)
/* Explicit constructors -- To support GLSL syntax. */
inline DofGatherData() = default;
inline DofGatherData(vec4 in_color,

View File

@@ -10,6 +10,10 @@
* as it is way more complex and expensive to do.
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_bokeh_lut)
#include "eevee_depth_of_field_lib.glsl"
void main()

View File

@@ -9,6 +9,10 @@
* Also does not weight luma for the bilateral weights.
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_downsample)
#include "eevee_depth_of_field_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"

View File

@@ -9,11 +9,15 @@
* cheaper.
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_filter)
struct FilterSample {
vec4 color;
float weight;
#ifdef GPU_METAL
#if defined(GPU_METAL) || defined(GLSL_CPP_STUBS)
inline FilterSample() = default;
inline FilterSample(vec4 in_color, float in_weight) : color(in_color), weight(in_weight) {}
#endif

View File

@@ -15,6 +15,10 @@
* - Color * Weight, Weight, Occlusion 'CoC' Depth (mean and variance)
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_gather)
#include "eevee_depth_of_field_accumulator_lib.glsl"
void main()

View File

@@ -12,6 +12,10 @@
* rotation to ensure maximum coverage.
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_hole_fill)
#include "eevee_depth_of_field_accumulator_lib.glsl"
void main()

View File

@@ -8,6 +8,8 @@
* Depth of Field utils.
*/
#include "infos/eevee_common_info.hh"
#include "draw_view_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -15,6 +15,10 @@
* - Gather input color (whole mip chain), Scatter rect list, Signed CoC (whole mip chain).
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_reduce)
#include "eevee_depth_of_field_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"

View File

@@ -11,6 +11,10 @@
* in-focus and defocus regions.
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_resolve)
#include "eevee_depth_of_field_accumulator_lib.glsl"
/* Workarounds for Metal/AMD issue where atomicMax lead to incorrect results.

View File

@@ -9,6 +9,10 @@
* invocations and overdraw.
*/
#include "infos/eevee_depth_of_field_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_depth_of_field_scatter)
#include "eevee_depth_of_field_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"

View File

@@ -9,6 +9,10 @@
* invocations and overdraw.
*/
#include "infos/eevee_depth_of_field_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_depth_of_field_scatter)
#include "eevee_depth_of_field_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"

View File

@@ -14,6 +14,10 @@
* Half-resolution Color, signed CoC (out_coc.x), and max slight focus abs CoC (out_coc.y).
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_setup)
#include "draw_view_lib.glsl"
#include "eevee_colorspace_lib.glsl"
#include "eevee_depth_of_field_lib.glsl"

View File

@@ -17,6 +17,10 @@
* - Stabilized Color and CoC (half-resolution).
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_stabilize)
#include "eevee_colorspace_lib.glsl"
#include "eevee_depth_of_field_lib.glsl"
#include "eevee_velocity_lib.glsl"
@@ -25,7 +29,7 @@ struct DofSample {
vec4 color;
float coc;
#ifdef GPU_METAL
#if defined(GPU_METAL) || defined(GLSL_CPP_STUBS)
/* Explicit constructors -- To support GLSL syntax. */
inline DofSample() = default;
inline DofSample(vec4 in_color, float in_coc) : color(in_color), coc(in_coc) {}
@@ -154,7 +158,7 @@ struct DofNeighborhoodMinMax {
DofSample min;
DofSample max;
#ifdef GPU_METAL
#if defined(GPU_METAL) || defined(GLSL_CPP_STUBS)
/* Explicit constructors -- To support GLSL syntax. */
inline DofNeighborhoodMinMax() = default;
inline DofNeighborhoodMinMax(DofSample in_min, DofSample in_max) : min(in_min), max(in_max) {}

View File

@@ -10,6 +10,10 @@
* - Separated foreground and background CoC. 1/8th of half-res resolution. So 1/16th of full-res.
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_tiles_dilate)
#include "eevee_depth_of_field_lib.glsl"
/* Error introduced by the random offset of the gathering kernel's center. */

View File

@@ -15,6 +15,10 @@
* - Separated foreground and background CoC. 1/8th of half-res resolution. So 1/16th of full-res.
*/
#include "infos/eevee_depth_of_field_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_depth_of_field_tiles_flatten)
#include "eevee_depth_of_field_lib.glsl"
/**

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_sphere_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_display_lightprobe_planar)
#include "draw_view_lib.glsl"
#include "eevee_lightprobe_sphere_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_sphere_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_display_lightprobe_planar)
#include "draw_view_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_sphere_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_display_lightprobe_sphere)
#include "draw_view_lib.glsl"
#include "eevee_lightprobe_sphere_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_sphere_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_display_lightprobe_sphere)
#include "draw_view_lib.glsl"
#include "eevee_lightprobe_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_volume_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_display_lightprobe_volume)
#include "draw_view_lib.glsl"
#include "eevee_spherical_harmonics_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lightprobe_volume_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_display_lightprobe_volume)
#include "draw_view_lib.glsl"
#include "eevee_lightprobe_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_film_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_film_comp)
#include "eevee_film_lib.glsl"
void main()

View File

@@ -11,6 +11,11 @@
*
* Code is duplicated here to ensure that the compiler will pass read/write resource checks.
*/
#include "infos/eevee_film_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_film_copy_frag)
#include "common_math_lib.glsl"
#include "draw_view_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_film_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_film_cryptomatte_post)
#include "gpu_shader_math_base_lib.glsl"
#define CRYPTOMATTE_LEVELS_MAX 16

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_film_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_film_frag)
#include "eevee_film_lib.glsl"
void main()

View File

@@ -8,6 +8,10 @@
* Film accumulation utils functions.
*/
#include "infos/eevee_film_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_film)
#include "draw_math_geom_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_colorspace_lib.glsl"

View File

@@ -6,6 +6,10 @@
* output passes covert the entire display extent even when border rendering because that's what
* the compositor expects, so areas outside of the border are zeroed. */
#include "infos/eevee_film_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_film_pass_convert_color)
void main()
{
ivec2 texel = ivec2(gl_GlobalInvocationID.xy);

View File

@@ -20,6 +20,8 @@
* without dealing with none-closures.
*/
#include "infos/eevee_common_info.hh"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -2,9 +2,14 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_material_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_SHADER_CREATE_INFO(eevee_geom_curves)
#include "common_hair_lib.glsl" /* TODO rename to curve. */
#include "draw_model_lib.glsl"
#include "eevee_attributes_lib.glsl"
#include "eevee_attributes_curves_lib.glsl"
#include "eevee_nodetree_lib.glsl"
#include "eevee_surf_lib.glsl"
#include "eevee_velocity_lib.glsl"

View File

@@ -2,10 +2,15 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_material_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_SHADER_CREATE_INFO(eevee_geom_gpencil)
#include "draw_model_lib.glsl"
/* Grease pencil includes commmon_view_lib. */
// #include "common_gpencil_lib.glsl"
#include "eevee_attributes_lib.glsl"
#include "eevee_attributes_gpencil_lib.glsl"
#include "eevee_surf_lib.glsl"
#include "eevee_velocity_lib.glsl"

View File

@@ -2,8 +2,13 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_material_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_SHADER_CREATE_INFO(eevee_geom_mesh)
#include "draw_model_lib.glsl"
#include "eevee_attributes_lib.glsl"
#include "eevee_attributes_mesh_lib.glsl"
#include "eevee_nodetree_lib.glsl"
#include "eevee_surf_lib.glsl"
#include "eevee_velocity_lib.glsl"

View File

@@ -2,9 +2,14 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "common_pointcloud_lib.glsl"
#include "infos/eevee_material_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_SHADER_CREATE_INFO(eevee_geom_point_cloud)
#include "draw_model_lib.glsl"
#include "eevee_attributes_lib.glsl"
#include "draw_pointcloud_lib.glsl"
#include "eevee_attributes_point_cloud_lib.glsl"
#include "eevee_nodetree_lib.glsl"
#include "eevee_surf_lib.glsl"
#include "eevee_velocity_lib.glsl"

View File

@@ -2,7 +2,11 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "common_pointcloud_lib.glsl"
#include "infos/eevee_material_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_SHADER_CREATE_INFO(eevee_geom_volume)
#include "draw_model_lib.glsl"
#include "eevee_surf_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Custom full-screen triangle with placeholders varyings.
*/
#include "infos/eevee_material_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_geom_world)
#include "draw_view_lib.glsl"
#include "eevee_nodetree_lib.glsl"
#include "eevee_surf_lib.glsl"

View File

@@ -7,6 +7,10 @@
* Output red if above any max pixels, blue otherwise.
*/
#include "infos/eevee_hiz_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_hiz_debug)
void main()
{
ivec2 texel = ivec2(gl_FragCoord.xy);

View File

@@ -17,6 +17,10 @@
* downsample to max level.
*/
#include "infos/eevee_hiz_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_hiz_update)
#include "gpu_shader_math_vector_lib.glsl"
shared float local_depths[gl_WorkGroupSize.y][gl_WorkGroupSize.x];

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_horizon_denoise)
#include "draw_view_lib.glsl"
#include "eevee_filter_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_horizon_resolve)
#include "draw_view_lib.glsl"
#include "eevee_closure_lib.glsl"
#include "eevee_filter_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_horizon_scan)
#include "draw_view_lib.glsl"
#include "eevee_horizon_scan_eval_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -15,6 +15,10 @@
* defined.
*/
#include "infos/eevee_tracing_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_horizon_scan)
#include "common_shape_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_bxdf_lib.glsl"

View File

@@ -8,6 +8,10 @@
* Dispatched as one thread for each trace resolution pixel.
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_horizon_setup)
#include "draw_view_lib.glsl"
#include "eevee_colorspace_lib.glsl"
#include "eevee_gbuffer_lib.glsl"

View File

@@ -8,6 +8,10 @@
* pass is not conservative enough).
*/
#include "infos/eevee_light_culling_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_light_culling_debug)
#include "draw_view_lib.glsl"
#include "eevee_light_iter_lib.glsl"
#include "eevee_light_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Select the visible items inside the active view and put them inside the sorting buffer.
*/
#include "infos/eevee_light_culling_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_light_culling_select)
#include "draw_intersect_lib.glsl"
#include "draw_math_geom_lib.glsl"
#include "draw_view_lib.glsl"

View File

@@ -8,6 +8,10 @@
* One thread processes one Light entity.
*/
#include "infos/eevee_light_culling_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_light_culling_sort)
#include "gpu_shader_math_base_lib.glsl"
shared float zdists_cache[gl_WorkGroupSize.x];

View File

@@ -8,6 +8,10 @@
* Dispatch one thread per word.
*/
#include "infos/eevee_light_culling_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_light_culling_tile)
#include "common_intersect_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_light_iter_lib.glsl"

View File

@@ -8,6 +8,10 @@
* For this reason, we only dispatch 1 thread group.
*/
#include "infos/eevee_light_culling_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_light_culling_zbin)
#include "draw_view_lib.glsl"
#include "eevee_light_iter_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"

View File

@@ -15,6 +15,10 @@
* - utility_tx
*/
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_light_data)
#include "eevee_bxdf_lib.glsl"
#include "eevee_closure_lib.glsl"
#include "eevee_light_lib.glsl"
@@ -27,6 +31,8 @@
/* If using compute, the shader should define its own pixel. */
#if !defined(PIXEL) && defined(GPU_FRAGMENT_SHADER)
# define PIXEL gl_FragCoord.xy
#elif defined(GPU_LIBRARY_SHADER)
# define PIXEL vec2(0)
#endif
#if !defined(LIGHT_CLOSURE_EVAL_COUNT)

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
uint bitfield_mask(uint bit_width, uint bit_min)
{
/* Cannot bit shift more than 31 positions. */

View File

@@ -7,6 +7,10 @@
* Dispatched one thread per light.
*/
#include "infos/eevee_light_culling_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_light_shadow_setup)
#include "eevee_sampling_lib.glsl"
#include "gpu_shader_math_fast_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"

View File

@@ -4,6 +4,20 @@
#pragma once
#include "infos/eevee_lightprobe_sphere_info.hh"
/* TODO(fclem): Pass the lightprobe_sphere_buf around and avoid relying on interface.
* Currently in conflict with eevee_lightprobe_volume_load. */
#ifndef SPHERE_PROBE_SELECT
SHADER_LIBRARY_CREATE_INFO(eevee_lightprobe_sphere_data)
#endif
SHADER_LIBRARY_CREATE_INFO(eevee_lightprobe_planar_data)
/* TODO(fclem): Pass the atlas texture around and avoid relying on interface.
* Currently in conflict with eevee_lightprobe_volume_load. */
#ifndef IRRADIANCE_GRID_UPLOAD
SHADER_LIBRARY_CREATE_INFO(eevee_volume_probe_data)
#endif
#include "gpu_shader_math_vector_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -4,6 +4,10 @@
/* Shader to convert cube-map to octahedral projection. */
#include "infos/eevee_lightprobe_sphere_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_sphere_convolve)
#include "eevee_lightprobe_sphere_mapping_lib.glsl"
#include "eevee_sampling_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"

View File

@@ -5,6 +5,10 @@
/* Sum all spherical harmonic coefficients extracting during remapping to octahedral map.
* Dispatch only one thread-group that sums. */
#include "infos/eevee_lightprobe_sphere_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_sphere_irradiance)
#include "eevee_lightprobe_sphere_lib.glsl"
#include "eevee_lightprobe_sphere_mapping_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -4,6 +4,14 @@
#pragma once
#include "infos/eevee_lightprobe_sphere_info.hh"
/* TODO(fclem): Pass the lightprobe_sphere_buf around and avoid relying on interface.
* Currently in conflict with eevee_lightprobe_volume_load. */
#ifndef SPHERE_PROBE_SELECT
SHADER_LIBRARY_CREATE_INFO(eevee_lightprobe_sphere_data)
#endif
#include "eevee_lightprobe_sphere_mapping_lib.glsl"
#include "eevee_octahedron_lib.glsl"
#include "eevee_spherical_harmonics_lib.glsl"

View File

@@ -4,6 +4,8 @@
#pragma once
#include "infos/eevee_common_info.hh"
#include "eevee_octahedron_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"
#include "gpu_shader_math_fast_lib.glsl"

View File

@@ -4,6 +4,10 @@
/* Shader to convert cube-map to octahedral projection. */
#include "infos/eevee_lightprobe_sphere_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_sphere_remap)
#include "eevee_colorspace_lib.glsl"
#include "eevee_lightprobe_sphere_mapping_lib.glsl"
#include "eevee_spherical_harmonics_lib.glsl"

View File

@@ -7,6 +7,14 @@
* irradiance cache from each spherical probe location except for the world probe.
*/
#include "infos/eevee_lightprobe_sphere_info.hh"
#ifdef GLSL_CPP_STUBS
# define SPHERE_PROBE_SELECT
# undef SPHERE_PROBE
#endif
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_sphere_select)
#include "eevee_lightprobe_sphere_lib.glsl"
#include "eevee_lightprobe_volume_eval_lib.glsl"

View File

@@ -5,6 +5,10 @@
/* Sum all Suns extracting during remapping to octahedral map.
* Dispatch only one thread-group that sums. */
#include "infos/eevee_lightprobe_sphere_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_sphere_sunlight)
#include "eevee_lightprobe_sphere_lib.glsl"
#include "eevee_lightprobe_sphere_mapping_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -9,6 +9,10 @@
* - capture_info_buf
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_volume_bounds)
#include "draw_intersect_lib.glsl"
#include "eevee_light_iter_lib.glsl"
#include "eevee_shadow_tilemap_lib.glsl"

View File

@@ -82,7 +82,7 @@ vec3 lightprobe_volume_grid_bias_sample_coord(VolumeProbeData grid_data,
for (int i = 0; i < 8; i++) {
ivec3 sample_position = lightprobe_volume_grid_cell_corner(i);
vec3 trilinear = select(1.0 - cell_fract, cell_fract, bvec3(sample_position));
vec3 trilinear = select(1.0 - cell_fract, cell_fract, greaterThan(sample_position, ivec3(0)));
float positional_weight = trilinear.x * trilinear.y * trilinear.z;
float len;

View File

@@ -9,6 +9,14 @@
* Each thread group will load a brick worth of data and add the needed padding texels.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
#ifdef GLSL_CPP_STUBS
# define IRRADIANCE_GRID_UPLOAD
#endif
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_volume_load)
#include "eevee_lightprobe_volume_eval_lib.glsl"
#include "eevee_spherical_harmonics_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"

View File

@@ -10,6 +10,10 @@
* Dispatched as 1 thread per irradiance probe sample.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_volume_offset)
#include "eevee_lightprobe_lib.glsl"
#include "eevee_surfel_list_lib.glsl"

View File

@@ -10,6 +10,10 @@
* Dispatched as 1 thread per irradiance probe sample.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_volume_ray)
#include "eevee_lightprobe_lib.glsl"
#include "eevee_lightprobe_sphere_lib.glsl"
#include "eevee_spherical_harmonics_lib.glsl"

View File

@@ -8,6 +8,10 @@
* The whole thread group will load the same data and write a brick worth of data.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lightprobe_volume_world)
#include "eevee_spherical_harmonics_lib.glsl"
void atlas_store(vec4 sh_coefficient, ivec2 atlas_coord, int layer)

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lookdev_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_lookdev_display)
void main()
{
vec2 texture_size = vec2(textureSize(metallic_tx, 0));

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_lookdev_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_lookdev_display)
void main()
{
uint vert_index = gl_VertexID < 3 ? gl_VertexID : gl_VertexID - 2;

View File

@@ -4,6 +4,8 @@
#pragma once
#include "infos/eevee_common_info.hh"
/**
* Adapted from :
* Real-Time Polygonal-Light Shading with Linearly Transformed Cosines.

View File

@@ -7,6 +7,10 @@
* the blender executable. This is only used for reference or to update them.
*/
#include "infos/eevee_lut_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_lut)
#include "eevee_bxdf_sampling_lib.glsl"
#include "eevee_sampling_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"

View File

@@ -7,6 +7,10 @@
* Outputs the largest intersecting motion vector in the neighborhood.
*/
#include "infos/eevee_motion_blur_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_motion_blur_tiles_dilate)
#include "draw_math_geom_lib.glsl"
#include "eevee_motion_blur_lib.glsl"

View File

@@ -14,6 +14,10 @@
* Adapted from G3D Innovation Engine implementation.
*/
#include "infos/eevee_motion_blur_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_motion_blur_tiles_flatten_rgba)
#include "draw_math_geom_lib.glsl"
#include "eevee_velocity_lib.glsl"

View File

@@ -13,6 +13,10 @@
* by Jorge Jimenez
*/
#include "infos/eevee_motion_blur_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_motion_blur_gather)
#include "draw_view_lib.glsl"
#include "eevee_motion_blur_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -4,6 +4,8 @@
#pragma once
#include "infos/eevee_common_info.hh"
/* -------------------------------------------------------------------- */
/** \name Tile indirection packing
* \{ */

View File

@@ -4,6 +4,11 @@
#pragma once
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_global_ubo)
SHADER_LIBRARY_CREATE_INFO(eevee_utility_texture)
#include "draw_model_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_renderpass_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Convert hit list to occupancy bit-field for the material pass.
*/
#include "infos/eevee_volume_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_volume_occupancy_convert)
#include "eevee_occupancy_lib.glsl"
bool is_front_face_hit(float stored_hit_depth)

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
/**
* Convert from a cube-map vector to an octahedron UV coordinate.
*/

View File

@@ -15,6 +15,10 @@
* https://www.ea.com/seed/news/seed-dd18-presentation-slides-raytracing
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_denoise_bilateral)
#include "draw_view_lib.glsl"
#include "eevee_closure_lib.glsl"
#include "eevee_filter_lib.glsl"

View File

@@ -15,6 +15,10 @@
* https://www.ea.com/seed/news/seed-dd18-presentation-slides-raytracing
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_denoise_spatial)
#include "draw_view_lib.glsl"
#include "eevee_bxdf_lib.glsl"
#include "eevee_bxdf_sampling_lib.glsl"

View File

@@ -15,6 +15,10 @@
* https://www.ea.com/seed/news/seed-dd18-presentation-slides-raytracing
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_denoise_temporal)
#include "draw_view_lib.glsl"
#include "eevee_colorspace_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"

View File

@@ -7,6 +7,10 @@
* by the next pass to trace the rays.
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_generate)
#include "eevee_gbuffer_lib.glsl"
#include "eevee_ray_generate_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -7,6 +7,10 @@
* This mask is then processed by the compaction phase.
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_tile_classify)
#include "eevee_closure_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"

View File

@@ -8,6 +8,10 @@
* Dispatched as one thread for each trace resolution tile.
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_tile_compact)
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Does not use any tracing method. Only rely on local light probes to get the incoming radiance.
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_trace_fallback)
#include "eevee_bxdf_sampling_lib.glsl"
#include "eevee_colorspace_lib.glsl"
#include "eevee_gbuffer_lib.glsl"

View File

@@ -9,6 +9,10 @@
* are then tagged to avoid re-evaluation by screen trace.
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_trace_planar)
#include "eevee_bxdf_sampling_lib.glsl"
#include "eevee_colorspace_lib.glsl"
#include "eevee_gbuffer_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Use screen space tracing against depth buffer to find intersection with the scene.
*/
#include "infos/eevee_tracing_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_ray_trace_screen)
#include "eevee_bxdf_sampling_lib.glsl"
#include "eevee_closure_lib.glsl"
#include "eevee_colorspace_lib.glsl"

View File

@@ -15,8 +15,11 @@
*/
#include "draw_view_lib.glsl"
#include "eevee_bxdf_diffuse_lib.glsl"
#include "eevee_bxdf_microfacet_lib.glsl"
#include "eevee_ray_types_lib.glsl"
#include "eevee_thickness_lib.glsl"
#include "gpu_shader_codegen_lib.glsl"
#include "gpu_shader_math_fast_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"

View File

@@ -6,6 +6,10 @@
* Clear render passes and background.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_renderpass_clear)
#include "eevee_renderpass_lib.glsl"
void main()

View File

@@ -4,6 +4,10 @@
#pragma once
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_render_pass_out)
void output_renderpass_color(int id, vec4 color)
{
#if defined(MAT_RENDER_PASS_SUPPORT) && defined(GPU_FRAGMENT_SHADER)

View File

@@ -9,6 +9,10 @@
* Also contains some sample mapping functions.
*/
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_sampling_data)
#include "gpu_shader_math_base_lib.glsl"
/* -------------------------------------------------------------------- */

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_clipmap_clear)
#include "gpu_shader_utildefines_lib.glsl"
void main()

View File

@@ -7,6 +7,10 @@
* See eShadowDebug for more information.
*/
#include "infos/eevee_shadow_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_shadow_debug)
#include "draw_view_lib.glsl"
#include "eevee_light_iter_lib.glsl"
#include "eevee_light_lib.glsl"

View File

@@ -9,6 +9,10 @@
* Note that allocation can fail, in this case the tile is left with no page.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_page_allocate)
#include "eevee_shadow_page_ops_lib.glsl"
#include "eevee_shadow_tilemap_lib.glsl"

View File

@@ -8,6 +8,10 @@
* Equivalent to a frame-buffer depth clear but only for pages pushed to the clear_page_buf.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_page_clear)
#include "gpu_shader_utildefines_lib.glsl"
void main()

View File

@@ -18,6 +18,10 @@
* `[----xxxxxx------]`
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_page_defrag)
#include "eevee_shadow_page_ops_lib.glsl"
#define max_page uint(SHADOW_MAX_PAGE)

View File

@@ -10,6 +10,10 @@
* Note that we also count the number of new page allocations needed.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_page_free)
#include "eevee_shadow_page_ops_lib.glsl"
#include "eevee_shadow_tilemap_lib.glsl"

View File

@@ -9,6 +9,10 @@
* views per shadow map).
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_page_mask)
#include "eevee_shadow_tilemap_lib.glsl"
/* Reuse the same enum values for these transient flag during the amend phase.

View File

@@ -27,6 +27,12 @@
* IMPORTANT: Do not forget to manually store the tile data after doing operations on them.
*/
#include "infos/eevee_shadow_info.hh"
#ifdef GPU_LIBRARY_SHADER
SHADER_LIBRARY_CREATE_INFO(eevee_shadow_page_free)
#endif
#include "eevee_shadow_tilemap_lib.glsl"
/* Remove page ownership from the tile and append it to the cache. */

View File

@@ -35,6 +35,10 @@
* belong to shadow pages not being updated in this pass are discarded.
**/
#include "infos/eevee_shadow_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_shadow_page_tile_clear)
#include "eevee_shadow_tilemap_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -7,6 +7,11 @@
*
* See fragment shader for more infos.
*/
#include "infos/eevee_shadow_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_shadow_page_tile_clear)
#include "eevee_shadow_tilemap_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -11,6 +11,10 @@
* tag the appropriate tiles.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tag_update)
#include "common_aabb_lib.glsl"
#include "common_intersect_lib.glsl"

View File

@@ -10,6 +10,10 @@
* needed.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tag_usage_opaque)
#include "eevee_shadow_tag_usage_lib.glsl"
void main()

View File

@@ -10,6 +10,10 @@
* tiles.
*/
#include "infos/eevee_shadow_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_shadow_tag_usage_transparent)
#include "draw_model_lib.glsl"
#include "eevee_shadow_tag_usage_lib.glsl"

View File

@@ -11,6 +11,12 @@
* This contains the common logic used for tagging shadows for opaque and transparent receivers.
*/
#include "infos/eevee_shadow_info.hh"
#ifdef GPU_LIBRARY_SHADER
SHADER_LIBRARY_CREATE_INFO(eevee_shadow_tag_usage_surfels)
#endif
#include "draw_intersect_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_light_iter_lib.glsl"

View File

@@ -10,6 +10,10 @@
* needed.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tag_usage_surfels)
#include "eevee_shadow_tag_usage_lib.glsl"
void main()

View File

@@ -9,6 +9,10 @@
* This renders the bounding boxes for transparent objects in order to tag the correct shadows.
*/
#include "infos/eevee_shadow_info.hh"
VERTEX_SHADER_CREATE_INFO(eevee_shadow_tag_usage_transparent)
#include "common_shape_lib.glsl"
#include "draw_model_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"

View File

@@ -9,6 +9,10 @@
* This pass scans all volume froxels and tags tiles needed for shadowing.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tag_usage_volume)
#include "eevee_sampling_lib.glsl"
#include "eevee_shadow_tag_usage_lib.glsl"
#include "eevee_volume_lib.glsl"

View File

@@ -15,6 +15,10 @@
* Currently this shader is dispatched with one thread-group for all directional light.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tilemap_amend)
#include "eevee_light_iter_lib.glsl"
#include "eevee_shadow_tilemap_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"

View File

@@ -10,6 +10,10 @@
* their range changes.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tilemap_bounds)
#include "common_intersect_lib.glsl"
#include "eevee_light_iter_lib.glsl"
#include "eevee_shadow_tilemap_lib.glsl"

View File

@@ -10,6 +10,10 @@
* to use a sampler instead of a SSBO bind.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tilemap_finalize)
#include "eevee_shadow_tilemap_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -10,6 +10,10 @@
* Dispatched with one local thread per LOD0 tile and one work-group per tile-map.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tilemap_init)
#include "eevee_shadow_tilemap_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -4,6 +4,8 @@
#pragma once
#include "infos/eevee_common_info.hh"
#include "common_shape_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -8,6 +8,10 @@
* For each shadow view, copy page atlas location to the indirection table before render.
*/
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_tilemap_rendermap)
#include "eevee_shadow_tilemap_lib.glsl"
void main()

View File

@@ -8,6 +8,11 @@
* Evaluate shadowing using shadow map ray-tracing.
*/
#include "infos/eevee_shadow_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_global_ubo)
SHADER_LIBRARY_CREATE_INFO(eevee_shadow_data)
#include "draw_math_geom_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_bxdf_sampling_lib.glsl"
@@ -424,6 +429,8 @@ float shadow_eval(LightData light,
vec2 pixel = floor(gl_FragCoord.xy);
# elif defined(GPU_COMPUTE_SHADER)
vec2 pixel = vec2(gl_GlobalInvocationID.xy);
# else
vec2 pixel = UTIL_TEXEL;
# endif
vec3 blue_noise_3d = utility_tx_fetch(utility_tx, pixel, UTIL_BLUE_NOISE_LAYER).rgb;
vec3 random_shadow_3d = fract(blue_noise_3d + sampling_rng_3D_get(SAMPLING_SHADOW_U));

View File

@@ -8,9 +8,13 @@
*/
/* TODO(fclem): Could reject bounding boxes that are covering only invalid tiles. */
#include "infos/eevee_shadow_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_shadow_view_visibility)
#include "common_intersect_lib.glsl"
#include "common_math_lib.glsl"
#include "common_view_lib.glsl"
#include "draw_view_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"
bool shadow_linking_affects_caster(uint view_id, uint resource_id)

View File

@@ -13,6 +13,10 @@
* we precompute a weight profile texture to be able to support per pixel AND per channel radius.
*/
#include "infos/eevee_subsurface_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_subsurface_convolve)
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -11,6 +11,10 @@
* - utility_tx
*/
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_utility_texture)
#include "eevee_shadow_lib.glsl"
#ifdef EEVEE_UTILITY_TX

View File

@@ -7,6 +7,10 @@
* processing.
*/
#include "infos/eevee_subsurface_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_subsurface_setup)
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"
#include "gpu_shader_math_vector_lib.glsl"

View File

@@ -9,6 +9,11 @@
* into other surface shaders.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_capture)
#include "common_hair_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_gbuffer_lib.glsl"

View File

@@ -9,6 +9,14 @@
* Some render-pass are written during this pass.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_node_tree)
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_deferred)
FRAGMENT_SHADER_CREATE_INFO(eevee_render_pass_out)
FRAGMENT_SHADER_CREATE_INFO(eevee_cryptomatte_out)
#include "common_hair_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_ambient_occlusion_lib.glsl"

View File

@@ -6,6 +6,12 @@
* Depth shader that can stochastically discard transparent pixel.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_clip_plane)
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_depth)
#include "common_hair_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_nodetree_lib.glsl"

View File

@@ -8,6 +8,11 @@
* This is used by alpha blended materials and materials using Shader to RGB nodes.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_forward)
#include "common_hair_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_ambient_occlusion_lib.glsl"

View File

@@ -9,6 +9,14 @@
* Some render-pass are written during this pass.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_node_tree)
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_deferred_hybrid)
FRAGMENT_SHADER_CREATE_INFO(eevee_render_pass_out)
FRAGMENT_SHADER_CREATE_INFO(eevee_cryptomatte_out)
#include "common_hair_lib.glsl"
#include "draw_view_lib.glsl"
#include "eevee_ambient_occlusion_lib.glsl"

View File

@@ -4,6 +4,10 @@
#pragma once
#include "infos/eevee_material_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_geom_mesh)
#include "draw_model_lib.glsl"
#include "eevee_nodetree_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -30,6 +30,11 @@
*
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_occupancy)
#include "eevee_nodetree_lib.glsl"
#include "eevee_occupancy_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -11,6 +11,15 @@
* the destination texel.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_shadow_atomic)
#ifdef GLSL_CPP_STUBS
# define MAT_SHADOW
#endif
#include "draw_view_lib.glsl"
#include "eevee_nodetree_lib.glsl"
#include "eevee_sampling_lib.glsl"

View File

@@ -7,10 +7,19 @@
/* Store volumetric properties into the froxel textures. */
#include "infos/eevee_material_info.hh"
#ifdef GLSL_CPP_STUBS
# define MAT_VOLUME
#endif
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_mesh)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_volume)
#include "eevee_volume_lib.glsl"
/* Needed includes for shader nodes. */
#include "eevee_attributes_lib.glsl"
#include "eevee_attributes_volume_lib.glsl"
#include "eevee_nodetree_lib.glsl"
#include "eevee_occupancy_lib.glsl"
#include "eevee_sampling_lib.glsl"
@@ -45,10 +54,10 @@ VolumeProperties eval_froxel(ivec3 froxel, float jitter)
vec3 uvw = (vec3(froxel) + vec3(0.5, 0.5, 0.5 - jitter)) * uniform_buf.volumes.inv_tex_size;
vec3 vP = volume_jitter_to_view(uvw);
vec3 wP = point_view_to_world(vP);
vec3 wP = drw_point_view_to_world(vP);
#if !defined(MAT_GEOM_CURVES) && !defined(MAT_GEOM_POINT_CLOUD)
# ifdef GRID_ATTRIBUTES
g_lP = point_world_to_object(wP);
g_lP = drw_point_world_to_object(wP);
# else
g_wP = wP;
# endif

View File

@@ -8,8 +8,13 @@
* Outputs shading parameter per pixel using a set of randomized BSDFs.
*/
#include "infos/eevee_material_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_geom_world)
FRAGMENT_SHADER_CREATE_INFO(eevee_surf_world)
#include "draw_view_lib.glsl"
#include "eevee_attributes_lib.glsl"
#include "eevee_attributes_world_lib.glsl"
#include "eevee_colorspace_lib.glsl"
#include "eevee_lightprobe_sphere_lib.glsl"
#include "eevee_lightprobe_volume_eval_lib.glsl"

View File

@@ -10,6 +10,10 @@
* Dispatch 1 thread per surfel.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_surfel_cluster_build)
#include "eevee_surfel_list_lib.glsl"
void main()

View File

@@ -6,6 +6,14 @@
* Apply lights contribution to scene surfel representation.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
#ifdef GLSL_CPP_STUBS
# define LIGHT_ITER_FORCE_NO_CULLING
#endif
COMPUTE_SHADER_CREATE_INFO(eevee_surfel_light)
#include "eevee_light_eval_lib.glsl"
#ifndef LIGHT_ITER_FORCE_NO_CULLING

View File

@@ -13,6 +13,10 @@
* Dispatch 1 thread per surfel.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_surfel_list_build)
#include "eevee_surfel_list_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"

View File

@@ -12,6 +12,10 @@
* Dispatched as 1 thread per list.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_surfel_list_sort)
#include "gpu_shader_utildefines_lib.glsl"
/**

View File

@@ -11,6 +11,10 @@
* Dispatched as 1 thread per surfel.
*/
#include "infos/eevee_lightprobe_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_surfel_ray)
#include "draw_view_lib.glsl"
#include "eevee_lightprobe_sphere_lib.glsl"
#include "gpu_shader_math_base_lib.glsl"

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
struct ThicknessIsect {
/* Normal at the intersection point on the sphere. */
vec3 hit_N;

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
/* From the paper "Hashed Alpha Testing" by Chris Wyman and Morgan McGuire. */
float transparency_hash(vec2 a)
{

View File

@@ -4,6 +4,10 @@
#pragma once
#include "infos/eevee_velocity_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_velocity_camera)
#include "draw_view_lib.glsl"
#include "eevee_camera_lib.glsl"
#include "gpu_shader_math_matrix_lib.glsl"

View File

@@ -2,6 +2,10 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#include "infos/eevee_velocity_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_vertex_copy)
#include "gpu_shader_math_base_lib.glsl"
void main()

View File

@@ -8,6 +8,10 @@
/* Step 3 : Integrate for each froxel the final amount of light
* scattered back to the viewer and the amount of transmittance. */
#include "infos/eevee_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_volume_integration)
#include "draw_view_lib.glsl"
#include "eevee_volume_lib.glsl"

View File

@@ -4,6 +4,10 @@
#pragma once
#include "infos/eevee_common_info.hh"
SHADER_LIBRARY_CREATE_INFO(eevee_global_ubo)
/**
* The resources expected to be defined are:
* - uniform_buf.volumes

View File

@@ -7,6 +7,10 @@
/* Step 4 : Apply final integration on top of the scene color. */
#include "infos/eevee_volume_info.hh"
FRAGMENT_SHADER_CREATE_INFO(eevee_volume_resolve)
#include "eevee_volume_lib.glsl"
void main()

View File

@@ -8,6 +8,10 @@
/* Step 2 : Evaluate all light scattering for each froxels.
* Also do the temporal reprojection to fight aliasing artifacts. */
#include "infos/eevee_volume_info.hh"
COMPUTE_SHADER_CREATE_INFO(eevee_volume_scatter)
#include "gpu_shader_math_vector_lib.glsl"
/* Included here to avoid requiring lightprobe resources for all volume lib users. */

View File

@@ -2,6 +2,16 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# define HORIZON_OCCLUSION
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"

View File

@@ -0,0 +1,157 @@
/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_shader_shared.hh"
# define EEVEE_SAMPLING_DATA
# define EEVEE_UTILITY_TX
# define MAT_CLIP_PLANE
# define PLANAR_PROBES
# define MAT_RENDER_PASS_SUPPORT
/* Stub for C++ compilation. */
struct NodeTree {
float crypto_hash;
float _pad0;
float _pad1;
float _pad2;
};
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
/* -------------------------------------------------------------------- */
/** \name Common
* \{ */
/* Stub for C++ compilation. */
/* TODO(fclem): Use it for actual interface. */
GPU_SHADER_CREATE_INFO(eevee_node_tree)
UNIFORM_BUF(0 /*GPU_NODE_TREE_UBO_SLOT*/, NodeTree, node_tree)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_shared)
TYPEDEF_SOURCE("eevee_defines.hh")
TYPEDEF_SOURCE("eevee_shader_shared.hh")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_global_ubo)
UNIFORM_BUF(UNIFORM_BUF_SLOT, UniformData, uniform_buf)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_hiz_data)
SAMPLER(HIZ_TEX_SLOT, FLOAT_2D, hiz_tx)
ADDITIONAL_INFO(eevee_global_ubo)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_sampling_data)
DEFINE("EEVEE_SAMPLING_DATA")
ADDITIONAL_INFO(eevee_shared)
STORAGE_BUF(SAMPLING_BUF_SLOT, READ, SamplingData, sampling_buf)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_utility_texture)
DEFINE("EEVEE_UTILITY_TX")
SAMPLER(RBUFS_UTILITY_TEX_SLOT, FLOAT_2D_ARRAY, utility_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_NAMED_INTERFACE_INFO(eevee_clip_plane_iface, clip_interp)
SMOOTH(FLOAT, clip_distance)
GPU_SHADER_NAMED_INTERFACE_END(clip_interp)
GPU_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_OUT(eevee_clip_plane_iface)
UNIFORM_BUF(CLIP_PLANE_BUF, ClipPlaneData, clip_plane)
DEFINE("MAT_CLIP_PLANE")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_data)
DEFINE("SPHERE_PROBE")
UNIFORM_BUF(SPHERE_PROBE_BUF_SLOT, SphereProbeData, lightprobe_sphere_buf[SPHERE_PROBE_MAX])
SAMPLER(SPHERE_PROBE_TEX_SLOT, FLOAT_2D_ARRAY, lightprobe_spheres_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_volume_probe_data)
UNIFORM_BUF(IRRADIANCE_GRID_BUF_SLOT, VolumeProbeData, grids_infos_buf[IRRADIANCE_GRID_MAX])
/* NOTE: Use uint instead of IrradianceBrickPacked because Metal needs to know the exact type.
*/
STORAGE_BUF(IRRADIANCE_BRICK_BUF_SLOT, READ, uint, bricks_infos_buf[])
SAMPLER(VOLUME_PROBE_TEX_SLOT, FLOAT_3D, irradiance_atlas_tx)
DEFINE("IRRADIANCE_GRID_SAMPLING")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_lightprobe_planar_data)
DEFINE("SPHERE_PROBE")
UNIFORM_BUF(PLANAR_PROBE_BUF_SLOT, PlanarProbeData, probe_planar_buf[PLANAR_PROBE_MAX])
SAMPLER(PLANAR_PROBE_RADIANCE_TEX_SLOT, FLOAT_2D_ARRAY, planar_radiance_tx)
SAMPLER(PLANAR_PROBE_DEPTH_TEX_SLOT, DEPTH_2D_ARRAY, planar_depth_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_lightprobe_data)
ADDITIONAL_INFO(eevee_lightprobe_sphere_data)
ADDITIONAL_INFO(eevee_volume_probe_data)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_light_data)
STORAGE_BUF(LIGHT_CULL_BUF_SLOT, READ, LightCullingData, light_cull_buf)
STORAGE_BUF(LIGHT_BUF_SLOT, READ, LightData, light_buf[])
STORAGE_BUF(LIGHT_ZBIN_BUF_SLOT, READ, uint, light_zbin_buf[])
STORAGE_BUF(LIGHT_TILE_BUF_SLOT, READ, uint, light_tile_buf[])
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_shadow_data)
/* SHADOW_READ_ATOMIC macro indicating shadow functions should use `usampler2DArrayAtomic` as
* the atlas type. */
DEFINE("SHADOW_READ_ATOMIC")
BUILTINS(BuiltinBits::TEXTURE_ATOMIC)
SAMPLER(SHADOW_ATLAS_TEX_SLOT, UINT_2D_ARRAY_ATOMIC, shadow_atlas_tx)
SAMPLER(SHADOW_TILEMAPS_TEX_SLOT, UINT_2D, shadow_tilemaps_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_shadow_data_non_atomic)
SAMPLER(SHADOW_ATLAS_TEX_SLOT, UINT_2D_ARRAY, shadow_atlas_tx)
SAMPLER(SHADOW_TILEMAPS_TEX_SLOT, UINT_2D, shadow_tilemaps_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_surfel_common)
STORAGE_BUF(SURFEL_BUF_SLOT, READ_WRITE, Surfel, surfel_buf[])
STORAGE_BUF(CAPTURE_BUF_SLOT, READ, CaptureInfoData, capture_info_buf)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_volume_properties_data)
ADDITIONAL_INFO(eevee_global_ubo)
IMAGE(VOLUME_PROP_SCATTERING_IMG_SLOT, GPU_R11F_G11F_B10F, READ, FLOAT_3D, in_scattering_img)
IMAGE(VOLUME_PROP_EXTINCTION_IMG_SLOT, GPU_R11F_G11F_B10F, READ, FLOAT_3D, in_extinction_img)
IMAGE(VOLUME_PROP_EMISSION_IMG_SLOT, GPU_R11F_G11F_B10F, READ, FLOAT_3D, in_emission_img)
IMAGE(VOLUME_PROP_PHASE_IMG_SLOT, GPU_R16F, READ, FLOAT_3D, in_phase_img)
IMAGE(VOLUME_PROP_PHASE_WEIGHT_IMG_SLOT, GPU_R16F, READ, FLOAT_3D, in_phase_weight_img)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_gbuffer_data)
DEFINE("GBUFFER_LOAD")
SAMPLER(12, UINT_2D, gbuf_header_tx)
SAMPLER(13, FLOAT_2D_ARRAY, gbuf_closure_tx)
SAMPLER(14, FLOAT_2D_ARRAY, gbuf_normal_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_render_pass_out)
DEFINE("MAT_RENDER_PASS_SUPPORT")
ADDITIONAL_INFO(eevee_global_ubo)
IMAGE_FREQ(RBUFS_COLOR_SLOT, GPU_RGBA16F, WRITE, FLOAT_2D_ARRAY, rp_color_img, PASS)
IMAGE_FREQ(RBUFS_VALUE_SLOT, GPU_R16F, WRITE, FLOAT_2D_ARRAY, rp_value_img, PASS)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_cryptomatte_out)
STORAGE_BUF(CRYPTOMATTE_BUF_SLOT, READ, vec2, cryptomatte_object_buf[])
IMAGE_FREQ(RBUFS_CRYPTOMATTE_SLOT, GPU_RGBA32F, WRITE, FLOAT_2D, rp_cryptomatte_img, PASS)
GPU_SHADER_CREATE_END()
/** \} */

View File

@@ -2,6 +2,15 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_fullscreen_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
@@ -37,13 +46,6 @@ GPU_SHADER_CREATE_END()
/** \} */
GPU_SHADER_CREATE_INFO(eevee_gbuffer_data)
DEFINE("GBUFFER_LOAD")
SAMPLER(12, UINT_2D, gbuf_header_tx)
SAMPLER(13, FLOAT_2D_ARRAY, gbuf_closure_tx)
SAMPLER(14, FLOAT_2D_ARRAY, gbuf_normal_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_deferred_tile_classify)
FRAGMENT_SOURCE("eevee_deferred_tile_classify_frag.glsl")
ADDITIONAL_INFO(eevee_shared)

View File

@@ -2,9 +2,29 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "BLI_utildefines_variadic.h"
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_shader_shared.hh"
# include "eevee_velocity_info.hh"
# define DOF_BOKEH_TEXTURE true
# define DILATE_MODE_MIN_MAX true
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(eevee_depth_of_field_tiles_common)
IMAGE(0, GPU_R11F_G11F_B10F, READ, FLOAT_2D, in_tiles_fg_img)
IMAGE(1, GPU_R11F_G11F_B10F, READ, FLOAT_2D, in_tiles_bg_img)
GPU_SHADER_CREATE_END()
/* -------------------------------------------------------------------- */
/** \name Setup
* \{ */
@@ -127,11 +147,6 @@ DEFINE_VALUE("DILATE_MODE_MIN_MAX", "true")
ADDITIONAL_INFO(eevee_depth_of_field_tiles_dilate)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_depth_of_field_tiles_common)
IMAGE(0, GPU_R11F_G11F_B10F, READ, FLOAT_2D, in_tiles_fg_img)
IMAGE(1, GPU_R11F_G11F_B10F, READ, FLOAT_2D, in_tiles_bg_img)
GPU_SHADER_CREATE_END()
/** \} */
/* -------------------------------------------------------------------- */

View File

@@ -2,6 +2,17 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_fullscreen_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_shader_shared.hh"
# include "eevee_velocity_info.hh"
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"

View File

@@ -2,14 +2,18 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_fullscreen_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(eevee_hiz_data)
SAMPLER(HIZ_TEX_SLOT, FLOAT_2D, hiz_tx)
ADDITIONAL_INFO(eevee_global_ubo)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_hiz_update_base)
LOCAL_GROUP_SIZE(FILM_GROUP_SIZE, FILM_GROUP_SIZE)
STORAGE_BUF(0, READ_WRITE, uint, finished_tile_counter)

View File

@@ -2,22 +2,22 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_fullscreen_info.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_shader_shared.hh"
# define SPHERE_PROBE
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
/* -------------------------------------------------------------------- */
/** \name Shared
* \{ */
GPU_SHADER_CREATE_INFO(eevee_light_data)
STORAGE_BUF(LIGHT_CULL_BUF_SLOT, READ, LightCullingData, light_cull_buf)
STORAGE_BUF(LIGHT_BUF_SLOT, READ, LightData, light_buf[])
STORAGE_BUF(LIGHT_ZBIN_BUF_SLOT, READ, uint, light_zbin_buf[])
STORAGE_BUF(LIGHT_TILE_BUF_SLOT, READ, uint, light_tile_buf[])
GPU_SHADER_CREATE_END()
/** \} */
/* -------------------------------------------------------------------- */
/** \name Culling
* \{ */

View File

@@ -2,19 +2,22 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_lightprobe_volume_info.hh"
# include "eevee_shader_shared.hh"
# define SPHERE_PROBE
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
/* -------------------------------------------------------------------- */
/** \name Shared
* \{ */
GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_data)
DEFINE("SPHERE_PROBE")
UNIFORM_BUF(SPHERE_PROBE_BUF_SLOT, SphereProbeData, lightprobe_sphere_buf[SPHERE_PROBE_MAX])
SAMPLER(SPHERE_PROBE_TEX_SLOT, FLOAT_2D_ARRAY, lightprobe_spheres_tx)
GPU_SHADER_CREATE_END()
/* Sample cubemap and remap into an octahedral texture. */
GPU_SHADER_CREATE_INFO(eevee_lightprobe_sphere_remap)
LOCAL_GROUP_SIZE(SPHERE_PROBE_REMAP_GROUP_SIZE, SPHERE_PROBE_REMAP_GROUP_SIZE)

View File

@@ -2,6 +2,18 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_shader_shared.hh"
# define SPHERE_PROBE
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
@@ -76,11 +88,6 @@ GPU_SHADER_CREATE_END()
/** \name Baking
* \{ */
GPU_SHADER_CREATE_INFO(eevee_surfel_common)
STORAGE_BUF(SURFEL_BUF_SLOT, READ_WRITE, Surfel, surfel_buf[])
STORAGE_BUF(CAPTURE_BUF_SLOT, READ, CaptureInfoData, capture_info_buf)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_surfel_light)
DEFINE("LIGHT_ITER_FORCE_NO_CULLING")
DEFINE_VALUE("LIGHT_CLOSURE_EVAL_COUNT", "1")
@@ -242,25 +249,4 @@ COMPUTE_SOURCE("eevee_lightprobe_volume_load_comp.glsl")
DO_STATIC_COMPILATION()
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_volume_probe_data)
UNIFORM_BUF(IRRADIANCE_GRID_BUF_SLOT, VolumeProbeData, grids_infos_buf[IRRADIANCE_GRID_MAX])
/* NOTE: Use uint instead of IrradianceBrickPacked because Metal needs to know the exact type.
*/
STORAGE_BUF(IRRADIANCE_BRICK_BUF_SLOT, READ, uint, bricks_infos_buf[])
SAMPLER(VOLUME_PROBE_TEX_SLOT, FLOAT_3D, irradiance_atlas_tx)
DEFINE("IRRADIANCE_GRID_SAMPLING")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_lightprobe_data)
ADDITIONAL_INFO(eevee_lightprobe_sphere_data)
ADDITIONAL_INFO(eevee_volume_probe_data)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_lightprobe_planar_data)
DEFINE("SPHERE_PROBE")
UNIFORM_BUF(PLANAR_PROBE_BUF_SLOT, PlanarProbeData, probe_planar_buf[PLANAR_PROBE_MAX])
SAMPLER(PLANAR_PROBE_RADIANCE_TEX_SLOT, FLOAT_2D_ARRAY, planar_radiance_tx)
SAMPLER(PLANAR_PROBE_DEPTH_TEX_SLOT, DEPTH_2D_ARRAY, planar_depth_tx)
GPU_SHADER_CREATE_END()
/** \} */

View File

@@ -2,6 +2,15 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_view_info.hh"
# define SPHERE_PROBE
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"

View File

@@ -2,7 +2,15 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "eevee_common_info.hh"
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
GPU_SHADER_CREATE_INFO(eevee_lut)
LOCAL_GROUP_SIZE(LUT_WORKGROUP_SIZE, LUT_WORKGROUP_SIZE, 1)

View File

@@ -2,46 +2,34 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "BLI_utildefines_variadic.h"
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_shader_shared.hh"
# include "eevee_common_info.hh"
# include "eevee_volume_info.hh"
# define HAIR_SHADER
# define DRW_HAIR_INFO
# define POINTCLOUD_SHADER
# define DRW_POINTCLOUD_INFO
# define SHADOW_UPDATE_ATOMIC_RASTER
# define MAT_TRANSPARENT
# define thickness_mode 1.0
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"
/* -------------------------------------------------------------------- */
/** \name Common
* \{ */
/* TODO(@fclem): This is a bit out of place at the moment. */
GPU_SHADER_CREATE_INFO(eevee_shared)
TYPEDEF_SOURCE("eevee_defines.hh")
TYPEDEF_SOURCE("eevee_shader_shared.hh")
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_global_ubo)
UNIFORM_BUF(UNIFORM_BUF_SLOT, UniformData, uniform_buf)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_sampling_data)
DEFINE("EEVEE_SAMPLING_DATA")
ADDITIONAL_INFO(eevee_shared)
STORAGE_BUF(SAMPLING_BUF_SLOT, READ, SamplingData, sampling_buf)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_utility_texture)
DEFINE("EEVEE_UTILITY_TX")
SAMPLER(RBUFS_UTILITY_TEX_SLOT, FLOAT_2D_ARRAY, utility_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_NAMED_INTERFACE_INFO(eevee_clip_plane_iface, clip_interp)
SMOOTH(FLOAT, clip_distance)
GPU_SHADER_NAMED_INTERFACE_END(clip_interp)
GPU_SHADER_CREATE_INFO(eevee_clip_plane)
VERTEX_OUT(eevee_clip_plane_iface)
UNIFORM_BUF(CLIP_PLANE_BUF, ClipPlaneData, clip_plane)
DEFINE("MAT_CLIP_PLANE")
GPU_SHADER_CREATE_END()
/** \} */
/* -------------------------------------------------------------------- */
/** \name Surface Mesh Type
* \{ */
@@ -164,18 +152,6 @@ GPU_SHADER_CREATE_END()
#define image_array_out(slot, qualifier, format, name) \
image(slot, format, qualifier, ImageType::FLOAT_2D_ARRAY, name, Frequency::PASS)
GPU_SHADER_CREATE_INFO(eevee_render_pass_out)
DEFINE("MAT_RENDER_PASS_SUPPORT")
ADDITIONAL_INFO(eevee_global_ubo)
IMAGE_FREQ(RBUFS_COLOR_SLOT, GPU_RGBA16F, WRITE, FLOAT_2D_ARRAY, rp_color_img, PASS)
IMAGE_FREQ(RBUFS_VALUE_SLOT, GPU_R16F, WRITE, FLOAT_2D_ARRAY, rp_value_img, PASS)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_cryptomatte_out)
STORAGE_BUF(CRYPTOMATTE_BUF_SLOT, READ, vec2, cryptomatte_object_buf[])
IMAGE_FREQ(RBUFS_CRYPTOMATTE_SLOT, GPU_RGBA32F, WRITE, FLOAT_2D, rp_cryptomatte_img, PASS)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_surf_deferred_base)
DEFINE("MAT_DEFERRED")
DEFINE("GBUFFER_WRITE")

View File

@@ -2,6 +2,15 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_velocity_info.hh"
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"

View File

@@ -2,6 +2,19 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_fullscreen_info.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_shader_shared.hh"
# define SPHERE_PROBE
#endif
#include "draw_defines.hh"
#include "eevee_defines.hh"
@@ -307,26 +320,6 @@ GPU_SHADER_CREATE_END()
/** \} */
/* -------------------------------------------------------------------- */
/** \name Shadow resources
* \{ */
GPU_SHADER_CREATE_INFO(eevee_shadow_data)
/* SHADOW_READ_ATOMIC macro indicating shadow functions should use `usampler2DArrayAtomic` as
* the atlas type. */
DEFINE("SHADOW_READ_ATOMIC")
BUILTINS(BuiltinBits::TEXTURE_ATOMIC)
SAMPLER(SHADOW_ATLAS_TEX_SLOT, UINT_2D_ARRAY_ATOMIC, shadow_atlas_tx)
SAMPLER(SHADOW_TILEMAPS_TEX_SLOT, UINT_2D, shadow_tilemaps_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_shadow_data_non_atomic)
SAMPLER(SHADOW_ATLAS_TEX_SLOT, UINT_2D_ARRAY, shadow_atlas_tx)
SAMPLER(SHADOW_TILEMAPS_TEX_SLOT, UINT_2D, shadow_tilemaps_tx)
GPU_SHADER_CREATE_END()
/** \} */
/* -------------------------------------------------------------------- */
/** \name Debug
* \{ */

View File

@@ -2,6 +2,13 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "eevee_common_info.hh"
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"

View File

@@ -2,6 +2,17 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_shader_shared.hh"
# define SPHERE_PROBE
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"

View File

@@ -2,6 +2,17 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_shader_shared.hh"
# define VELOCITY_CAMERA
#endif
#include "eevee_defines.hh"
#include "gpu_shader_create_info.hh"

View File

@@ -2,6 +2,19 @@
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#ifdef GPU_SHADER
# pragma once
# include "gpu_glsl_cpp_stubs.hh"
# include "draw_fullscreen_info.hh"
# include "draw_object_infos_info.hh"
# include "draw_view_info.hh"
# include "eevee_common_info.hh"
# include "eevee_shader_shared.hh"
# define SPHERE_PROBE
#endif
#include "gpu_shader_create_info.hh"
#pragma once
@@ -15,15 +28,6 @@ SAMPLER(VOLUME_SCATTERING_TEX_SLOT, FLOAT_3D, volume_scattering_tx)
SAMPLER(VOLUME_TRANSMITTANCE_TEX_SLOT, FLOAT_3D, volume_transmittance_tx)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_volume_properties_data)
ADDITIONAL_INFO(eevee_global_ubo)
IMAGE(VOLUME_PROP_SCATTERING_IMG_SLOT, GPU_R11F_G11F_B10F, READ, FLOAT_3D, in_scattering_img)
IMAGE(VOLUME_PROP_EXTINCTION_IMG_SLOT, GPU_R11F_G11F_B10F, READ, FLOAT_3D, in_extinction_img)
IMAGE(VOLUME_PROP_EMISSION_IMG_SLOT, GPU_R11F_G11F_B10F, READ, FLOAT_3D, in_emission_img)
IMAGE(VOLUME_PROP_PHASE_IMG_SLOT, GPU_R16F, READ, FLOAT_3D, in_phase_img)
IMAGE(VOLUME_PROP_PHASE_WEIGHT_IMG_SLOT, GPU_R16F, READ, FLOAT_3D, in_phase_weight_img)
GPU_SHADER_CREATE_END()
GPU_SHADER_CREATE_INFO(eevee_volume_scatter)
LOCAL_GROUP_SIZE(VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE)
ADDITIONAL_INFO(eevee_shared)

View File

@@ -9,6 +9,8 @@
* Results are meant to be conservative.
*/
#include "draw_view_info.hh"
#include "common_shape_lib.glsl"
#include "draw_math_geom_lib.glsl"
#include "gpu_shader_utildefines_lib.glsl"
@@ -133,6 +135,7 @@ IsectFrustum isect_frustum_setup(Frustum shape)
* \{ */
#ifdef DRW_VIEW_CULLING_INFO
SHADER_LIBRARY_CREATE_INFO(draw_view_culling)
bool intersect_view(Pyramid pyramid)
{

View File

@@ -122,6 +122,7 @@
/* EEVEE engine. */
#include "eevee_ambient_occlusion_info.hh"
#include "eevee_common_info.hh"
#include "eevee_deferred_info.hh"
#include "eevee_depth_of_field_info.hh"
#include "eevee_film_info.hh"

View File

@@ -457,8 +457,8 @@ template<int C, int R> struct MatOp {
MatT operator*(MatT) const RET;
friend ColT operator*(RowT, MatT) RET;
friend RowT operator*(MatT, ColT) RET;
friend RowT operator*(ColT, MatT) RET;
friend ColT operator*(MatT, RowT) RET;
};
template<int R> struct MatBase<2, R> : MatOp<2, R> {

View File

@@ -4,6 +4,8 @@
#pragma once
#include "gpu_glsl_cpp_stubs.hh"
vec3 calc_barycentric_distances(vec3 pos0, vec3 pos1, vec3 pos2)
{
vec3 edge21 = pos2 - pos1;