LibWeb/WebGL: Map DEPTH_STENCIL to DEPTH24_STENCIL8 for WebGL 1 too

This commit is contained in:
Luke Wilde 2025-01-10 16:38:29 +00:00 committed by Andreas Kling
parent 55f7cb4f10
commit d13dd76818
Notes: github-actions[bot] 2025-01-21 20:37:29 +00:00

View file

@ -1548,10 +1548,22 @@ public:
if (function.name == "renderbufferStorage"sv) { if (function.name == "renderbufferStorage"sv) {
// To be backward compatible with WebGL 1, also accepts internal format DEPTH_STENCIL, which should be // To be backward compatible with WebGL 1, also accepts internal format DEPTH_STENCIL, which should be
// mapped to DEPTH24_STENCIL8 by implementations. // mapped to DEPTH24_STENCIL8 by implementations.
if (webgl_version == 2) { if (webgl_version == 1) {
function_impl_generator.append(R"~~~( function_impl_generator.append(R"~~~(
#define GL_DEPTH_STENCIL 0x84F9
#define GL_DEPTH24_STENCIL8 0x88F0
)~~~");
}
function_impl_generator.append(R"~~~(
if (internalformat == GL_DEPTH_STENCIL) if (internalformat == GL_DEPTH_STENCIL)
internalformat = GL_DEPTH24_STENCIL8; internalformat = GL_DEPTH24_STENCIL8;
)~~~");
if (webgl_version == 1) {
function_impl_generator.append(R"~~~(
#undef GL_DEPTH_STENCIL
#undef GL_DEPTH24_STENCIL8
)~~~"); )~~~");
} }