diff options
author | Ilia Mirkin <[email protected]> | 2017-12-31 01:05:06 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2018-02-19 22:33:58 -0500 |
commit | ebdc4c31e23ffd5ce0d1fc47dd8f76c146961e25 (patch) | |
tree | fdd9dbae065b2aa46f2a7c1070287b503919cdb9 /src/mesa | |
parent | d88a2906f86843fa11d95f7ac2f39cd0b2713d72 (diff) |
mesa: add xbgr support adjacent to xrgb
Signed-off-by: Ilia Mirkin <[email protected]>
Acked-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/common/utils.c | 10 | ||||
-rw-r--r-- | src/mesa/main/framebuffer.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index e944754a424..1cffd3ad08e 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -177,6 +177,10 @@ driCreateConfigs(mesa_format format, { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 }, /* MESA_FORMAT_R8G8B8X8_UNORM */ { 0x000000FF, 0x0000FF00, 0x00FF0000, 0x00000000 }, + /* MESA_FORMAT_R10G10B10X2_UNORM */ + { 0x000003FF, 0x000FFC00, 0x3FF00000, 0x00000000 }, + /* MESA_FORMAT_R10G10B10A2_UNORM */ + { 0x000003FF, 0x000FFC00, 0x3FF00000, 0xC0000000 }, }; const uint32_t * masks; @@ -215,6 +219,12 @@ driCreateConfigs(mesa_format format, case MESA_FORMAT_B10G10R10A2_UNORM: masks = masks_table[4]; break; + case MESA_FORMAT_R10G10B10X2_UNORM: + masks = masks_table[7]; + break; + case MESA_FORMAT_R10G10B10A2_UNORM: + masks = masks_table[8]; + break; default: fprintf(stderr, "[%s:%u] Unknown framebuffer type %s (%d).\n", __func__, __LINE__, diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index e103f313e45..249e775f8cb 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -890,7 +890,9 @@ _mesa_get_color_read_type(struct gl_context *ctx, return GL_UNSIGNED_SHORT_5_6_5; if (format == MESA_FORMAT_B10G10R10A2_UNORM || - format == MESA_FORMAT_B10G10R10X2_UNORM) + format == MESA_FORMAT_B10G10R10X2_UNORM || + format == MESA_FORMAT_R10G10B10A2_UNORM || + format == MESA_FORMAT_R10G10B10X2_UNORM) return GL_UNSIGNED_INT_2_10_10_10_REV; switch (data_type) { diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 0800f5b3d29..02ae8e1380e 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -288,8 +288,10 @@ st_new_renderbuffer_fb(enum pipe_format format, unsigned samples, boolean sw) switch (format) { case PIPE_FORMAT_B10G10R10A2_UNORM: + case PIPE_FORMAT_R10G10B10A2_UNORM: strb->Base.InternalFormat = GL_RGB10_A2; break; + case PIPE_FORMAT_R10G10B10X2_UNORM: case PIPE_FORMAT_B10G10R10X2_UNORM: strb->Base.InternalFormat = GL_RGB10; break; |