summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Vorobiov <s.vorobiov@samsung.com>2014-02-20 10:35:00 +0400
committerStanislav Vorobiov <s.vorobiov@samsung.com>2014-02-20 10:35:00 +0400
commit8193330a4fb54f4d8ffbf380f50a9dc395d8938a (patch)
treef057f392e8cc91374c410065302a545031198e3d
parent1595d9d7007a4d2e05c32c5f285589f5494d2abb (diff)
downloademulator-yagl-8193330a4fb54f4d8ffbf380f50a9dc395d8938a.tar.gz
emulator-yagl-8193330a4fb54f4d8ffbf380f50a9dc395d8938a.tar.bz2
emulator-yagl-8193330a4fb54f4d8ffbf380f50a9dc395d8938a.zip
YaGL: Allow zero draw/read fbo in glBlitFramebuffer
Change-Id: I8230f24bf40ffb46556969b35d7f4a7354b1c012
-rw-r--r--GLES_common/yagl_gles_calls.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/GLES_common/yagl_gles_calls.c b/GLES_common/yagl_gles_calls.c
index 74e30bb..2c55c83 100644
--- a/GLES_common/yagl_gles_calls.c
+++ b/GLES_common/yagl_gles_calls.c
@@ -2318,6 +2318,8 @@ YAGL_API void glBlitFramebuffer(GLint srcX0, GLint srcY0,
GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter)
{
+ GLenum read_status, draw_status;
+
YAGL_LOG_FUNC_ENTER_SPLIT10(glBlitFramebuffer, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
YAGL_GET_CTX();
@@ -2344,11 +2346,21 @@ YAGL_API void glBlitFramebuffer(GLint srcX0, GLint srcY0,
goto out;
}
- if (!ctx->fbo_draw || !ctx->fbo_read) {
+ read_status = yagl_gles_context_check_framebuffer_status(ctx,
+ ctx->fbo_read);
+
+ if (read_status != GL_FRAMEBUFFER_COMPLETE) {
+ YAGL_SET_ERR(GL_INVALID_FRAMEBUFFER_OPERATION);
goto out;
}
- yagl_render_invalidate(0);
+ draw_status = yagl_gles_context_check_framebuffer_status(ctx,
+ ctx->fbo_draw);
+
+ if (draw_status != GL_FRAMEBUFFER_COMPLETE) {
+ YAGL_SET_ERR(GL_INVALID_FRAMEBUFFER_OPERATION);
+ goto out;
+ }
if ((abs(dstX0 - dstX1) != abs(srcX0 - srcX1)) ||
(abs(dstY0 - dstY1) != abs(srcY0 - srcY1))) {
@@ -2360,6 +2372,8 @@ YAGL_API void glBlitFramebuffer(GLint srcX0, GLint srcY0,
goto out;
}
+ yagl_render_invalidate(0);
+
yagl_host_glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
out: