Commit graph

68 commits

Author SHA1 Message Date
Stephen Gutekanst
ca028ea038 gpu: improve compatibility with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-19 20:44:11 -07:00
Stephen Gutekanst
381f2fe9c5 gpu: fix redeclaration of function parameter errors
This changed in the latest version of Zig to be more strict.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-19 12:34:08 -07:00
Stephen Gutekanst
358baf08e2 gpu: add Device.createShaderModuleWGSL helper
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 22:00:22 -07:00
Stephen Gutekanst
ae5bb78e09 gpu: correctly allow unsetting Device.setLoggingCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 21:34:32 -07:00
Stephen Gutekanst
2007542231 gpu: correctly allow unsetting Device.setUncapturedErrorCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 21:29:06 -07:00
Stephen Gutekanst
612c4420d6 gpu: correctly allow unsetting Device.setLostCallback
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 21:13:36 -07:00
Stephen Gutekanst
e4ee5e221b gpu: add type-safety for chaining dawn.CacheDeviceDescriptor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 20:43:41 -07:00
Stephen Gutekanst
7fa4075714 gpu: add type-safety for chaining dawn.TogglesDeviceDescriptor
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 20:42:45 -07:00
Stephen Gutekanst
03a9cbab9a gpu: add Device.Descriptor.init slice helper
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 17:35:18 -07:00
Stephen Gutekanst
f366244a9a gpu: add TODOs for slice helper candidates
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-16 10:46:49 -07:00
Stephen Gutekanst
58600faa0d gpu: make ctx parameters in callbacks always first
This matches the order of context parameters always being first in the Zig stdlib
with e.g. sorting and similar places where a context parameter exists.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
4429be4f5f gpu: correct alignment casts of callback helpers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
5d88387dac gpu: make setBindGroup methods use slice helper API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
b369635193 gpu: add Device.enumerateFeaturesOwned helper
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
726bdf3fba gpu: adopt new dawn.json policy for optionality of slice fields, default zero values
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
8bce5bc0a8 gpu: correct Device.default_queue default value
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
9f4a93cbef gpu: update to latest revision as of 2022-08-06
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
8a0d47b94b gpu: correct context pointer alignments
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
4ed932be0f gpu: simplify callback context types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
0228b50dba gpu: make Device.setDeviceLostCallback friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
dec1f08dd1 gpu: make Device.popErrorScope friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
2e611565b4 gpu: make Device.createRenderPipelineAsync friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
a452d03589 gpu: make Device.createComputePipelineAsync friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
29cd383f0e gpu: make Device.setLoggingCallback friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
6f2f7056b7 gpu: make Device.setUncapturedErrorCallback friendlier
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
be402d4b6d gpu: add TODOs about unsetting callbacks
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
a468c51ad4 gpu: correct nullability of userdata pointers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
cccfef52f9 gpu: internalize Texture types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
e9dcb49328 gpu: internalize SwapChain types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
23fb836ce8 gpu: internalize ShaderModule types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
b0776270d3 gpu: internalize Sampler types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
550c5fd55e gpu: internalize RenderPipeline types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
836c46cc6c gpu: internalize RenderBundleEncoder types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
b4830688bb gpu: internalize Queue types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
f4a6e08357 gpu: internalize QuerySet types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
1a57ae1c4d gpu: internalize PipelineLayout types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
09bbc8458a gpu: internalize ExternalTexture types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
0a69ef98fa gpu: internalize Device types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
b5bf0da50d gpu: internalize ComputePipeline types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
85fbe41a86 gpu: internalize CommandEncoder types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
9ba109f659 gpu: internalize Buffer types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
e10432834b gpu: internalize BindGroup types
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
e6f3d3c2f0 gpu: move callbacks to separate file
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
1ce40e1b46 gpu: fix tests
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
f59435f0b0 gpu: convert *opaque -> opaque for SwapChain
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
2c1a8240c5 gpu: convert *opaque -> opaque for ShaderModule
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
397f2eb1c9 gpu: convert *opaque -> opaque for RenderPipeline
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
0372525c91 gpu: convert *opaque -> opaque for RenderBundleEncoder
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
f73621cba2 gpu: convert *opaque -> opaque for Queue
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00
Stephen Gutekanst
c75d1d9e06 gpu: convert *opaque -> opaque for QuerySet
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-12 00:43:43 -07:00