* shaderexp: first commit
* shaderexp: further improve error handling
* shaderexp: attribute ray_marching example
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
```
mach: found Metal backend on Discrete GPU adapter: Apple M1, Metal driver on macOS Version 12.1 (Build 21C52)
gpu: validation error: Attachment [TextureView] size (width: 640, height: 480) does not match the size of the other attachments (width: 1280, height: 960).
- While validating depthStencilAttachment.
- While encoding [CommandEncoder].BeginRenderPass([RenderPassDescriptor]).
```
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
add example based on webgpu-samples' instancedCube sample.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
The workflow uses a self hosted runner which is only available for
hexops/mach* repositories. Without this commit, whenever a fork of mach
or mach-* were pushed, it would queue an aarch64-mac job and then crash
after one day due to no machines being found.
Effectively a redo of hexops/mach#231 where I messed up the submodule update by accident.
Updates Dawn to latest revision as of 2022-04-18 c7b7b6def6
* Followed https://github.com/hexops/dawn/tree/main/mach#updating
* The UB issue should now actually get fixed (once CI builds the binary releases.)
* Verified example runs on macOS.
Helps hexops/mach#221
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
* Fixed ErrorCallback.init() alignment
* Fixed callbacks alignments
* Fixed more of the callback alignment problems
* Added checks for void Context in callback
In e673e6c5d4 I failed to update the submodule correctly, this
commit fixes that and actually updates us to the latest Dawn revision.
Helps hexops/mach#221
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
fixes alignment issues with getMappedRange, getConstMappedRange
Prior to this change `getMappedRange` and `getConstMappedRange` would not handle alignment to `COPY_BUFFER_ALIGNMENT` for users, and so invocation could result in an unhelpful error message:
```
thread 254201 panic: attempt to use null value
.../mach/gpu/src/NativeInstance.zig:1721:42: 0x480747
in .gpu.NativeInstance.buffer_vtable.getMappedRange (game)
return @ptrCast([*c]u8, range.?)[0..size];
^
```
To address this:
1. Ensure we always request a 4-byte aligned buffer when `createBuffer` is called.
2. Ensure we always map 4-byte aligned buffers.
Co-authored-by: d3m1gd <mach+d3m1gd@users.noreply.github.com>
Every library we want to link against is either provided by the Zig
toolchain or part of our SDK. Therefore, using pkg-config to link
against libraries on the host system is never what we intend.
To fix this, use linkSystemLibraryName() everywhere instead of
linkSystemLibrary() as the latter integrates with pkg-config while the
former just passes -lfoo to the zig compiler.
In combination with Zig commit 38d6e1d8a8 fixing an std.build bug,
this change fixes the linking of the necessary X11 libraries on my
x86_64 glibc based Void Linux system.