diff options
Diffstat (limited to 'drivers/gles3/rasterizer_canvas_gles3.cpp')
-rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 309497c938..86415ea740 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1086,19 +1086,22 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons } } - if (shader_ptr && shader_ptr != shader_cache) { + if (shader_ptr) { if (shader_ptr->canvas_item.uses_screen_texture && !state.canvas_texscreen_used) { //copy if not copied before _copy_texscreen(Rect2()); } - if (shader_ptr->canvas_item.uses_time) { - VisualServerRaster::redraw_request(); - } + if (shader_ptr != shader_cache) { - state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id); - state.canvas_shader.bind(); + if (shader_ptr->canvas_item.uses_time) { + VisualServerRaster::redraw_request(); + } + + state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id); + state.canvas_shader.bind(); + } if (material_ptr->ubo_id) { glBindBufferBase(GL_UNIFORM_BUFFER, 2, material_ptr->ubo_id); @@ -1147,7 +1150,7 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons glBindTexture(t->target, t->tex_id); } - } else if (!shader_ptr) { + } else { state.canvas_shader.set_custom_shader(0); state.canvas_shader.bind(); } @@ -1545,7 +1548,7 @@ void RasterizerCanvasGLES3::reset_canvas() { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //use for reading from screen - if (storage->frame.current_rt) { + if (storage->frame.current_rt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_NO_SAMPLING]) { glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 3); glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color); } @@ -1784,6 +1787,8 @@ void RasterizerCanvasGLES3::initialize() { state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_RGBA_SHADOWS, storage->config.use_rgba_2d_shadows); state.canvas_shadow_shader.set_conditional(CanvasShadowShaderGLES3::USE_RGBA_SHADOWS, storage->config.use_rgba_2d_shadows); + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_PIXEL_SNAP, GLOBAL_DEF("rendering/quality/2d/use_pixel_snap", false)); } void RasterizerCanvasGLES3::finalize() { |