Skip to content

Commit 6fe52a3

Browse files
authored
Use correct internal format for WebGL 565/5551/RGBA4 formats (#7493)
1 parent 033508e commit 6fe52a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/platform/graphics/webgl/webgl-texture.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,17 @@ class WebglTexture {
144144
break;
145145
case PIXELFORMAT_RGB565:
146146
this._glFormat = gl.RGB;
147-
this._glInternalFormat = gl.RGB;
147+
this._glInternalFormat = gl.RGB565;
148148
this._glPixelType = gl.UNSIGNED_SHORT_5_6_5;
149149
break;
150150
case PIXELFORMAT_RGBA5551:
151151
this._glFormat = gl.RGBA;
152-
this._glInternalFormat = gl.RGBA;
152+
this._glInternalFormat = gl.RGB5_A1;
153153
this._glPixelType = gl.UNSIGNED_SHORT_5_5_5_1;
154154
break;
155155
case PIXELFORMAT_RGBA4:
156156
this._glFormat = gl.RGBA;
157-
this._glInternalFormat = gl.RGBA;
157+
this._glInternalFormat = gl.RGBA4;
158158
this._glPixelType = gl.UNSIGNED_SHORT_4_4_4_4;
159159
break;
160160
case PIXELFORMAT_RGB8:

0 commit comments

Comments
 (0)