34 if (clip_planes > 0) {
41 texture_subpass_map_.clear();
48 passes_[geom][shader] =
nullptr;
57 PassMain::Sub *&sub_pass = passes_[int(geometry_type)][int(shader_type)];
59 std::string &pass_name = pass_names[int(geometry_type)][int(shader_type)];
60 if (pass_name.empty()) {
61 pass_name = std::string(
get_name(geometry_type)) + std::string(
get_name(shader_type));
63 sub_pass = &
sub(pass_name.c_str());
65 ShaderCache::get().prepass_get(geometry_type, pipeline_, lighting_, shader_type, clip_));
80 if (
texture->gpu.tile_mapping) {
93 sub_pass->
push_constant(
"image_transparency_cutoff", alpha_cutoff);
97 return *texture_subpass_map_.lookup_or_add_cb(
98 {*
texture->gpu.texture,
texture->sampler_state, geometry_type}, add_cb);
155 gpu::TextureFormat::SFLOAT_16_16_16_16,
158 gpu::TextureFormat::SFLOAT_16_16,
170 object_id_attachment);
184 object_id_attachment);
211 if (!shadow_pass || !shadow_pass->
is_debug()) {
269 gpu::TextureFormat::SFLOAT_16_16_16_16,
272 gpu::TextureFormat::SFLOAT_16,
354 object_id_attachment);
367 object_id_attachment);
#define GPU_ATTACHMENT_TEXTURE(_texture)
void GPU_framebuffer_clear_stencil(blender::gpu::FrameBuffer *fb, uint clear_stencil)
#define GPU_ATTACHMENT_NONE
void GPU_texture_copy(blender::gpu::Texture *dst, blender::gpu::Texture *src)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_TEXTURE_USAGE_FORMAT_VIEW
void submit(PassSimple &pass, View &view)
void bind_texture(const char *name, gpu::Texture *texture, GPUSamplerState state=sampler_auto)
PassBase< DrawCommandBufType > & sub(const char *name)
void state_set(DRWState state, int clip_plane_count=0)
void bind_ubo(const char *name, gpu::UniformBuf *buffer)
void push_constant(const char *name, const float &data)
void bind_ssbo(const char *name, gpu::StorageBuf *buffer)
detail::PassBase< command::DrawMultiBuf > Sub
void setup_resolve_pass(PassSimple &pass, SceneResources &resources)
MeshPass(const char *name)
void init_pass(SceneResources &resources, DRWState state, int clip_planes)
void init_subpasses(ePipelineType pipeline, eLightingType lighting, bool clip)
void sync(const SceneState &scene_state, SceneResources &resources)
MeshPass gbuffer_in_front_ps_
TextureFromPool gbuffer_material_tx
gpu::Texture * deferred_ps_stencil_tx
Texture shadow_depth_stencil_tx
Framebuffer gbuffer_in_front_fb
TextureFromPool gbuffer_normal_tx
void draw(Manager &manager, View &view, SceneResources &resources, int2 resolution, class ShadowPass *shadow_pass)
static ShaderCache & get()
void draw(Manager &manager, View &view, SceneResources &resources, gpu::Texture &depth_stencil_tx, bool force_fail_method)
void draw(Manager &manager, View &view, SceneResources &resources)
void sync(const SceneState &scene_state, SceneResources &resources)
TextureFromPool accumulation_tx
MeshPass accumulation_in_front_ps_
void sync(const SceneState &scene_state, SceneResources &resources)
void draw(Manager &manager, View &view, SceneResources &resources, int2 resolution)
MeshPass accumulation_ps_
Framebuffer transparent_fb
TextureFromPool reveal_tx
#define DRW_CLIPPING_UBO_SLOT
@ DRW_STATE_STENCIL_EQUAL
@ DRW_STATE_STENCIL_ALWAYS
@ DRW_STATE_DEPTH_LESS_EQUAL
@ DRW_STATE_STENCIL_NEQUAL
@ DRW_STATE_WRITE_STENCIL
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
detail::Pass< command::DrawMultiBuf > PassMain
static constexpr int geometry_type_len
static constexpr int shader_type_len
static const char * get_name(eGeometryType type)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
UniformBuffer< WorldData > world_buf
StorageVectorBuffer< Material > material_buf
TextureRef depth_in_front_tx
Texture dummy_tile_array_tx
TextureFromPool object_id_tx
Texture dummy_tile_data_tx
UniformArrayBuffer< float4, 6 > clip_planes_buf
eLightingType lighting_type
Vector< float4 > clip_planes
#define WB_TILE_DATA_SLOT
#define WB_TILE_ARRAY_SLOT