summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp10
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp9
-rw-r--r--drivers/gles3/shaders/canvas.glsl4
3 files changed, 20 insertions, 3 deletions
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index 5f3b42abf6..7ae1758643 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -338,6 +338,15 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
RasterizerStorageGLES3::RenderTarget *rt = storage->render_target_owner.getornull(p_render_target);
ERR_FAIL_COND(!rt);
+#if 1
+
+ Size2 win_size = OS::get_singleton()->get_window_size();
+ glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->fbo);
+ glReadBuffer(GL_COLOR_ATTACHMENT0);
+ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
+ glBlitFramebuffer(0, 0, rt->width, rt->height, p_screen_rect.position.x, win_size.height - p_screen_rect.position.y - p_screen_rect.size.height, p_screen_rect.position.x + p_screen_rect.size.width, win_size.height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
+
+#else
canvas->canvas_begin();
glDisable(GL_BLEND);
glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
@@ -350,6 +359,7 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
canvas->draw_generic_textured_rect(p_screen_rect, Rect2(0, 0, 1, -1));
glBindTexture(GL_TEXTURE_2D, 0);
canvas->canvas_end();
+#endif
}
void RasterizerGLES3::end_frame(bool p_swap_buffers) {
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 5ce544ecfb..365840b2d8 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -193,6 +193,13 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_
r_gl_type = GL_UNSIGNED_SHORT_5_5_5_1;
} break;
+ case Image::FORMAT_RGB10A2: {
+
+ r_gl_internal_format = GL_RGB10_A2;
+ r_gl_format = GL_RGBA;
+ r_gl_type = GL_UNSIGNED_INT_2_10_10_10_REV;
+
+ } break;
case Image::FORMAT_RF: {
r_gl_internal_format = GL_R32F;
@@ -6090,7 +6097,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
color_internal_format = GL_RGB10_A2;
color_format = GL_RGBA;
color_type = GL_UNSIGNED_INT_2_10_10_10_REV;
- image_format = Image::FORMAT_RGBA8;
+ image_format = Image::FORMAT_RGB10A2;
} else {
color_internal_format = GL_RGBA8;
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl
index 0b8230234b..46641482ec 100644
--- a/drivers/gles3/shaders/canvas.glsl
+++ b/drivers/gles3/shaders/canvas.glsl
@@ -42,7 +42,7 @@ uniform highp mat4 modelview_matrix;
uniform highp mat4 extra_matrix;
-out mediump vec2 uv_interp;
+out highp vec2 uv_interp;
out mediump vec4 color_interp;
#ifdef USE_NINEPATCH
@@ -207,7 +207,7 @@ uniform mediump sampler2D color_texture; // texunit:0
uniform highp vec2 color_texpixel_size;
uniform mediump sampler2D normal_texture; // texunit:1
-in mediump vec2 uv_interp;
+in highp vec2 uv_interp;
in mediump vec4 color_interp;