diff options
| author | Qwerasd <qwerasd205@users.noreply.github.com> | 2025-06-25 10:53:42 -0600 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-06-25 16:27:23 -0400 |
| commit | 5cb175ff63a93c5ed1fcc80dd0976d4ee6614db0 (patch) | |
| tree | fe541035debaa12cc58a4e5a42a7bedd6df33965 /pkg/opengl | |
| parent | da46a47726f39b5ca564d49ec397d76d4f1725ff (diff) | |
renderer/OpenGL: use compressed texture formats for images
BPTC is required to be available OpenGL >= 4.2 and our minimum is 4.3 so
this is safe in terms of support. I tested briefly in a VM and didn't
encounter any problems so this should just be a complete win.
(Note: texture data is already automatically compressed on Metal)
Diffstat (limited to 'pkg/opengl')
| -rw-r--r-- | pkg/opengl/Texture.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/opengl/Texture.zig b/pkg/opengl/Texture.zig index 4a1d61433..2c8e05eff 100644 --- a/pkg/opengl/Texture.zig +++ b/pkg/opengl/Texture.zig @@ -74,6 +74,9 @@ pub const InternalFormat = enum(c_int) { srgb = c.GL_SRGB8, srgba = c.GL_SRGB8_ALPHA8, + rgba_compressed = c.GL_COMPRESSED_RGBA_BPTC_UNORM, + srgba_compressed = c.GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM, + // There are so many more that I haven't filled in. _, }; @@ -126,7 +129,6 @@ pub const Binding = struct { internal_format: InternalFormat, width: c.GLsizei, height: c.GLsizei, - border: c.GLint, format: Format, typ: DataType, data: ?*const anyopaque, @@ -137,7 +139,7 @@ pub const Binding = struct { @intFromEnum(internal_format), width, height, - border, + 0, @intFromEnum(format), @intFromEnum(typ), data, |
