summaryrefslogtreecommitdiff
path: root/GLESv1_CM
diff options
context:
space:
mode:
authorStanislav Vorobiov <s.vorobiov@samsung.com>2014-02-05 19:59:29 +0400
committerStanislav Vorobiov <s.vorobiov@samsung.com>2014-02-05 22:27:51 +0400
commit4427b40b0dec87aa393c0e1f32632aad28703d0a (patch)
treea16d287df4a231716945073071a6d99006a576e9 /GLESv1_CM
parent7a5043508f4c1761cf1c92d812774970dc3b4846 (diff)
downloademulator-yagl-4427b40b0dec87aa393c0e1f32632aad28703d0a.tar.gz
emulator-yagl-4427b40b0dec87aa393c0e1f32632aad28703d0a.tar.bz2
emulator-yagl-4427b40b0dec87aa393c0e1f32632aad28703d0a.zip
YaGL: Better pixel format handling and validation
We introduce yagl_pixel_format that is now used to describe pixel formats, it's also capable of doing target <-> host conversions. This is much better than old approach, it allows us to have all format descriptions in one place, validation is also easier and adding new format is a matter of adding new yagl_pixel_format Change-Id: I81cedb55ef2f871420aaf80c7b9d47d9fbf9aca2
Diffstat (limited to 'GLESv1_CM')
-rw-r--r--GLESv1_CM/yagl_gles1_context.c44
1 files changed, 34 insertions, 10 deletions
diff --git a/GLESv1_CM/yagl_gles1_context.c b/GLESv1_CM/yagl_gles1_context.c
index ea42bce..90fb8b9 100644
--- a/GLESv1_CM/yagl_gles1_context.c
+++ b/GLESv1_CM/yagl_gles1_context.c
@@ -1379,10 +1379,33 @@ static int yagl_gles1_context_validate_texture_target(struct yagl_gles_context *
return 0;
}
-static int yagl_gles1_context_validate_texture_internalformat(struct yagl_gles_context *ctx,
- GLenum *internalformat,
- GLenum *any_format,
- GLenum *any_type)
+static struct yagl_pixel_format
+ *yagl_gles1_context_validate_teximage_format(struct yagl_gles_context *ctx,
+ GLenum internalformat,
+ GLenum format,
+ GLenum type)
+{
+ return NULL;
+}
+
+static struct yagl_pixel_format
+ *yagl_gles1_context_validate_getteximage_format(struct yagl_gles_context *ctx,
+ GLenum format,
+ GLenum type)
+{
+ return NULL;
+}
+
+static int yagl_gles1_context_validate_copyteximage_format(struct yagl_gles_context *ctx,
+ GLenum *internalformat)
+{
+ return 0;
+}
+
+static int yagl_gles1_context_validate_texstorage_format(struct yagl_gles_context *ctx,
+ GLenum *internalformat,
+ GLenum *any_format,
+ GLenum *any_type)
{
YaglGles1PalFmtDesc fmt_desc;
@@ -1400,10 +1423,8 @@ static int yagl_gles1_context_validate_texture_internalformat(struct yagl_gles_c
return 1;
}
-static int yagl_gles1_context_validate_format(struct yagl_gles_context *ctx,
- GLenum format,
- GLenum type,
- GLsizei *bpp)
+static int yagl_gles1_context_validate_renderbuffer_format(struct yagl_gles_context *ctx,
+ GLenum *internalformat)
{
return 0;
}
@@ -1436,8 +1457,11 @@ struct yagl_client_context *yagl_gles1_context_create(struct yagl_sharegroup *sg
gles1_ctx->base.unbind_buffer = &yagl_gles1_context_unbind_buffer;
gles1_ctx->base.acquire_binded_buffer = &yagl_gles1_context_acquire_binded_buffer;
gles1_ctx->base.validate_texture_target = &yagl_gles1_context_validate_texture_target;
- gles1_ctx->base.validate_texture_internalformat = &yagl_gles1_context_validate_texture_internalformat;
- gles1_ctx->base.validate_format = &yagl_gles1_context_validate_format;
+ gles1_ctx->base.validate_teximage_format = &yagl_gles1_context_validate_teximage_format;
+ gles1_ctx->base.validate_getteximage_format = &yagl_gles1_context_validate_getteximage_format;
+ gles1_ctx->base.validate_copyteximage_format = &yagl_gles1_context_validate_copyteximage_format;
+ gles1_ctx->base.validate_texstorage_format = &yagl_gles1_context_validate_texstorage_format;
+ gles1_ctx->base.validate_renderbuffer_format = &yagl_gles1_context_validate_renderbuffer_format;
YAGL_LOG_FUNC_EXIT("%p", gles1_ctx);