add WEBGL_debug_renderer_info

This commit is contained in:
Halil Durak
2025-11-13 15:40:59 +03:00
parent 73574dce52
commit 3c98e4f71e
2 changed files with 24 additions and 3 deletions

View File

@@ -105,9 +105,17 @@ pub const Extension = union(enum) {
/// Extension types.
pub const Type = struct {
pub const WEBGL_debug_renderer_info = packed struct(u64) {
UNMASKED_RENDERER_WEBGL: u32 = 0,
UNMASKED_VENDOR_WEBGL: u32 = 0,
pub const WEBGL_debug_renderer_info = struct {
pub const UNMASKED_VENDOR_WEBGL: u64 = 0x9245;
pub const UNMASKED_RENDERER_WEBGL: u64 = 0x9246;
pub fn get_UNMASKED_VENDOR_WEBGL() u64 {
return UNMASKED_VENDOR_WEBGL;
}
pub fn get_UNMASKED_RENDERER_WEBGL() u64 {
return UNMASKED_RENDERER_WEBGL;
}
};
};
};

View File

@@ -90,3 +90,16 @@
}
}
</script>
<script id=WebGLRenderingCanvas#getExtension>
// WEBGL_debug_renderer_info
{
const element = document.createElement("canvas");
const ctx = element.getContext("webgl");
const rendererInfo = ctx.getExtension("WEBGL_debug_renderer_info");
testing.expectEqual(true, rendererInfo instanceof WEBGL_debug_renderer_info);
testing.expectEqual(rendererInfo.UNMASKED_VENDOR_WEBGL, 0x9245);
testing.expectEqual(rendererInfo.UNMASKED_RENDERER_WEBGL, 0x9246);
}
</script>