Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_private.h
| Show All 11 Lines | |||||
| #include "BLI_bitmap.h" | #include "BLI_bitmap.h" | ||||
| #include "DNA_lightprobe_types.h" | #include "DNA_lightprobe_types.h" | ||||
| #include "GPU_viewport.h" | #include "GPU_viewport.h" | ||||
| #include "BKE_camera.h" | #include "BKE_camera.h" | ||||
| #include "engine_eevee_shared_defines.h" | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| struct EEVEE_ShadowCasterBuffer; | struct EEVEE_ShadowCasterBuffer; | ||||
| struct GPUFrameBuffer; | struct GPUFrameBuffer; | ||||
| struct Object; | struct Object; | ||||
| struct RenderLayer; | struct RenderLayer; | ||||
| extern struct DrawEngineType draw_engine_eevee_type; | extern struct DrawEngineType draw_engine_eevee_type; | ||||
| /* Minimum UBO is 16384 bytes */ | |||||
| #define MAX_PROBE 128 /* TODO: find size by dividing UBO max size by probe data size. */ | |||||
| #define MAX_GRID 64 /* TODO: find size by dividing UBO max size by grid data size. */ | |||||
| #define MAX_PLANAR 16 /* TODO: find size by dividing UBO max size by grid data size. */ | |||||
| #define MAX_LIGHT 128 /* TODO: find size by dividing UBO max size by light data size. */ | |||||
| #define MAX_CASCADE_NUM 4 | |||||
| #define MAX_SHADOW 128 /* TODO: Make this depends on #GL_MAX_ARRAY_TEXTURE_LAYERS. */ | |||||
| #define MAX_SHADOW_CASCADE 8 | |||||
| #define MAX_SHADOW_CUBE (MAX_SHADOW - MAX_CASCADE_NUM * MAX_SHADOW_CASCADE) | |||||
| #define MAX_BLOOM_STEP 16 | |||||
| #define MAX_AOVS 64 | |||||
| /* Special value chosen to not be altered by depth of field sample count. */ | /* Special value chosen to not be altered by depth of field sample count. */ | ||||
| #define TAA_MAX_SAMPLE 10000926 | #define TAA_MAX_SAMPLE 10000926 | ||||
| // #define DEBUG_SHADOW_DISTRIBUTION | // #define DEBUG_SHADOW_DISTRIBUTION | ||||
| /* Only define one of these. */ | /* Only define one of these. */ | ||||
| // #define IRRADIANCE_SH_L2 | // #define IRRADIANCE_SH_L2 | ||||
| #define IRRADIANCE_HL2 | #define IRRADIANCE_HL2 | ||||
| #if defined(IRRADIANCE_SH_L2) | #if defined(IRRADIANCE_SH_L2) | ||||
| # define SHADER_IRRADIANCE "#define IRRADIANCE_SH_L2\n" | # define SHADER_IRRADIANCE "#define IRRADIANCE_SH_L2\n" | ||||
| #elif defined(IRRADIANCE_HL2) | #elif defined(IRRADIANCE_HL2) | ||||
| # define SHADER_IRRADIANCE "#define IRRADIANCE_HL2\n" | # define SHADER_IRRADIANCE "#define IRRADIANCE_HL2\n" | ||||
| #endif | #endif | ||||
| /* Macro causes over indentation. */ | |||||
| /* clang-format off */ | |||||
| #define SHADER_DEFINES \ | |||||
| "#define EEVEE_ENGINE\n" \ | |||||
| "#define MAX_PROBE " STRINGIFY(MAX_PROBE) "\n" \ | |||||
| "#define MAX_GRID " STRINGIFY(MAX_GRID) "\n" \ | |||||
| "#define MAX_PLANAR " STRINGIFY(MAX_PLANAR) "\n" \ | |||||
| "#define MAX_LIGHT " STRINGIFY(MAX_LIGHT) "\n" \ | |||||
| "#define MAX_SHADOW " STRINGIFY(MAX_SHADOW) "\n" \ | |||||
| "#define MAX_SHADOW_CUBE " STRINGIFY(MAX_SHADOW_CUBE) "\n" \ | |||||
| "#define MAX_SHADOW_CASCADE " STRINGIFY(MAX_SHADOW_CASCADE) "\n" \ | |||||
| "#define MAX_CASCADE_NUM " STRINGIFY(MAX_CASCADE_NUM) "\n" \ | |||||
| SHADER_IRRADIANCE | |||||
| /* clang-format on */ | |||||
| #define EEVEE_PROBE_MAX min_ii(MAX_PROBE, GPU_max_texture_layers() / 6) | #define EEVEE_PROBE_MAX min_ii(MAX_PROBE, GPU_max_texture_layers() / 6) | ||||
| #define EEVEE_VELOCITY_TILE_SIZE 32 | |||||
| #define USE_VOLUME_OPTI (GPU_shader_image_load_store_support()) | #define USE_VOLUME_OPTI (GPU_shader_image_load_store_support()) | ||||
| #define SWAP_DOUBLE_BUFFERS() \ | #define SWAP_DOUBLE_BUFFERS() \ | ||||
| { \ | { \ | ||||
| if (effects->swap_double_buffer) { \ | if (effects->swap_double_buffer) { \ | ||||
| SWAP(struct GPUFrameBuffer *, fbl->main_fb, fbl->double_buffer_fb); \ | SWAP(struct GPUFrameBuffer *, fbl->main_fb, fbl->double_buffer_fb); \ | ||||
| SWAP(struct GPUFrameBuffer *, fbl->main_color_fb, fbl->double_buffer_color_fb); \ | SWAP(struct GPUFrameBuffer *, fbl->main_color_fb, fbl->double_buffer_color_fb); \ | ||||
| SWAP(GPUTexture *, txl->color, txl->color_double_buffer); \ | SWAP(GPUTexture *, txl->color, txl->color_double_buffer); \ | ||||
| ▲ Show 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | |||||
| typedef enum EEVEE_DofGatherPass { | typedef enum EEVEE_DofGatherPass { | ||||
| DOF_GATHER_FOREGROUND = 0, | DOF_GATHER_FOREGROUND = 0, | ||||
| DOF_GATHER_BACKGROUND = 1, | DOF_GATHER_BACKGROUND = 1, | ||||
| DOF_GATHER_HOLEFILL = 2, | DOF_GATHER_HOLEFILL = 2, | ||||
| DOF_GATHER_MAX_PASS, | DOF_GATHER_MAX_PASS, | ||||
| } EEVEE_DofGatherPass; | } EEVEE_DofGatherPass; | ||||
| #define DOF_TILE_DIVISOR 16 | |||||
| #define DOF_BOKEH_LUT_SIZE 32 | |||||
| #define DOF_GATHER_RING_COUNT 5 | |||||
| #define DOF_DILATE_RING_COUNT 3 | |||||
| #define DOF_FAST_GATHER_COC_ERROR 0.05 | |||||
| #define DOF_SHADER_DEFINES \ | |||||
| "#define DOF_TILE_DIVISOR " STRINGIFY(DOF_TILE_DIVISOR) "\n" \ | |||||
| "#define DOF_BOKEH_LUT_SIZE " STRINGIFY(DOF_BOKEH_LUT_SIZE) "\n" \ | |||||
| "#define DOF_GATHER_RING_COUNT " STRINGIFY(DOF_GATHER_RING_COUNT) "\n" \ | |||||
| "#define DOF_DILATE_RING_COUNT " STRINGIFY(DOF_DILATE_RING_COUNT) "\n" \ | |||||
| "#define DOF_FAST_GATHER_COC_ERROR " STRINGIFY(DOF_FAST_GATHER_COC_ERROR) "\n" | |||||
| /* ************ PROBE UBO ************* */ | /* ************ PROBE UBO ************* */ | ||||
| /* They are the same struct as their Cache siblings. | /* They are the same struct as their Cache siblings. | ||||
| * typedef'ing just to keep the naming consistent with | * typedef'ing just to keep the naming consistent with | ||||
| * other eevee types. */ | * other eevee types. */ | ||||
| typedef LightProbeCache EEVEE_LightProbe; | typedef LightProbeCache EEVEE_LightProbe; | ||||
| typedef LightGridCache EEVEE_LightGrid; | typedef LightGridCache EEVEE_LightGrid; | ||||
| ▲ Show 20 Lines • Show All 1,072 Lines • ▼ Show 20 Lines | |||||
| /** | /** | ||||
| * \note Compilation is not deferred. | * \note Compilation is not deferred. | ||||
| */ | */ | ||||
| struct GPUMaterial *EEVEE_material_default_get(struct Scene *scene, Material *ma, int options); | struct GPUMaterial *EEVEE_material_default_get(struct Scene *scene, Material *ma, int options); | ||||
| struct GPUMaterial *EEVEE_material_get( | struct GPUMaterial *EEVEE_material_get( | ||||
| EEVEE_Data *vedata, struct Scene *scene, Material *ma, World *wo, int options); | EEVEE_Data *vedata, struct Scene *scene, Material *ma, World *wo, int options); | ||||
| void EEVEE_shaders_free(void); | void EEVEE_shaders_free(void); | ||||
| void eevee_shader_extra_init(void); | |||||
| void eevee_shader_extra_exit(void); | |||||
| void eevee_shader_material_create_info_amend(GPUMaterial *gpumat, | void eevee_shader_material_create_info_amend(GPUMaterial *gpumat, | ||||
| GPUCodegenOutput *codegen, | GPUCodegenOutput *codegen_, | ||||
| char *frag, | |||||
| char *vert, | char *vert, | ||||
| char *geom, | char *geom, | ||||
| char *frag, | |||||
| const char *vert_info_name, | |||||
| const char *geom_info_name, | |||||
| const char *frag_info_name, | |||||
| char *defines); | char *defines); | ||||
| GPUShader *eevee_shaders_sh_create_helper(const char *name, | GPUShader *eevee_shaders_sh_create_helper(const char *name, | ||||
| const char *vert_name, | const char *vert_name, | ||||
| const char *frag_name, | const char *frag_name, | ||||
| const char *defines, | const char *defines, | ||||
| bool use_layered_rendering); | bool use_layered_rendering); | ||||
| /* eevee_lightprobes.c */ | /* eevee_lightprobes.c */ | ||||
| ▲ Show 20 Lines • Show All 368 Lines • Show Last 20 Lines | |||||