34 if (clip_planes > 0) {
41 texture_subpass_map_.clear();
49 if (pass_names[geom][shader].empty()) {
50 pass_names[geom][shader] = std::string(
get_name(geom_type)) +
55 ShaderCache::get().prepass_get(geom_type, pipeline, lighting, shader_type, clip));
56 passes_[geom][shader] = pass;
66 if (texture && texture->gpu.texture) {
69 sub_pass = &sub_pass->
sub(texture->name);
70 if (texture->gpu.tile_mapping) {
77 sub_pass->
push_constant(
"isImageTile", texture->gpu.tile_mapping !=
nullptr);
78 sub_pass->
push_constant(
"imagePremult", texture->premultiplied);
82 float alpha_cutoff = texture->alpha_cutoff ? 0.1f : -
FLT_MAX;
83 sub_pass->
push_constant(
"imageTransparencyCutoff", alpha_cutoff);
87 return *texture_subpass_map_.lookup_or_add_cb(
88 TextureSubPassKey(texture->gpu.texture, geometry_type), add_cb);
158 object_id_attachment);
172 object_id_attachment);
199 if (!shadow_pass || !shadow_pass->
is_debug()) {
340 object_id_attachment);
353 object_id_attachment);
#define GPU_ATTACHMENT_TEXTURE(_texture)
void GPU_framebuffer_clear_stencil(GPUFrameBuffer *fb, uint clear_stencil)
#define GPU_ATTACHMENT_NONE
void GPU_texture_copy(GPUTexture *dst, GPUTexture *src)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_TEXTURE_USAGE_FORMAT_VIEW
void ensure(GPUAttachment depth=GPU_ATTACHMENT_NONE, GPUAttachment color1=GPU_ATTACHMENT_NONE, GPUAttachment color2=GPU_ATTACHMENT_NONE, GPUAttachment color3=GPU_ATTACHMENT_NONE, GPUAttachment color4=GPU_ATTACHMENT_NONE, GPUAttachment color5=GPU_ATTACHMENT_NONE, GPUAttachment color6=GPU_ATTACHMENT_NONE, GPUAttachment color7=GPU_ATTACHMENT_NONE, GPUAttachment color8=GPU_ATTACHMENT_NONE)
void submit(PassSimple &pass, View &view)
void acquire(int2 extent, eGPUTextureFormat format, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL)
bool ensure_2d(eGPUTextureFormat format, int2 extent, eGPUTextureUsage usage=GPU_TEXTURE_USAGE_GENERAL, const float *data=nullptr, int mip_len=1)
void bind_texture(const char *name, GPUTexture *texture, GPUSamplerState state=sampler_auto)
void clear_color(float4 color)
void draw_procedural(GPUPrimType primitive, uint instance_len, uint vertex_len, uint vertex_first=-1, ResourceHandle handle={0}, uint custom_id=0)
PassBase< command::DrawMultiBuf > & sub(const char *name)
void state_set(DRWState state, int clip_plane_count=0)
void bind_ubo(const char *name, GPUUniformBuf *buffer)
void state_stencil(uint8_t write_mask, uint8_t reference, uint8_t compare_mask)
void push_constant(const char *name, const float &data)
void bind_ssbo(const char *name, GPUStorageBuf *buffer)
void shader_set(GPUShader *shader)
void setup_resolve_pass(PassSimple &pass, SceneResources &resources)
MeshPass(const char *name)
PassMain::Sub & get_subpass(eGeometryType geometry_type, const MaterialTexture *texture=nullptr)
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)
GPUTexture * deferred_ps_stencil_tx
MeshPass gbuffer_in_front_ps_
TextureFromPool gbuffer_material_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, GPUTexture &depth_stencil_tx, bool force_fail_method)
GPUTexture * extract(Manager &manager, Texture &stencil_src)
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
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
static constexpr int geometry_type_len
static constexpr int shader_type_len
static const char * get_name(eGeometryType type)
VecBase< float, 4 > float4
StencilViewWorkaround stencil_view
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