From 9eb0e23a6504a1e9de215b983687999c9ce285e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20=C3=85stholm?= Date: Mon, 6 May 2024 22:47:16 +0200 Subject: [PATCH] Bump version to 0.2.2 --- README.md | 12 ++++++++---- zigglgen-example/build.zig.zon | 8 ++++---- zigglgen-example/gles3.zig | 8 ++++---- zigglgen/api_registry.zig | 22 ++++++++++++++++++++-- zigglgen/build.zig | 1 + zigglgen/build.zig.zon | 2 +- zigglgen/generator.zig | 11 ++++------- zigglgen/generator_options.zig | 2 +- 8 files changed, 43 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 490ddad..ef71e11 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,18 @@ The only Zig OpenGL binding generator you need. ## Installation and usage -zigglgen requires a recent-ish master build of the Zig compiler. The oldest known supported version is -`0.12.0-dev.2063+804cee3b9` (identical to [`2024.1.0-mach`](https://machengine.org/about/nominated-zig/#202410-mach)), -but more recent versions may also work. +zigglgen officially supports the following versions of the Zig compiler: + +- `0.12.0-dev.3180+83e578a18`/[`2024.3.0-mach`](https://machengine.org/about/nominated-zig/#202410-mach) +- `0.12.0` +- master (last tested with `0.13.0-dev.73+db890dbae`) + +Older or more recent versions of the compiler are not guaranteed to be compatible. 1\. Run `zig fetch` to add the zigglgen package to your `build.zig.zon` manifest: ```sh -zig fetch https://github.com/castholm/zigglgen/releases/download/v0.2.1/zigglgen.tar.gz --save +zig fetch https://github.com/castholm/zigglgen/releases/download/v0.2.2/zigglgen.tar.gz --save ``` 2\. Generate a set of OpenGL bindings in your `build.zig` build script: diff --git a/zigglgen-example/build.zig.zon b/zigglgen-example/build.zig.zon index ee3dd27..0cd30c6 100644 --- a/zigglgen-example/build.zig.zon +++ b/zigglgen-example/build.zig.zon @@ -3,12 +3,12 @@ .version = "0.0.0", .dependencies = .{ .@"mach-glfw" = .{ - .url = "https://pkg.machengine.org/mach-glfw/63da35e57c3695a787b927e69e4140eb74ffc234.tar.gz", - .hash = "1220fda87b59df6353864651cdd3943f1159d8d517a45cd67bed493fe6c0a0c78c17", + .url = "https://pkg.machengine.org/mach-glfw/42fe7ee494d36bee8a82c1563c291d8314a41823.tar.gz", + .hash = "1220a72c54b4a3674a1e5a907ac6ea33d1868681f187f5a07f3cfb562ff7cf2c63e0", }, .zigglgen = .{ - .url = "https://github.com/castholm/zigglgen/releases/download/v0.2.1/zigglgen.tar.gz", - .hash = "122059d1ff6787eedb40771eabb0f04d04fe299bd1bae7b216c4a9d894719c2a148a", + .url = "https://github.com/castholm/zigglgen/releases/download/v0.2.2/zigglgen.tar.gz", + .hash = "1220b0b1d61dfe8a244a3928b20cfa596e252656cca90120c26661898986ce3d1f82", }, }, .paths = .{ diff --git a/zigglgen-example/gles3.zig b/zigglgen-example/gles3.zig index a7c6bad..4e3c8a2 100644 --- a/zigglgen-example/gles3.zig +++ b/zigglgen-example/gles3.zig @@ -1,7 +1,7 @@ //! Bindings for OpenGL ES 3.0 generated by zigglgen. -// OpenGL XML API Registry revision: 3530768138c5ba3dfbb2c43c830493f632f7ea33 -// zigglgen version: 0.2.1 +// OpenGL XML API Registry revision: 4265ce1a6e40abdab98f5f2e11365b59f5ef04bc +// zigglgen version: 0.2.2 // Example usage: // @@ -1765,7 +1765,7 @@ pub const ProcTable = struct { switch (@typeInfo(field_info.type)) { .Pointer => |ptr_info| switch (@typeInfo(ptr_info.child)) { .Fn => { - success &= @intFromBool(procs.initCommand(loader, field_info.name ++ "")); + success &= @intFromBool(procs.initCommand(loader, field_info.name)); }, else => comptime unreachable, }, @@ -1818,7 +1818,7 @@ pub const ProcTable = struct { fn initExtension(procs: *ProcTable, comptime name: [:0]const u8) bool { var count: c_int = 0; - procs.GetIntegerv(NUM_EXTENSIONS, @ptrCast(&count)); + procs.GetIntegerv(NUM_EXTENSIONS, (&count)[0..1]); if (count < 0) return false; var i: c_uint = 0; while (i < @as(c_uint, @intCast(count))) : (i += 1) { diff --git a/zigglgen/api_registry.zig b/zigglgen/api_registry.zig index dd9bc83..0ff796d 100644 --- a/zigglgen/api_registry.zig +++ b/zigglgen/api_registry.zig @@ -1,7 +1,7 @@ // This file was generated by 'updateApiRegistry.ps1'. -// OpenGL XML API Registry revision: 3530768138c5ba3dfbb2c43c830493f632f7ea33 +// OpenGL XML API Registry revision: 4265ce1a6e40abdab98f5f2e11365b59f5ef04bc -pub const revision = "3530768138c5ba3dfbb2c43c830493f632f7ea33"; +pub const revision = "4265ce1a6e40abdab98f5f2e11365b59f5ef04bc"; pub const Type = struct { name: Name, @@ -5072,6 +5072,7 @@ pub const Constant = struct { TEXTURE_BUFFER_SIZE, TEXTURE_BUFFER_SIZE_EXT, TEXTURE_BUFFER_SIZE_OES, + TEXTURE_CBCR_DEGAMMA_QCOM, TEXTURE_CLIPMAP_CENTER_SGIX, TEXTURE_CLIPMAP_DEPTH_SGIX, TEXTURE_CLIPMAP_FRAME_SGIX, @@ -5330,6 +5331,7 @@ pub const Constant = struct { TEXTURE_WRAP_R_OES, TEXTURE_WRAP_S, TEXTURE_WRAP_T, + TEXTURE_Y_DEGAMMA_QCOM, TEXTURE0, TEXTURE0_ARB, TEXTURE1, @@ -7870,6 +7872,7 @@ pub const Command = struct { NamedFramebufferTextureFaceEXT, NamedFramebufferTextureLayer, NamedFramebufferTextureLayerEXT, + NamedFramebufferTextureMultiviewOVR, NamedProgramLocalParameter4dEXT, NamedProgramLocalParameter4dvEXT, NamedProgramLocalParameter4fEXT, @@ -15315,6 +15318,7 @@ pub const constants = [_]Constant{ .{ .name = .TEXTURE_BUFFER_SIZE, .value = 37278 }, .{ .name = .TEXTURE_BUFFER_SIZE_EXT, .value = 37278 }, .{ .name = .TEXTURE_BUFFER_SIZE_OES, .value = 37278 }, + .{ .name = .TEXTURE_CBCR_DEGAMMA_QCOM, .value = 38673 }, .{ .name = .TEXTURE_CLIPMAP_CENTER_SGIX, .value = 33137 }, .{ .name = .TEXTURE_CLIPMAP_DEPTH_SGIX, .value = 33142 }, .{ .name = .TEXTURE_CLIPMAP_FRAME_SGIX, .value = 33138 }, @@ -15573,6 +15577,7 @@ pub const constants = [_]Constant{ .{ .name = .TEXTURE_WRAP_R_OES, .value = 32882 }, .{ .name = .TEXTURE_WRAP_S, .value = 10242 }, .{ .name = .TEXTURE_WRAP_T, .value = 10243 }, + .{ .name = .TEXTURE_Y_DEGAMMA_QCOM, .value = 38672 }, .{ .name = .TEXTURE0, .value = 33984 }, .{ .name = .TEXTURE0_ARB, .value = 33984 }, .{ .name = .TEXTURE1, .value = 33985 }, @@ -33124,6 +33129,18 @@ pub const commands = [_]Command{ }, .return_type_expr = &.{.void}, }, + .{ + .name = .NamedFramebufferTextureMultiviewOVR, + .params = &.{ + .{ .name = "framebuffer", .type_expr = &.{.{ .type = .uint }} }, + .{ .name = "attachment", .type_expr = &.{.{ .type = .@"enum" }} }, + .{ .name = "texture", .type_expr = &.{.{ .type = .uint }} }, + .{ .name = "level", .type_expr = &.{.{ .type = .int }} }, + .{ .name = "baseViewIndex", .type_expr = &.{.{ .type = .int }} }, + .{ .name = "numViews", .type_expr = &.{.{ .type = .sizei }} }, + }, + .return_type_expr = &.{.void}, + }, .{ .name = .NamedProgramLocalParameter4dEXT, .params = &.{ @@ -65104,6 +65121,7 @@ pub const extensions = [_]Extension{ .{ .name = .{ .constant = .MAX_VIEWS_OVR } }, .{ .name = .{ .constant = .FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR } }, .{ .name = .{ .command = .FramebufferTextureMultiviewOVR } }, + .{ .name = .{ .command = .NamedFramebufferTextureMultiviewOVR } }, }, }, .{ diff --git a/zigglgen/build.zig b/zigglgen/build.zig index 5315ea4..fbe3d53 100644 --- a/zigglgen/build.zig +++ b/zigglgen/build.zig @@ -47,6 +47,7 @@ pub fn generateBindingsSourceFile(b: *std.Build, options: GeneratorOptions) std. return output; } +// TODO 2024.5.0-mach: Replace with 'b.dependencyFromBuildZig'. fn thisDependency(b: *std.Build, args: anytype) *std.Build.Dependency { find_dep: { const all_pkgs = @import("root").dependencies.packages; diff --git a/zigglgen/build.zig.zon b/zigglgen/build.zig.zon index cbf5bba..194fd9b 100644 --- a/zigglgen/build.zig.zon +++ b/zigglgen/build.zig.zon @@ -1,6 +1,6 @@ .{ .name = "zigglgen", - .version = "0.2.1", + .version = "0.2.2", .minimum_zig_version = "0.12.0-dev", .paths = .{ "LICENSE.md", diff --git a/zigglgen/generator.zig b/zigglgen/generator.zig index c3a70a1..6ee516e 100644 --- a/zigglgen/generator.zig +++ b/zigglgen/generator.zig @@ -402,7 +402,7 @@ fn renderCode( \\//! Bindings for {[api_pretty]s} {[version_major]d}.{[version_minor]d}{[sp_profile_pretty]s} generated by zigglgen. \\ \\// OpenGL XML API Registry revision: {[registry_revision]s} - \\// zigglgen version: 0.2.1 + \\// zigglgen version: 0.2.2 \\ \\// Example usage: \\// @@ -626,9 +626,7 @@ fn renderCode( \\ switch (@typeInfo(field_info.type)) { \\ .Pointer => |ptr_info| switch (@typeInfo(ptr_info.child)) { \\ .Fn => { - // TODO 2024.3.0-mach - //\\ success &= @intFromBool(procs.initCommand(loader, field_info.name)); - \\ success &= @intFromBool(procs.initCommand(loader, field_info.name ++ "")); + \\ success &= @intFromBool(procs.initCommand(loader, field_info.name)); \\ }, \\ else => comptime unreachable, \\ }, @@ -734,9 +732,7 @@ fn renderCode( // under the Core profile. try writer.writeAll( \\ var count: c_int = 0; - // TODO 2024.3.0-mach - //\\ procs.GetIntegerv(NUM_EXTENSIONS, (&count)[0..1]); - \\ procs.GetIntegerv(NUM_EXTENSIONS, @ptrCast(&count)); + \\ procs.GetIntegerv(NUM_EXTENSIONS, (&count)[0..1]); \\ if (count < 0) return false; \\ var i: c_uint = 0; \\ while (i < @as(c_uint, @intCast(count))) : (i += 1) { @@ -795,6 +791,7 @@ fn renderCode( ); } +// TODO 2024.5.0-mach: Remove 'formatDeclId' and audit uses of 'fmtId'. const fmtId = std.zig.fmtId; fn fmtDeclId(bytes: []const u8) std.fmt.Formatter(formatDeclId) { diff --git a/zigglgen/generator_options.zig b/zigglgen/generator_options.zig index 7cd60ca..fd1684c 100644 --- a/zigglgen/generator_options.zig +++ b/zigglgen/generator_options.zig @@ -1,5 +1,5 @@ // This file was generated by 'updateApiRegistry.ps1'. -// OpenGL XML API Registry revision: 3530768138c5ba3dfbb2c43c830493f632f7ea33 +// OpenGL XML API Registry revision: 4265ce1a6e40abdab98f5f2e11365b59f5ef04bc pub const Api = enum { gl, gles, glsc };