Fix shaders that use TIME do not force editor to continuously update
This commit is contained in:
parent
5bb3dbbedd
commit
0e31465a59
1 changed files with 12 additions and 0 deletions
|
@ -328,6 +328,8 @@ void RenderForwardClustered::_render_list_template(RenderingDevice::DrawListID p
|
|||
push_constant.uv_offset = 0;
|
||||
}
|
||||
|
||||
bool should_request_redraw = false;
|
||||
|
||||
for (uint32_t i = p_from_element; i < p_to_element; i++) {
|
||||
const GeometryInstanceSurfaceDataCache *surf = p_params->elements[i];
|
||||
const RenderElementInfo &element_info = p_params->element_info[i];
|
||||
|
@ -365,6 +367,11 @@ void RenderForwardClustered::_render_list_template(RenderingDevice::DrawListID p
|
|||
continue;
|
||||
}
|
||||
|
||||
//request a redraw if one of the shaders uses TIME
|
||||
if (shader->uses_time) {
|
||||
should_request_redraw = true;
|
||||
}
|
||||
|
||||
//find cull variant
|
||||
SceneShaderForwardClustered::ShaderData::CullVariant cull_variant;
|
||||
|
||||
|
@ -500,6 +507,11 @@ void RenderForwardClustered::_render_list_template(RenderingDevice::DrawListID p
|
|||
RD::get_singleton()->draw_list_draw(draw_list, index_array_rd.is_valid(), instance_count);
|
||||
i += element_info.repeat - 1; //skip equal elements
|
||||
}
|
||||
|
||||
// Make the actual redraw request
|
||||
if (should_request_redraw) {
|
||||
RenderingServerDefault::redraw_request();
|
||||
}
|
||||
}
|
||||
|
||||
void RenderForwardClustered::_render_list(RenderingDevice::DrawListID p_draw_list, RenderingDevice::FramebufferFormatID p_framebuffer_Format, RenderListParameters *p_params, uint32_t p_from_element, uint32_t p_to_element) {
|
||||
|
|
Loading…
Reference in a new issue