Commit Graph

411 Commits

Author SHA1 Message Date
marc0246
00b65b1299
Enforce a consistent comment width (#2444)
* Enforce comment width

* `cargo +nightly fmt`

* Finishing touches
2024-01-05 02:14:49 -06:00
marc0246
cf31f4e059
Check formatting in CI (#2442)
* Check formatting in CI

* Fix existing fomatting inconsistencies

* Update PR template
2024-01-03 02:45:14 -06:00
Firestar99
7788847b04
Mesh shading example (#2437)
* mesh-shader-triangle example: copied from instancing example

* mesh-shader-triangle example: move shaders to separate files

* mesh-shader example: rename example

* mesh-shader example: implement mesh shader generating geometry

* mesh-shader example: fix instance data indexing partially, still has struct alignment issues

* mesh-shader example: fixed instance buffer alignment issues

* remove unnecessary things

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* mesh-shader example: cargo fmt

* mesh-shader example: rename shaders to end in .glsl

* mesh-shader example: added color out variable, docs

* mesh-shader example: rename shader again

* mesh-shader example: reformat shader code

* mesh-shader example: cargo fmt with nightly

---------

Co-authored-by: Firestar99 <4696087-firestar99@users.noreply.gitlab.com>
Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2024-01-02 14:46:27 +01:00
Rua
bef7b94aef
Fix warnings for Rust 1.75 (#2436) 2023-12-28 20:32:13 +01:00
Rua
289ec102e0
Document shader safety requirements, make draw/dispatch unsafe (#2429)
* Document shader safety requirements, make draw/dispatch unsafe

* Extra docs

* Doctests

* Max index value

* Small change

* Update vulkano/src/command_buffer/mod.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/command_buffer/mod.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-12-25 04:01:16 +01:00
marc0246
00bb62171f
Merge PrimaryAutoCommandBuffer and SecondaryAutoCommandBuffer into CommandBuffer (#2425)
* Merge `PrimaryAutoCommandBuffer` and `SecondaryAutoCommandBuffer`

* Fix docs

* Fix examples

* Move command buffer creation validation to `RawRecordingCommandBuffer`

* Fix `RawRecordingCommandBuffer::end` being safe to call

* Remove unsafe block inside `RawRecordingCommandBuffer::end`
2023-12-20 13:04:01 +01:00
Yuxuan Shui
22276cdb8a
Support creating buffers and images that are not backed by vulkano-managed memory (#2413)
* Support creating images that are not backed by vulkano managed memory

* Support creating buffers that are not backed by vulkano managed memory

* Add a way to create a RawImage that doesn't own the inner image

* Add a way to create a RawBuffer that doesn't own the inner buffer

* Apply suggestions from code review

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* fixup! Support creating images that are not backed by vulkano managed memory

* fixup! Support creating buffers that are not backed by vulkano managed memory

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-12-18 08:09:50 +01:00
marc0246
cee21d3f05
Rename command buffer types (#2421)
* Rename `UnsafeCommandBuffer[Builder]`

* Rename `AutoCommandBufferBuilder`

* `finish` -> `end`

* Clarify docs

* `CommandRecorder` -> `RecordingCommandBuffer`
2023-12-09 12:24:52 +01:00
Rua
fa15e53820
Validate the fragment output against color blend state (#2420)
* Validate the fragment output against color blend state

* Remove old methods from render/subpass that are no longer needed

* Better fix

* Update vulkano/src/macros.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/pipeline/graphics/mod.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-12-07 18:13:08 +01:00
marc0246
4cd3b74f14
Remove the command buffer traits (#2419)
* Remove command buffer traits

* Fix docs

* Fix examples
2023-12-06 17:23:24 +01:00
ilyas taouaou
e68eddd5f1
Add vulkano macros feature to examples that needs it (#2408)
* Add vulkano macros feature to example that needs it

* Add Buffer::pair_from_iter to make it one step easier for staging data to the device

* Revert "Add Buffer::pair_from_iter to make it one step easier for staging data to the device"

This reverts commit a30b5c0925.
2023-11-16 17:07:28 +01:00
marc0246
43e2db0dbd
Command buffer allocator API 2.0 (#2403)
* Make `CommandBufferAllocator` object-safe, remove the generics

* Fix tests

* Fix examples

* Remove the panic

* Remove outdated docs

* Document `Send + Sync` impl of `UnsafeCommandBuffer`
2023-11-14 17:57:43 +01:00
marc0246
63a53f1b93
Descriptor set revamp (#2404)
* Descriptor set revamp

* Fix tests

* Fix examples

* Add `DescriptorSet::update_unchecked`

* Fix docs

* Add `Debug` impls

* Add `DescriptorSet::update_by_ref[_unchecked]`

* Rename `UnsafeDescriptorSet` to `RawDescriptorSet`

* Fix outdated docs for `DescriptorPool`
2023-11-12 17:17:37 +01:00
marc0246
bbd1de36ef
Descriptor set allocator API 2.0 (#2400)
* Make `DescriptorSetAllocator` object-safe, remove the generics

* Fix tests

* Fix examples

* Fix docs

* Avoid panics in `deallocate`

* Typo

* Clarify docs

* Clarify safety preconditions of `allocate`

* Remove unnecessary `Arc` clone

* Tidy up a little

* Debug assert
2023-11-12 15:10:22 +01:00
marc0246
34736a675a
Remove license notices from source files (#2401)
* Remove license notices from source files

* Add license notices for rangemap
2023-11-08 13:49:49 +01:00
marc0246
8bb811940a
Prevent examples from being tested/benchmarked/documented (#2396) 2023-11-05 11:24:21 +01:00
marc0246
af57608ac5
Unify workspaces (#2391) 2023-10-31 19:15:03 +01:00
marc0246
4a77d39b85
Update dependencies (#2385)
* Update winit

* Update raw-window-handle

* Update syn

* Remove vulkano-win from the workspace
2023-10-31 18:47:17 +01:00
marc0246
1e9128795f
Workspace dependencies (#2381)
* Use workspace dependencies

* Update CI workflow to account for the two workspaces

* Make the tables in the root workspace a bit nicer to look at

* Use workspace package version

* Remove workspace package version

* Make winit a workspace dependency as well
2023-10-29 22:42:00 -05:00
marc0246
4c515a81cb
Improve the examples' directory structure (#2375)
* Make each example its own workspace member

* Fix runtime-shader example

* Fix shader-include example

* Fix teapot example

* Fix `run_all.sh`

* Fix output files getting saved in cwd

* Fix spelling for examples readme filename

* Remove wrong leftover dependencies for gl-interop

* Fix pipeline-cache example

* Clearer .gitignore

* Help cargo be less useless
2023-10-29 18:46:14 +01:00
Rua
def21843fc
Partial validation of queue commands (#2373)
* Move resource tracking/locking back from Queue to futures

* Add partially validated `submit` command

* Add partially validated `present` command

* More safety docs

* Small doc change

* Add SemaphorePresentInfo

* Put safety docs in the semaphore/fence modules instead

* More fence and semaphore docs

* Re-add missing imports

* Remove state tracking from Fence

* Remove state tracking from Semaphore
2023-10-29 01:40:28 +02:00
marc0246
94f0f8cc80
#2369 fixes (#2371) 2023-10-25 04:01:30 -05:00
marc0246
ac2a83b769
Add a StandardDescriptorSetAllocatorCreateInfo (#2366)
* Add `StandardDescriptorSetAllocatorCreateInfo`

* Fix tests and examples
2023-10-24 16:23:17 +02:00
Rua
444c88dfca
Use separate samplers and sampled images in the examples (#2354)
* Use separate samplers and sampled images in the examples

* Update examples/src/bin/push-descriptors/main.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-10-08 14:10:19 +02:00
Rua
0fed9bbc7f
Make dynamic state future-proof and more Vulkan-y (#2348)
* Make dynamic state future-proof and more Vulkan-y

* Additional fixes

* Extra docs

* Oops

* Derp!

* Review fixes
2023-10-07 16:46:03 +02:00
Rua
3c49541bc3
Apply specialization to shader reflection (#2329)
* Apply specialization to shader reflection

* Remove redundant method

* Remove all the SpecId decorations too

* Don't unnecessarily collect the instructions

* Replace decoration groups with individual decorations

* Rename with_specialization

* Missed renames

* Remove the Arcs
2023-09-14 13:19:25 +02:00
marc0246
5578bf30da
Memory (sub)allocation API 2.0 (#2316)
* Excommunicate `PoolAllocator`

* Switch to manual deallocation

* Move `ResourceMemory` away from the `suballocator` module

* Remove `SuballocatorError::BlockSizeExceeded`

* Fix examples

* Fix atom size

* Address safety TODOs

* Nice English you got there bro
2023-09-03 13:09:07 +02:00
Rua
b3dbca4001
Rust 1.72 fixes (#2302) 2023-08-25 03:01:45 +02:00
marc0246
de7b6a91a0
Merge MappedDeviceMemory into DeviceMemory, make MemoryAlloc reuse the logic (#2300)
* Merge `MappedDeviceMemory` into `DeviceMemory`

* Fix soundness and utilize new `DeviceMemory` methods in `MemoryAlloc`

* Fix oopsies

* `Sync`ness

* `#[inline]`

* Big oopsie

* Language

* Sanity check for the deprecated stuff

* Full `khr_map_memory2`

* Missed trait impls

* `MemoryUnmapInfo::validate`

* Document mapping behavior of `GenericMemoryAllocator`

* Validate flags

* Update vulkano/src/memory/allocator/mod.rs

Co-authored-by: Rua <ruawhitepaw@gmail.com>

* Remove flags

* Errors

---------

Co-authored-by: Rua <ruawhitepaw@gmail.com>
2023-08-24 16:46:38 +02:00
Rua
5c67f85c99
Improve debug messenger, remove second Instance constructor (#2275)
* Improve debug messenger, remove second `Instance` constructor

* #2242

* Doctest fix

* Take Arc out

* DeviceOwnedVulkanObject

* Update vulkano/src/device/mod.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/instance/debug.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Fixes

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-08-05 20:57:37 +02:00
Rua
cf8e8c3732
Some shader fixes and improvements (#2280) 2023-08-05 16:47:17 +02:00
Rua
b7c79acb77
ValidationError-ify futures (#2271)
* ValidationError-ify sync primitives

* Fix Windows error

* Return timeouts as errors instead

* Simplify a bit

* ValidationError-ify futures

* Update vulkano/src/sync/future/semaphore_signal.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/swapchain/acquire_present.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/sync/future/fence_signal.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-08-04 22:02:45 +02:00
Rua
fefb3b8733
ValidationError-ify queries (#2270)
* ValidationError-ify commands, add some validation to `UnsafeCommandBufferBuilder`

* Use `SubpassBeginInfo` for the triangle example

* ValidationError-ify queries
2023-08-04 21:34:43 +02:00
Rua
d0144c2d98
ValidationError-ify commands, add some validation to UnsafeCommandBufferBuilder (#2266)
* ValidationError-ify commands, add some validation to `UnsafeCommandBufferBuilder`

* Use `SubpassBeginInfo` for the triangle example
2023-08-04 20:55:16 +02:00
Rua
17dbd1ac2c
ValidationError-ify ShaderModule (#2268)
* ValidationError-ify `ShaderModule`

* Typo

* Remove leftover comments

* slice, not Iterator

* Update vulkano/src/shader/mod.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/shader/mod.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-07-24 22:21:05 +02:00
marc0246
2c0067067c
Switch to a more expressive way to specify memory usage (#2264)
* Switch to a more expressive way to specify memory usage

* Fix tests

* Fix examples

* Forgot to adjust `SubbufferAllocatorCreateInfo::location_preference`s

* Oopsie

* Redo all of it

* Oopsie
2023-07-19 11:11:17 +02:00
Rua
0f5e298f29
Add Format::UNDEFINED (#2262)
* Add `Format::UNDEFINED`

* Use `iter::once`
2023-07-14 16:44:34 +02:00
marc0246
6dc8e64ac7
Fix suboptimal MemoryUsage for download in examples (#2260) 2023-07-10 22:30:27 +02:00
Rua
3a5b8a4432
ValidationError-ify images and image views, fix DRM format modifiers (#2252)
* ValidationError-ify images and image views, fix DRM format modifiers

* Update examples/src/bin/triangle-v1_3.rs

Co-authored-by: Austin Johnson <me@austinj.me>

* Update examples/src/bin/triangle.rs

Co-authored-by: Austin Johnson <me@austinj.me>

---------

Co-authored-by: Austin Johnson <me@austinj.me>
2023-07-06 03:52:11 -05:00
marc0246
7a8fec9e75
Unify all image types (#2247)
* Move `Image` to the `image` module

* Unify all image types

* Fix tests

* Fix examples

* Oopsie

* Don't re-export `ImageViewType`

* Fix docs

* Fix gl-interop example
2023-07-03 22:37:29 +02:00
Rua
204811de19
ValidationError-ify samplers (#2245)
* ValidationError-ify samplers

* Fix doctests
2023-06-30 11:21:18 +02:00
Rua
da09477d01
ValidationError-ify Surface and Swapchain (#2236)
* Add `RequiresAllOf`, automatically enable required extensions and features

* Add more missing backticks and backslashes to error messages

* Use updated VUIDs that require `acceleration_structure`

* ValidationError-ify `Surface` and `Swapchain`

* Update vulkano/src/lib.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/lib.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Don't draw if the window has zero size

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-06-26 11:17:53 +02:00
Rua
69677346d2
ValidationError-ify GraphicsPipeline (#2234)
* Add `RequiresAllOf`, automatically enable required extensions and features

* Add more missing backticks and backslashes to error messages

* Use updated VUIDs that require `acceleration_structure`

* ValidationError-ify `GraphicsPipeline`

* Update vulkano/src/lib.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Update vulkano/src/lib.rs

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-06-25 20:08:27 +02:00
Rua
9fd6e0ff45
Add support for khr_device_group_creation (#2227)
* Add support for `khr_device_group_creation`

* Fix vulkano-utils

* Apply fixes
2023-06-17 20:18:48 +00:00
Rua
45f69c17a2
Add support for two render pass extensions (#2223)
* Reorganise render pass objects, add support for some extensions

* Handle stencil initial/final layout in the macro

* This was promoted to 1.2, not 1.1

* Doctests again...

* Missing docs

* Fix bad validation

* Convert Framebuffer to ValidationError while we're at it

* FramebufferCreateFlags

* Make render pass creation more like Vulkan again

* TODO for depth_resolve_mode and stencil_resolve_mode in the macro

* Depth/stencil resolve modes

* Missed validation

* Forgot some testing code...

* msaa-renderpass docs

* Doc fixes

* Add missing backslashes
2023-06-17 19:01:50 +00:00
Arnoldas Rauba
409b620217
Fixed some examples freezing on fullscreen mode on MacOS for #2208 (#2221)
* Updated  #2208

This commit solves the problem of freezing when going fullscreen for MacOS.
It was caused because winit may behave unexpectedly when using
run_return. Winit crate generally discourages the use of that
(see: <https://docs.rs/winit/latest/winit/platform/run_return/trait.EventLoopExtRunReturn.html#tymethod.run_return>).

NOTE. This commit only solves the problem for `interactive_fractal`
binary, but not the `multi_window_game_of_life` binary.

* Some display servers (like X.org) are not redrawing for every frame.

* Fixed the same bug for  example binary.

* Remove ControlFlow::Poll (it is the default anyway) in interactive_fractal

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

* Remove ControlFlow::Poll (it is the default anyway) in multi_window_game_of_life

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-06-04 09:15:21 +02:00
Rua
3e7ac8e0d4
Add support for descriptor set copies and other things (#2219)
* Add support for descriptor set copies and other things

* Typo

* Errors

* Doctest fix

* Add missing non_exhaustive
2023-06-03 14:56:27 +02:00
Gábor Gyebnár
cd9f081e3a
Fixes all examples to use at least two swapchain buffers (#2218)
* Fixes all examples to use at least two swapchain buffers.

* Fix build error
2023-06-02 22:01:38 +02:00
marc0246
08c245d7c5
Remove vulkano-win dependency from examples (#2209) 2023-05-18 14:07:30 +02:00
Rua
6816292750
Merge SyncCommandBuffer into *AutoCommandBuffer (#2207)
* Merge `SyncCommandBuffer` into `*AutoCommandBuffer`

* Commands take containers directly instead of iterators

* Use allocator as the type parameter for built command buffers

* Don't make `UnsafeCommandBuffer` keep objects alive

* Re-add impl for Arc

* Fixes

* Doc fix
2023-05-18 13:03:37 +02:00