Skip to content

Migrates to v0.14 #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Migrates to v0.14 #85

wants to merge 5 commits into from

Conversation

nicoabie
Copy link

@nicoabie nicoabie commented Apr 7, 2025

@Interrupt I'm learning zig and I found delve very nice so wanted to contribute

This is missing emscripten for lua natecraddock/ziglua#86
I'll ask again if they can add that flag so we don't need to use your fork anymore}

for changes in the shaders
https://floooh.github.io/2024/11/04/sokol-fall-2024-update.html

@@ -32,16 +32,17 @@ pub fn build(b: *std.Build) void {
});

const zmesh_lib = if (options.shared) blk: {
// TODO addLibrary
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addSharedLibrary is deprecated

@@ -211,7 +211,7 @@ pub const BufferView = extern struct {
size: usize,
stride: usize, // 0 == automatically determined by accessor
view_type: BufferViewType,
data: ?*anyopaque, // overrides buffer.data if present, filled by extensions
override_data: ?*anyopaque, // overrides buffer.data if present, filled by extensions
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new zig v0.14 didn't like that variable and function having the same name

.target = target,
.optimize = optimize,
.lang = .lua54,
.can_use_jmp = !target.result.isWasm(),
// .can_use_jmp = !target.result.cpu.arch.isWasm(),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be fixed to have the same funcitonality as with v0.13

@@ -527,15 +527,16 @@ pub fn sampleAnimation(comptime T: type, sampler: zmesh.io.zcgltf.AnimationSampl
}
}

// TODO check this
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to check this

@@ -17,7 +17,7 @@ pub const OrientedBoundingBox = struct {
min: Vec3,
max: Vec3,
center: Vec3,
transform: Mat4 = math.Mat4.identity,
transform_matrix: Mat4 = math.Mat4.identity,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new zig v0.14 didn't like that variable and function having the same name

@@ -561,9 +573,10 @@ pub const ShaderImpl = struct {
debug.info("Creating shader: {d}", .{graphics.next_shader_handle});
const shader = sg.makeShader(shader_desc);

// TODO check this
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const debug = @import("../debug.zig");

var enable_debug_logging = false;

pub var test_me: bool = true;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breaks findLibraryFunctions

@@ -0,0 +1 @@
Download sokol-shdc from https://github.com/floooh/sokol-tools-bin/tree/bindings-cleanup
Copy link
Owner

@Interrupt Interrupt Apr 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the bindings-cleanup branch explicitly required, hasn't this been merged in?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's the latest tag. I though it made sense to link to the specific version of the bin which generated the shaders.

checked with latest master https://github.com/floooh/sokol-tools-bin/tree/9b5a3e2b57fe9783ba4d1f3249059bc4720b592f and the output is the same

@nii236
Copy link

nii236 commented May 16, 2025

Hey @nicoabie I had a quick test of your fork and none of the examples run correctly when compiled for WASM. I'm brand new to zig so not sure how to fix:

image

@nicoabie
Copy link
Author

Hi! Thanks for reporting, I'll try to check it out in the following weeks. I'm new to zig as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants