Skip to content

Commit 2cef1f3

Browse files
author
Nick Klingensmith
committed
Fixes for packed color formats
Signed-off-by: Nick Klingensmith <quic_nklingen@quicinc.com>
1 parent 4108c4d commit 2cef1f3

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

sk_gpu.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3515,7 +3515,9 @@ DXGI_FORMAT skg_ind_to_dxgi(skg_ind_fmt_ format) {
35153515
#define GL_BGRA 0x80E1
35163516
#define GL_SRGB8_ALPHA8 0x8C43
35173517
#define GL_R11F_G11F_B10F 0x8C3A
3518+
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
35183519
#define GL_RGB10_A2 0x8059
3520+
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
35193521
#define GL_RGBA32F 0x8814
35203522
#define GL_RGBA16F 0x881A
35213523
#define GL_RGBA16I 0x8D88
@@ -6039,8 +6041,8 @@ uint32_t skg_tex_fmt_to_gl_type(skg_tex_fmt_ format) {
60396041
case skg_tex_fmt_r16u: return GL_UNSIGNED_SHORT;
60406042
case skg_tex_fmt_r16s: return GL_SHORT;
60416043
case skg_tex_fmt_rgba64s: return GL_SHORT;
6042-
case skg_tex_fmt_rgb10a2: return GL_FLOAT;
6043-
case skg_tex_fmt_rg11b10: return GL_FLOAT;
6044+
case skg_tex_fmt_rgb10a2: return GL_UNSIGNED_INT_2_10_10_10_REV;
6045+
case skg_tex_fmt_rg11b10: return GL_UNSIGNED_INT_10F_11F_11F_REV;
60446046
case skg_tex_fmt_rgba128: return GL_FLOAT;
60456047
case skg_tex_fmt_depth32: return GL_FLOAT;
60466048
case skg_tex_fmt_r32: return GL_FLOAT;

src/sk_gpu_gl.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@
259259
#define GL_BGRA 0x80E1
260260
#define GL_SRGB8_ALPHA8 0x8C43
261261
#define GL_R11F_G11F_B10F 0x8C3A
262+
#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
262263
#define GL_RGB10_A2 0x8059
264+
#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
263265
#define GL_RGBA32F 0x8814
264266
#define GL_RGBA16F 0x881A
265267
#define GL_RGBA16I 0x8D88
@@ -2783,8 +2785,8 @@ uint32_t skg_tex_fmt_to_gl_type(skg_tex_fmt_ format) {
27832785
case skg_tex_fmt_r16u: return GL_UNSIGNED_SHORT;
27842786
case skg_tex_fmt_r16s: return GL_SHORT;
27852787
case skg_tex_fmt_rgba64s: return GL_SHORT;
2786-
case skg_tex_fmt_rgb10a2: return GL_FLOAT;
2787-
case skg_tex_fmt_rg11b10: return GL_FLOAT;
2788+
case skg_tex_fmt_rgb10a2: return GL_UNSIGNED_INT_2_10_10_10_REV;
2789+
case skg_tex_fmt_rg11b10: return GL_UNSIGNED_INT_10F_11F_11F_REV;
27882790
case skg_tex_fmt_rgba128: return GL_FLOAT;
27892791
case skg_tex_fmt_depth32: return GL_FLOAT;
27902792
case skg_tex_fmt_r32: return GL_FLOAT;

0 commit comments

Comments
 (0)