diff --git a/cogl/cogl/cogl-bitmap-conversion.c b/cogl/cogl/cogl-bitmap-conversion.c index d48c51bd2..108cb6677 100644 --- a/cogl/cogl/cogl-bitmap-conversion.c +++ b/cogl/cogl/cogl-bitmap-conversion.c @@ -357,7 +357,9 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format) case COGL_PIXEL_FORMAT_BGRA_1010102_PRE: case COGL_PIXEL_FORMAT_ARGB_2101010_PRE: case COGL_PIXEL_FORMAT_ABGR_2101010_PRE: + case COGL_PIXEL_FORMAT_RGBX_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616: + case COGL_PIXEL_FORMAT_BGRX_FP_16161616: case COGL_PIXEL_FORMAT_BGRA_FP_16161616: case COGL_PIXEL_FORMAT_XRGB_FP_16161616: case COGL_PIXEL_FORMAT_ARGB_FP_16161616: diff --git a/cogl/cogl/cogl-bitmap-packing.h b/cogl/cogl/cogl-bitmap-packing.h index e16c318e0..12cc1c7f7 100644 --- a/cogl/cogl/cogl-bitmap-packing.h +++ b/cogl/cogl/cogl-bitmap-packing.h @@ -522,7 +522,9 @@ G_PASTE (_cogl_unpack_, component_size) (CoglPixelFormat format, case COGL_PIXEL_FORMAT_ABGR_2101010_PRE: G_PASTE (_cogl_unpack_abgr_2101010_, component_size) (src, dst, width); break; + case COGL_PIXEL_FORMAT_RGBX_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616: + case COGL_PIXEL_FORMAT_BGRX_FP_16161616: case COGL_PIXEL_FORMAT_BGRA_FP_16161616: case COGL_PIXEL_FORMAT_XRGB_FP_16161616: case COGL_PIXEL_FORMAT_ARGB_FP_16161616: @@ -1021,7 +1023,9 @@ G_PASTE (_cogl_pack_, component_size) (CoglPixelFormat format, case COGL_PIXEL_FORMAT_ABGR_2101010_PRE: G_PASTE (_cogl_pack_abgr_2101010_, component_size) (src, dst, width); break; + case COGL_PIXEL_FORMAT_RGBX_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616: + case COGL_PIXEL_FORMAT_BGRX_FP_16161616: case COGL_PIXEL_FORMAT_BGRA_FP_16161616: case COGL_PIXEL_FORMAT_XRGB_FP_16161616: case COGL_PIXEL_FORMAT_ARGB_FP_16161616: diff --git a/cogl/cogl/cogl-pixel-format.c b/cogl/cogl/cogl-pixel-format.c index 682bbf8f2..c60d293bf 100644 --- a/cogl/cogl/cogl-pixel-format.c +++ b/cogl/cogl/cogl-pixel-format.c @@ -287,6 +287,13 @@ static const CoglPixelFormatInfo format_info_table[] = { .aligned = 0, .bpp = { 4 }, }, + { + .cogl_format = COGL_PIXEL_FORMAT_RGBX_FP_16161616, + .format_str = "RGBX_FP_16161616", + .n_planes = 1, + .bpp = { 8 }, + .aligned = 1 + }, { .cogl_format = COGL_PIXEL_FORMAT_RGBA_FP_16161616, .format_str = "RGBA_FP_16161616", @@ -294,6 +301,13 @@ static const CoglPixelFormatInfo format_info_table[] = { .bpp = { 8 }, .aligned = 1 }, + { + .cogl_format = COGL_PIXEL_FORMAT_BGRX_FP_16161616, + .format_str = "BGRX_FP_16161616", + .n_planes = 1, + .bpp = { 8 }, + .aligned = 1 + }, { .cogl_format = COGL_PIXEL_FORMAT_BGRA_FP_16161616, .format_str = "BGRA_FP_16161616", diff --git a/cogl/cogl/cogl-pixel-format.h b/cogl/cogl/cogl-pixel-format.h index ff390a08b..51304e9d7 100644 --- a/cogl/cogl/cogl-pixel-format.h +++ b/cogl/cogl/cogl-pixel-format.h @@ -174,7 +174,9 @@ G_BEGIN_DECLS * @COGL_PIXEL_FORMAT_BGRA_1010102_PRE: Premultiplied BGRA, 32 bits, 10 bpc * @COGL_PIXEL_FORMAT_ARGB_2101010_PRE: Premultiplied ARGB, 32 bits, 10 bpc * @COGL_PIXEL_FORMAT_ABGR_2101010_PRE: Premultiplied ABGR, 32 bits, 10 bpc + * @COGL_PIXEL_FORMAT_RGBX_FP_16161616: RGBX half floating point, 64 bit * @COGL_PIXEL_FORMAT_RGBA_FP_16161616: RGBA half floating point, 64 bit + * @COGL_PIXEL_FORMAT_BGRX_FP_16161616: BGRX half floating point, 64 bit * @COGL_PIXEL_FORMAT_BGRA_FP_16161616: BGRA half floating point, 64 bit * @COGL_PIXEL_FORMAT_ARGB_FP_16161616: ARGB half floating point, 64 bit * @COGL_PIXEL_FORMAT_ABGR_FP_16161616: ABGR half floating point, 64 bit @@ -234,7 +236,9 @@ typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/ COGL_PIXEL_FORMAT_XBGR_2101010 = (13 | COGL_BGR_BIT | COGL_AFIRST_BIT), COGL_PIXEL_FORMAT_ABGR_2101010 = (13 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT), + COGL_PIXEL_FORMAT_RGBX_FP_16161616 = 11, COGL_PIXEL_FORMAT_RGBA_FP_16161616 = (11 | COGL_A_BIT), + COGL_PIXEL_FORMAT_BGRX_FP_16161616 = (11 | COGL_BGR_BIT), COGL_PIXEL_FORMAT_BGRA_FP_16161616 = (11 | COGL_A_BIT | COGL_BGR_BIT), COGL_PIXEL_FORMAT_XRGB_FP_16161616 = (11 | COGL_AFIRST_BIT), COGL_PIXEL_FORMAT_ARGB_FP_16161616 = (11 | COGL_A_BIT | COGL_AFIRST_BIT), diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c index 1cb6e72f6..ec6f1f270 100644 --- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c @@ -315,12 +315,22 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context, gltype = GL_UNSIGNED_SHORT_5_5_5_1; break; + case COGL_PIXEL_FORMAT_RGBX_FP_16161616: + glintformat = GL_RGB; + glformat = GL_RGBA; + gltype = GL_HALF_FLOAT; + break; case COGL_PIXEL_FORMAT_RGBA_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE: glintformat = GL_RGBA; glformat = GL_RGBA; gltype = GL_HALF_FLOAT; break; + case COGL_PIXEL_FORMAT_BGRX_FP_16161616: + glintformat = GL_RGB; + glformat = GL_BGRA; + gltype = GL_HALF_FLOAT; + break; case COGL_PIXEL_FORMAT_BGRA_FP_16161616: case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE: glintformat = GL_RGBA; @@ -328,6 +338,10 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context, gltype = GL_HALF_FLOAT; break; case COGL_PIXEL_FORMAT_XRGB_FP_16161616: + glintformat = GL_RGB; + glformat = GL_BGRA; + gltype = GL_HALF_FLOAT; + break; case COGL_PIXEL_FORMAT_ARGB_FP_16161616: case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE: glintformat = GL_RGBA; @@ -335,6 +349,10 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context, gltype = GL_HALF_FLOAT; break; case COGL_PIXEL_FORMAT_XBGR_FP_16161616: + glintformat = GL_RGB; + glformat = GL_RGBA; + gltype = GL_HALF_FLOAT; + break; case COGL_PIXEL_FORMAT_ABGR_FP_16161616: case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE: glintformat = GL_RGBA; diff --git a/cogl/cogl/driver/gl/gl/cogl-texture-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-texture-driver-gl.c index a1b4cadc2..caee72b2c 100644 --- a/cogl/cogl/driver/gl/gl/cogl-texture-driver-gl.c +++ b/cogl/cogl/driver/gl/gl/cogl-texture-driver-gl.c @@ -435,6 +435,7 @@ _cogl_texture_driver_upload_supported (CoglContext *ctx, case COGL_PIXEL_FORMAT_RGBA_5551: case COGL_PIXEL_FORMAT_RGBA_5551_PRE: return TRUE; + case COGL_PIXEL_FORMAT_BGRX_FP_16161616: case COGL_PIXEL_FORMAT_BGRA_FP_16161616: case COGL_PIXEL_FORMAT_XRGB_FP_16161616: case COGL_PIXEL_FORMAT_ARGB_FP_16161616: @@ -443,6 +444,7 @@ _cogl_texture_driver_upload_supported (CoglContext *ctx, case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE: case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE: case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE: + case COGL_PIXEL_FORMAT_RGBX_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE: if (_cogl_has_private_feature diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c index 08920f53d..e328320a4 100644 --- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c @@ -223,6 +223,7 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context, gltype = GL_UNSIGNED_SHORT_5_5_5_1; break; + case COGL_PIXEL_FORMAT_BGRX_FP_16161616: case COGL_PIXEL_FORMAT_BGRA_FP_16161616: case COGL_PIXEL_FORMAT_XRGB_FP_16161616: case COGL_PIXEL_FORMAT_ARGB_FP_16161616: @@ -234,6 +235,7 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context, g_warning ("Unhandled 16 bpc pixel format used"); G_GNUC_FALLTHROUGH; + case COGL_PIXEL_FORMAT_RGBX_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE: if (!_cogl_has_private_feature diff --git a/cogl/cogl/driver/gl/gles/cogl-texture-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-texture-driver-gles.c index 4d9519a3b..025943038 100644 --- a/cogl/cogl/driver/gl/gles/cogl-texture-driver-gles.c +++ b/cogl/cogl/driver/gl/gles/cogl-texture-driver-gles.c @@ -488,6 +488,7 @@ _cogl_texture_driver_upload_supported (CoglContext *ctx, case COGL_PIXEL_FORMAT_RGBA_5551: case COGL_PIXEL_FORMAT_RGBA_5551_PRE: return TRUE; + case COGL_PIXEL_FORMAT_BGRX_FP_16161616: case COGL_PIXEL_FORMAT_BGRA_FP_16161616: case COGL_PIXEL_FORMAT_XRGB_FP_16161616: case COGL_PIXEL_FORMAT_ARGB_FP_16161616: @@ -497,6 +498,7 @@ _cogl_texture_driver_upload_supported (CoglContext *ctx, case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE: case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE: return FALSE; + case COGL_PIXEL_FORMAT_RGBX_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616: case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE: if (_cogl_has_private_feature