Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee_next/eevee_shader_shared.hh
| Show First 20 Lines • Show All 719 Lines • ▼ Show 20 Lines | |||||
| #define UTIL_BLUE_NOISE_LAYER 0 | #define UTIL_BLUE_NOISE_LAYER 0 | ||||
| #define UTIL_LTC_MAT_LAYER 1 | #define UTIL_LTC_MAT_LAYER 1 | ||||
| #define UTIL_LTC_MAG_LAYER 2 | #define UTIL_LTC_MAG_LAYER 2 | ||||
| #define UTIL_BSDF_LAYER 2 | #define UTIL_BSDF_LAYER 2 | ||||
| #define UTIL_BTDF_LAYER 3 | #define UTIL_BTDF_LAYER 3 | ||||
| #define UTIL_DISK_INTEGRAL_LAYER 3 | #define UTIL_DISK_INTEGRAL_LAYER 3 | ||||
| #define UTIL_DISK_INTEGRAL_COMP 2 | #define UTIL_DISK_INTEGRAL_COMP 2 | ||||
| #ifndef __cplusplus | /* __cplusplus is true when compiling with MSL, so include if inside a shader. */ | ||||
| #if !defined(__cplusplus) || defined(GPU_SHADER) | |||||
| /* Fetch texel. Wrapping if above range. */ | /* Fetch texel. Wrapping if above range. */ | ||||
| float4 utility_tx_fetch(sampler2DArray util_tx, float2 texel, float layer) | float4 utility_tx_fetch(sampler2DArray util_tx, float2 texel, float layer) | ||||
| { | { | ||||
| return texelFetch(util_tx, int3(int2(texel) % UTIL_TEX_SIZE, layer), 0); | return texelFetch(util_tx, int3(int2(texel) % UTIL_TEX_SIZE, layer), 0); | ||||
| } | } | ||||
| /* Sample at uv position. Filtered & Wrapping enabled. */ | /* Sample at uv position. Filtered & Wrapping enabled. */ | ||||
| float4 utility_tx_sample(sampler2DArray util_tx, float2 uv, float layer) | float4 utility_tx_sample(sampler2DArray util_tx, float2 uv, float layer) | ||||
| { | { | ||||
| return textureLod(util_tx, float3(uv, layer), 0.0); | return textureLod(util_tx, float3(uv, layer), 0.0); | ||||
| } | } | ||||
| #endif | #endif | ||||
| /** \} */ | /** \} */ | ||||
| #ifdef __cplusplus | /* __cplusplus is true when compiling with MSL, so ensure we are not inside a shader. */ | ||||
| #if defined(__cplusplus) && !defined(GPU_SHADER) | |||||
| using AOVsInfoDataBuf = draw::StorageBuffer<AOVsInfoData>; | using AOVsInfoDataBuf = draw::StorageBuffer<AOVsInfoData>; | ||||
| using CameraDataBuf = draw::UniformBuffer<CameraData>; | using CameraDataBuf = draw::UniformBuffer<CameraData>; | ||||
| using DepthOfFieldDataBuf = draw::UniformBuffer<DepthOfFieldData>; | using DepthOfFieldDataBuf = draw::UniformBuffer<DepthOfFieldData>; | ||||
| using DepthOfFieldScatterListBuf = draw::StorageArrayBuffer<ScatterRect, 16, true>; | using DepthOfFieldScatterListBuf = draw::StorageArrayBuffer<ScatterRect, 16, true>; | ||||
| using DrawIndirectBuf = draw::StorageBuffer<DrawCommand, true>; | using DrawIndirectBuf = draw::StorageBuffer<DrawCommand, true>; | ||||
| using FilmDataBuf = draw::UniformBuffer<FilmData>; | using FilmDataBuf = draw::UniformBuffer<FilmData>; | ||||
| using HiZDataBuf = draw::UniformBuffer<HiZData>; | using HiZDataBuf = draw::UniformBuffer<HiZData>; | ||||
| Show All 16 Lines | |||||