267: Use extend_from_slice instead of copy_from_slice r=kvark a=kocsis1david
`copy_from_slice` gives an error because it expects the lengths to be the same.
Co-authored-by: David <kocsis1david@windowslive.com>
264: update README.md r=kvark a=Napokue
Changes:
- Add supported platforms table
- Remove example docs here, and referencing the user to the wiki
Co-authored-by: Timo de Kort <dekort.timo@gmail.com>
261: streamline Makefile r=kvark a=Napokue
Changes:
- Streamlining the Make commands to make it look better
- Introduced two new variables: `WILDCARD_WGPU_NATIVE` & `WILDCARD_WGPU_NATIVE_AND_REMOTE` to reduce duplicate code. Will continue to reduce duplicate after my compute example is merged, to avoid unnecessary merge conflicts
Maybe I am not too familiar with the concept FFI, but wouldn't it be easier to understand that we just generate headers and not foreign function interfaces. Basically the same, but the latter one sounds a lot more complex. We want to reach as much as possible people, so maybe renaming this would be beneficial?
So I was thinking to have the commands: `header-wgpu` and `header-wgpu-remote`, instead of `ffi-wgpu` and `ffi-wgpu-remote`.
Co-authored-by: Timo de Kort <dekort.timo@gmail.com>
258: Run-time lock protection against double root r=grovesNL a=kvark
Fixes https://github.com/gfx-rs/wgpu-rs/issues/42
cc @paulkernfeld
We didn't handle a case where the root locking token would get dropped (while some children are borrowed), and a new one is created. This was the case in `wgpu_device_poll`, which ended up trying to unmap the buffers.
This PR brings a relatively simple run-time check for this. It could *probably* be done at the type level, but I'm going to leave it for any follow ups (help is welcome!), because:
1. we'll still have a run-time check for the simple case where 2 or more root tokens are created
2. I spent 20 minutes trying and wasn't able to get this going
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
38: Add an example showing how to capture a render r=kvark a=paulkernfeld
I had wanted to use wgpu-rs to generate `.png` images rather than displaying to the screen, so I coded up this prototype as an example to others who might want to do something similar.
Possible changes:
- Create an actual `.png` or other image
- Convert this into a unit test
I'm happy to make other modifications to this as well.
Co-authored-by: Paul Kernfeld <paulkernfeld@gmail.com>
9: Add structs and enums for ID3D12Heap r=msiglreith a=DethRaid
I've added the structs and enums needed to create an `ID3D12Heap`. I've also added the method `create_heap` to `Device`, and and added the module imports and reexports to the appropriate places
The weird thing here is `heap::Flags`. Thing is, D3D12 uses the value 0 for two of the enum constants in `D3D12_HEAP_FLAGS`. Rust does not allow the same value to be used by multiple enum constants (that I know of). I made an enum without any useful values, then gave it constants with the values from `D3D12_HEAP_FLAGS`. This lets my code compile, and the syntax to use the enum is the same, but the compiler complains about capitalization and I don't really like it. I'd welcome any ideas about a better way to implement this
Co-authored-by: David Dubois <dexcelstraun7@gmail.com>
`D3D12_HEAP_TYPE, D3D12_CPU_PAGE_PROPERTY, D3D12_MEMORY_POOL, D3D12_HEAP_FLAGS, D3D12_HEAP_PROPERTIES, and D3D12_HEAP_DESC
ID3D12Heap
Wrap ID3D12Device::CreateHeap
Made a tricky enum because DX12 doesn't follow Rust's rules
bump version to 0.2.0
Use bitflags for heap::Flags
Fix typo
Another typo fix
254: Rebind with proper dynamic offsets r=grovesNL a=kvark
~~The change fixed a bug found by @kocsis1david : when we re-bind the higher bind groups we aren't currently considering their dynamic offsets.~
Fixes#255
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
40: Update running an example documentation r=kvark a=Napokue
- Removed link to gfx getting started
- Created our own getting started (with examples)
- Updated syntax
Motivation: I always forget how to run the examples, gfx getting started is not the same as the wgpu-rs one. So I found the correct usage of the syntax to run examples. I am noticing in the Gitter channel that many people are struggling with running the examples, maybe this will clear it up a little.
This is the beginning, I will continue to expand the documentation in the future.
Co-authored-by: Timo de Kort <dekort.timo@gmail.com>
Disable vsync
Revert accidential hardcode of num_frames
Make the PresentMode configurable
Adapt examples
+ adjust style according to @kvrak
Adher to @kvarks wishes for style.
Examples build.
Fix unnecessary ampersand.
32: Add conversion matrix from OpenGL to wgpu r=kvark a=dragly
The matrices in the examples are given in an OpenGL-like coordinate system,
while a Vulkan-like coordinate system is used by wgpu. This was previously
partially corrected in the shader and by flipping the up axis of the camera,
but left the x-axis mirrored in the final result.
This change adds a conversion matrix to framework.rs that can be used
to convert from OpenGL to wgpu. This also allows us to set the
winding-order to counter-clockwise, which matches the ordering in the data.
Co-authored-by: Svenn-Arne Dragly <dragly@cognite.com>
Co-authored-by: Dzmitry Malyshau <dmalyshau@mozilla.com>