summaryrefslogtreecommitdiff
path: root/GLESv2
diff options
context:
space:
mode:
authorVasiliy Ulyanov <v.ulyanov@samsung.com>2016-02-24 16:30:23 +0300
committerVasiliy Ulyanov <v.ulyanov@samsung.com>2016-06-20 10:47:09 +0300
commit3e37798f4458f4eaf3cccbd376273f5026a6fb4c (patch)
tree1ab5d9657c560c37ee3cdb84994f1794ee52e966 /GLESv2
parentac4f838fa15f8467ad9a07143aee473ffea3c7e7 (diff)
downloademulator-yagl-3e37798f4458f4eaf3cccbd376273f5026a6fb4c.tar.gz
emulator-yagl-3e37798f4458f4eaf3cccbd376273f5026a6fb4c.tar.bz2
emulator-yagl-3e37798f4458f4eaf3cccbd376273f5026a6fb4c.zip
YaGL: Add more strict error checking
- glLinkProgram: linking should fail if vertex and fragment shaders are not both present in the program object. - glBlitFramebuffer: if the source and destination buffers are identical, an INVALID_OPERATION error should be generated. NOTE: valid only for OGLES3.0. Not the case with e.g. GL_ANGLE_framebuffer_blit. Change-Id: I0fdc4e383e32e9cfcb9028f4b279b8acdb8410c7 Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Diffstat (limited to 'GLESv2')
-rw-r--r--GLESv2/yagl_gles2_calls.c5
-rw-r--r--GLESv2/yagl_gles2_context.c6
-rw-r--r--GLESv2/yagl_gles3_context.c15
3 files changed, 26 insertions, 0 deletions
diff --git a/GLESv2/yagl_gles2_calls.c b/GLESv2/yagl_gles2_calls.c
index 661603b..45befd7 100644
--- a/GLESv2/yagl_gles2_calls.c
+++ b/GLESv2/yagl_gles2_calls.c
@@ -1293,6 +1293,11 @@ YAGL_API void glLinkProgram(GLuint program)
goto out;
}
+ if (!program_obj->vertex_shader || !program_obj->fragment_shader) {
+ YAGL_SET_ERR(GL_INVALID_OPERATION);
+ goto out;
+ }
+
if (!ctx->pre_link_program(ctx, program_obj)) {
goto out;
}
diff --git a/GLESv2/yagl_gles2_context.c b/GLESv2/yagl_gles2_context.c
index 0949ccf..46e3991 100644
--- a/GLESv2/yagl_gles2_context.c
+++ b/GLESv2/yagl_gles2_context.c
@@ -1386,6 +1386,11 @@ int yagl_gles2_context_validate_renderbuffer_format(struct yagl_gles_context *ct
return 0;
}
+static int yagl_gles2_context_validate_framebuffer_blit(struct yagl_gles_context *ctx)
+{
+ return 1;
+}
+
void yagl_gles2_context_hint(struct yagl_gles_context *ctx,
GLenum target,
GLenum mode)
@@ -1461,6 +1466,7 @@ struct yagl_client_context *yagl_gles2_context_create(struct yagl_sharegroup *sg
gles2_ctx->base.validate_copyteximage_format = &yagl_gles2_context_validate_copyteximage_format;
gles2_ctx->base.validate_texstorage_format = &yagl_gles2_context_validate_texstorage_format;
gles2_ctx->base.validate_renderbuffer_format = &yagl_gles2_context_validate_renderbuffer_format;
+ gles2_ctx->base.validate_framebuffer_blit = &yagl_gles2_context_validate_framebuffer_blit;
gles2_ctx->base.hint = &yagl_gles2_context_hint;
gles2_ctx->get_programiv = &yagl_gles2_context_get_programiv;
gles2_ctx->pre_use_program = &yagl_gles2_context_pre_use_program;
diff --git a/GLESv2/yagl_gles3_context.c b/GLESv2/yagl_gles3_context.c
index ff90c4b..846ac7f 100644
--- a/GLESv2/yagl_gles3_context.c
+++ b/GLESv2/yagl_gles3_context.c
@@ -1553,6 +1553,20 @@ static int yagl_gles3_context_validate_renderbuffer_format(struct yagl_gles_cont
return 1;
}
+static int yagl_gles3_context_validate_framebuffer_blit(struct yagl_gles_context *gles_ctx)
+{
+ struct yagl_gles3_context *ctx = (struct yagl_gles3_context*)gles_ctx;
+
+ YAGL_LOG_FUNC_SET(glBlitFramebuffer);
+
+ if (ctx->base.base.fbo_read == ctx->base.base.fbo_draw) {
+ YAGL_SET_ERR(GL_INVALID_OPERATION);
+ return 0;
+ }
+
+ return 1;
+}
+
static void yagl_gles3_context_hint(struct yagl_gles_context *gles_ctx,
GLenum target,
GLenum mode)
@@ -1672,6 +1686,7 @@ struct yagl_client_context *yagl_gles3_context_create(struct yagl_sharegroup *sg
gles3_ctx->base.base.validate_copyteximage_format = &yagl_gles3_context_validate_copyteximage_format;
gles3_ctx->base.base.validate_texstorage_format = &yagl_gles3_context_validate_texstorage_format;
gles3_ctx->base.base.validate_renderbuffer_format = &yagl_gles3_context_validate_renderbuffer_format;
+ gles3_ctx->base.base.validate_framebuffer_blit = &yagl_gles3_context_validate_framebuffer_blit;
gles3_ctx->base.base.hint = &yagl_gles3_context_hint;
gles3_ctx->base.get_programiv = &yagl_gles3_context_get_programiv;
gles3_ctx->base.pre_use_program = &yagl_gles3_context_pre_use_program;