diff --git a/cogl/cogl-atlas.c b/cogl/cogl-atlas.c index f892a9d4a..2fe85f099 100644 --- a/cogl/cogl-atlas.c +++ b/cogl/cogl-atlas.c @@ -173,6 +173,7 @@ _cogl_atlas_get_initial_size (CoglPixelFormat format, { unsigned int size; GLenum gl_intformat; + GLenum gl_format; GLenum gl_type; _COGL_GET_CONTEXT (ctx, NO_RETVAL); @@ -180,7 +181,7 @@ _cogl_atlas_get_initial_size (CoglPixelFormat format, ctx->driver_vtable->pixel_format_to_gl (ctx, format, &gl_intformat, - NULL, /* gl_format */ + &gl_format, &gl_type); /* At least on Intel hardware, the texture size will be rounded up @@ -199,6 +200,7 @@ _cogl_atlas_get_initial_size (CoglPixelFormat format, !ctx->texture_driver->size_supported (ctx, GL_TEXTURE_2D, gl_intformat, + gl_format, gl_type, size, size)) size >>= 1; @@ -215,6 +217,7 @@ _cogl_atlas_create_map (CoglPixelFormat format, CoglAtlasRepositionData *textures) { GLenum gl_intformat; + GLenum gl_format; GLenum gl_type; _COGL_GET_CONTEXT (ctx, NULL); @@ -222,7 +225,7 @@ _cogl_atlas_create_map (CoglPixelFormat format, ctx->driver_vtable->pixel_format_to_gl (ctx, format, &gl_intformat, - NULL, /* gl_format */ + &gl_format, &gl_type); /* Keep trying increasingly larger atlases until we can fit all of @@ -230,6 +233,7 @@ _cogl_atlas_create_map (CoglPixelFormat format, while (ctx->texture_driver->size_supported (ctx, GL_TEXTURE_2D, gl_intformat, + gl_format, gl_type, map_width, map_height)) { diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c index 11e6adf5f..fc33abed7 100644 --- a/cogl/cogl-texture-2d-sliced.c +++ b/cogl/cogl-texture-2d-sliced.c @@ -622,6 +622,7 @@ _cogl_texture_2d_sliced_slices_create (CoglContext *ctx, CoglSpan *x_span; CoglSpan *y_span; GLenum gl_intformat; + GLenum gl_format; GLenum gl_type; int (*slices_for_size) (int, int, int, GArray*); @@ -643,7 +644,7 @@ _cogl_texture_2d_sliced_slices_create (CoglContext *ctx, ctx->driver_vtable->pixel_format_to_gl (ctx, format, &gl_intformat, - NULL, + &gl_format, &gl_type); /* Negative number means no slicing forced by the user */ @@ -655,6 +656,7 @@ _cogl_texture_2d_sliced_slices_create (CoglContext *ctx, if (!ctx->texture_driver->size_supported (ctx, GL_TEXTURE_2D, gl_intformat, + gl_format, gl_type, max_width, max_height)) @@ -690,6 +692,7 @@ _cogl_texture_2d_sliced_slices_create (CoglContext *ctx, while (!ctx->texture_driver->size_supported (ctx, GL_TEXTURE_2D, gl_intformat, + gl_format, gl_type, max_width, max_height)) diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c index efb19330e..8ea4c75f7 100644 --- a/cogl/cogl-texture-2d.c +++ b/cogl/cogl-texture-2d.c @@ -109,6 +109,7 @@ _cogl_texture_2d_can_create (unsigned int width, CoglPixelFormat internal_format) { GLenum gl_intformat; + GLenum gl_format; GLenum gl_type; _COGL_GET_CONTEXT (ctx, FALSE); @@ -123,13 +124,14 @@ _cogl_texture_2d_can_create (unsigned int width, ctx->driver_vtable->pixel_format_to_gl (ctx, internal_format, &gl_intformat, - NULL, + &gl_format, &gl_type); /* Check that the driver can create a texture with that size */ if (!ctx->texture_driver->size_supported (ctx, GL_TEXTURE_2D, gl_intformat, + gl_format, gl_type, width, height)) diff --git a/cogl/cogl-texture-driver.h b/cogl/cogl-texture-driver.h index 151338142..d4b2b0d86 100644 --- a/cogl/cogl-texture-driver.h +++ b/cogl/cogl-texture-driver.h @@ -147,6 +147,7 @@ struct _CoglTextureDriver CoglBool (* size_supported) (CoglContext *ctx, GLenum gl_target, + GLenum gl_intformat, GLenum gl_format, GLenum gl_type, int width, diff --git a/cogl/cogl-texture-rectangle.c b/cogl/cogl-texture-rectangle.c index 53d5a80e7..688bc1825 100644 --- a/cogl/cogl-texture-rectangle.c +++ b/cogl/cogl-texture-rectangle.c @@ -115,6 +115,7 @@ _cogl_texture_rectangle_can_create (unsigned int width, GError **error) { GLenum gl_intformat; + GLenum gl_format; GLenum gl_type; _COGL_GET_CONTEXT (ctx, FALSE); @@ -131,13 +132,14 @@ _cogl_texture_rectangle_can_create (unsigned int width, ctx->driver_vtable->pixel_format_to_gl (ctx, internal_format, &gl_intformat, - NULL, + &gl_format, &gl_type); /* Check that the driver can create a texture with that size */ if (!ctx->texture_driver->size_supported (ctx, GL_TEXTURE_RECTANGLE_ARB, gl_intformat, + gl_format, gl_type, width, height)) diff --git a/cogl/driver/gl/cogl-texture-driver-gl.c b/cogl/driver/gl/cogl-texture-driver-gl.c index 6d0a9085a..2c591777b 100644 --- a/cogl/driver/gl/cogl-texture-driver-gl.c +++ b/cogl/driver/gl/cogl-texture-driver-gl.c @@ -314,6 +314,7 @@ _cogl_texture_driver_size_supported_3d (CoglContext *ctx, static CoglBool _cogl_texture_driver_size_supported (CoglContext *ctx, GLenum gl_target, + GLenum gl_intformat, GLenum gl_format, GLenum gl_type, int width, @@ -333,7 +334,7 @@ _cogl_texture_driver_size_supported (CoglContext *ctx, return FALSE; /* Proxy texture allows for a quick check for supported size */ - GE( ctx, glTexImage2D (proxy_target, 0, GL_RGBA, + GE( ctx, glTexImage2D (proxy_target, 0, gl_intformat, width, height, 0 /* border */, gl_format, gl_type, NULL) ); diff --git a/cogl/driver/gles/cogl-texture-driver-gles.c b/cogl/driver/gles/cogl-texture-driver-gles.c index 50f8e3075..d4d2b5d08 100644 --- a/cogl/driver/gles/cogl-texture-driver-gles.c +++ b/cogl/driver/gles/cogl-texture-driver-gles.c @@ -410,6 +410,7 @@ _cogl_texture_driver_size_supported_3d (CoglContext *ctx, static CoglBool _cogl_texture_driver_size_supported (CoglContext *ctx, GLenum gl_target, + GLenum gl_intformat, GLenum gl_format, GLenum gl_type, int width,