Commit Graph

417 Commits

Author SHA1 Message Date
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
Rua
7b8225f364
Fix warnings from earlier PRs (#2206) 2023-05-12 20:26:49 +02:00
marc0246
56e6871da0
Add async update example (#2202)
* Add async update example

* Add generation

* Minor rearrange

* One more note
2023-05-12 09:53:36 +02:00
marc0246
77fa2bbfcc
Add Surface::from_window[_ref], deprecate vulkano-win (#2204)
* Add `Surface::from_window[_ref]`

* Add `Surface::required_extensions`

* Deprecate vulkano-win

* Fix SPIR-V word alignment in tests

* Fix oopsie

* Remove pointer transmute
2023-05-12 09:52:20 +02:00
marc0246
11ce974c0a
Fix attributions 2023-05-07 15:05:24 +02:00
Rua
93babbebae
Replace ImageAccess::descriptor_layouts() (#2197)
* Replace `ImageAccess::descriptor_layouts()`

* Add `WriteDescriptorSet` constructors for image views with layout

* Replace `descriptor_layouts` for real

* Small changes

* More improvements
2023-05-03 17:19:28 +02:00
dsentinel
7741e00348
Fix reading from life_out output buffer instead of life_in. (#2198)
Co-authored-by: lloyd <digitalsentinel@gmail.com>
2023-05-03 11:05:28 +02:00
Rua
b320dd26c3
Add CreateInfo for pipelines, require explicit pipeline layout creation (#2186)
* Add CreateInfo for pipelines, require explicit pipeline layout creation

* Doc fixes

* Add missing unsafe

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

* Add PipelineCreateFlags

* Small fixes

* -inline

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

* -inline

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

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-04-22 20:46:22 +02:00
Rua
958a72539e
Require explicit VertexInputState creation (#2183) 2023-04-19 17:45:27 +02:00
Rua
b7679f8bbb
Rewrite shader and specialization handling in pipelines (#2181)
* Rewrite shader and specialization handling in pipelines

* Make the shader loading in examples a bit cleaner

* Forgot some

* Fix incorrect color blend states in examples

* Nicer fix

* Use mem::discriminant

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

---------

Co-authored-by: marc0246 <40955683+marc0246@users.noreply.github.com>
2023-04-18 20:53:08 +02:00
marc0246
59be815314
Refactor AllocationCreateInfo (#2174)
* Refactor `AllocationCreateInfo`

* `debug_assert` -> `assert`
2023-04-02 15:07:16 +02:00
marc0246
ad530ed48a
Preemptively rename stuff, mark enums as non-exhaustive (#2172) 2023-04-01 18:51:58 +02:00
marc0246
5ab869156d
Fix inconsistent trailing command in renderpass macro calls (#2163) 2023-03-25 10:25:25 +01:00
marc0246
28a98f7a5f
Fix game of life example constructing one memory allocator per window (#2157) 2023-03-24 14:03:49 +01:00
marc0246
127b3eae61
Generate device properties that are alignment as DeviceAlignment (#2155)
* Move `DeviceAlignment`

* Generate alignment-properties with the type `DeviceAlignment`

* Small fix

* Another small fix

* Switch to using `is_aligned` where possible

* Oopsie
2023-03-15 22:21:44 +01:00
Francisco Ayala Le Brun
19acc71be3
Fix gl-interop not compiling (#2154)
Running this results in a segmentation fault in my machine.
2023-03-11 21:14:37 +01:00
Rua
41ded32156
Update dependencies, clippy warnings (#2142)
* Update dependencies, clippy warnings

* Remove allowed clippy lint that no longer triggers as of Rust 1.67.1
2023-03-05 20:12:17 -06:00
marc0246
baf863ce33
Resolve restrictions of BufferContents, add support for allocating all types of buffers, and rework vulkano-shaders (#2132)
* Add `BufferContentsLayout`

* Rework `BufferContents`

* Add `BufferContents` derive macro

* Relax restrictions of shader code generation

* Fix examples

* Add additional invariant to `Subbuffer`

* Shorten paths a bit

* Remove a bit of bloat

* Add `Sized` constraint to element traits

* Fix an oopsie

* Add `Aligned`

* Add support for deriving `BufferContents` for sized types

* Fix alignment and padding issues

* Fix docs and add examples for `BufferContents`

* Adjust shader macro

* Add tests

* Adjust `Vertex` example

* Remove bytemuck re-export

* Update examples

* Workaround bytemuck's array elements that are `AnyBitPattern` limitation

* Add more alignments

* Fix an earlier oopsie

* Rework vulkano-shaders

* Fix examples

* Fix some rogue tabs in examples

* Add `AsRef` and `AsMut` implementation for `Padded`

* Remove useless code duplication

* Make the `BufferContents` derive macro the same for all types

* Add example docs for `Padded`

* Work around trivial bounds

* More example docs

* Minor consistency adjustment

* Add `serde` to the list of cargo features

* Make clippy happy again
2023-03-05 19:56:35 +01:00
marc0246
abfde840fa
Unify all buffer types (#2127)
* `CpuBufferPool` revamp

* Fix oopsie

* Fix docs

* Add `Subbuffer`

* Move `Buffer` to `buffer` module

* Replace all buffer types with `Subbuffer`

* Add constraints to `Index` and `QueryResultElement` traits

* Fix oopsies

* Fix examples

* Fix doc tests

* Rename `_unsized` to `_slice`

* Rename `CpuBufferAllocator`

* Implement `DeviceOwned` for `SubbufferAllocator`

* Use better generic type params

* Fix requirement message

* Fix docs

* Fix missing buffer alignment for texel buffer usage

* Add more docs to `Subbuffer`

* Add more utility functions to `Subbuffer`

* Remove superfluous `dst_offset`s

* Murder `FillBufferInfo`

* Fix example

* Add `Subbuffer::range`

* Fix wrong atom size alignment check

* Specify all fields in create infos derived from `BufferAllocateInfo`
2023-01-12 13:56:10 +01:00
Rua
4927b2ea62
Make triangle-v1_3 example work with khr_dynamic_rendering too (#2123)
* Make `triangle-v1_3` example work with `khr_dynamic_rendering` too

* Small comment fix
2023-01-07 20:37:21 -06:00
Nik Voss
834cc1eea5
Better custom vertex buffer layouts support (#2119)
* Implement VertexDefinition for VertexBufferInfo, change Vertex signature to return VertexInfo and implement VertexInput-trait helper for Vertex to construct VertexBufferInfo objects from Vertex types. Updated teapot example to show usage.

* Reimplement BuffersDefinition leveraging VertexBufferInfo

* Reduce the amount of types required, remove VertexInfo, expose VertexBufferInfo methods on Vertex and use std HashMap transparently instead.

* Fix teapot example

* Fix outdated docs and use full path to Vertex trait to avoid issues

* Fix formatting of imports

* Remove clone and directly instantiate VertexInputBindingDescription.

* Rename VertexBufferInfo to VertexBufferDescription and being update of examples to use it

* Run cargo clippy fix to cleanup imports in examples

* Remove obsolete comment

* cargo fmt
2023-01-03 18:49:12 +01:00
Rua
41a37735d1
Automatically derive Pod and Zeroable for structs generated by vulkano-shaders (#2117) 2022-12-30 03:18:25 -06:00
Nik Voss
dcc1b58fab
Refactor Vertex trait to allow user-defined formats (#2106)
* Refactor Vertex trait to not rely on ShaderInterfaceEntryType::to_format and instead rely on Format provided by VertexMember trait.

* Add test for impl_vertex macro, remove tuple implementations as they do not implement Pod, minor cleanups to impl_vertex macro.

* #[derive(Vertex)] proc-macro implementation with support for format and name attributes. Tests are implemented for both attributes and inferral matching impl_vertex macro

* Rename num_elements into num_locations to make purpose clear, add helper function to calculate num_components and check them properly in BufferDefinition's VertexDefinition implementation.

* Rename num_locations back to num_elements to make distinction to locations clear. Updated VertexDefinition implementation for BuffersDefinition to support double precision formats exceeding a single location.

* Add additional validation for vertex attributes with formats exceeding their location.

* Collect unnecessary, using iterator in loop to avoid unnecessary allocations.

* Use field type directly and avoid any form of unsafe blocks.

* Match shader scalar type directly in GraphicsPipelineBuilder

* Rename impl_vertex test to fit macro name

* Add VertexMember implementatinos for nalgebra and cgmath (incl matrices).

* Add missing copyright headers to new files in proc macro crate

* Document derive vertex with field-attribute options on the Vertex trait

* Add example for vertex derive approach.

* Do not publish internal macros crate as it is re-exported by vulkano itself

* Deprecate impl_vertex and VertexMember and update documentation for Vertex accordingly

* Make format field-level attribute mandatory for derive vertex

* Update all examples to derive Vertex trait instead of impl_vertex macro

* Fix doctests by adding missing imports and re-exporting crate self as vulkano to workaround limitations of distinguishing doctests in proc-macros
2022-12-28 11:23:36 +01:00
Rua
6eb526322b
Fix clippy warnings from Rust 1.66 (#2105) 2022-12-18 10:23:40 -06:00
Rua
3aca5dc190
Fix #1643 (#2103)
* Fix #1643

* Remove old code that was incorrect anyway
2022-12-16 04:40:46 -06:00
Rua
4d95604e1a
Update Ash to 0.37.1 (#2096)
* Update Ash to 0.37.1

* typo

* Add support for new shader/pipeline stages and access flags

* Small change

* Fixes

* Use ^ for version
2022-12-02 10:17:45 -06:00
Austin Johnson
93b5164b73
Fix runtime_array example (#2095) 2022-12-01 11:56:11 +01:00
Rua
9bc69940d0
Split sync module into multiple submodules, other changes to sync (#2086) 2022-11-15 02:05:03 -06:00
Rua
4ccfc925fa
Refactor DescriptorRequirements (#2081) 2022-11-09 03:35:50 -06:00
Okko Hakola
facee332ec
Fix black screen on some devices in interactive examples (#2082) 2022-11-07 08:48:25 +01:00
marc0246
fe01ddd5e3
CpuBufferPool revamp (#2076)
* `CpuBufferPool` revamp

* Fix oopsie

* Fix docs
2022-11-05 08:50:46 +01:00
Rua
a984a925c4
Use actual integer bitflags for Vulkan bitflag types (#2073)
* Use actual integer bitflags for Vulkan bitflag types

* Fix doc tests

* Fix Fence and Semaphore on Win32 and Fuchsia

* Add macro for bitflags that have a corresponding enum

* Fix bug
2022-11-05 00:02:28 -05:00
marc0246
6b2d21e9f5
Fix StandardCommandBufferAllocator example docs (#2072) 2022-10-31 09:06:08 +01:00
marc0246
45f3eb9ac8
Implement allocator traits for Arcs (#2068) 2022-10-31 08:08:59 +01:00
Rua
bdcb79609e
Update render pass checks for new VUID (#2055) 2022-10-30 04:37:34 -05:00
marc0246
d5d47d7757
Further improvements to command buffer allocation (#2053) 2022-10-29 19:34:07 +02:00
marc0246
8a1c91f556
Make command buffer/descriptor set allocators Sync again (#2046)
* Make cmd buffer/desc set allocators `Sync` again

* Ingles
2022-10-27 20:59:47 +02:00
marc0246
34b709547f
Memory allocation revamp (#1997)
* Add suballocators

* Add tests

* Retroactively abort `PoolAllocatorCreateInfo`

* Use const generic for `PoolAllocator`'s block size

* Move `new` and `try_into_region` to `Suballocator`

* Move `allocate_unchecked` to `Suballocator`

* Fix constructor visibility

* Move `free_size` to `Suballocator`

* Small fixes

* Merge `BumpAllocator` and `SyncBumpAllocator`

* Restrict `AllocParent::None` to tests

* Rewording

* Add dedicated allocations

* Add `Suballocator::cleanup`

* Make `free_size`s lock-free

* Add `Suballocator::largest_free_chunk`

* Add `ArrayVec`

* Remove useless `unsafe`

* Add `MemoryAllocator`

* Add `GenericMemoryAllocator`

* Small fixes

* Retroactively abort `largest_free_chunk`

* Small docs adjustments

* Rearrange

* Add `MemoryAlloc::mapped_ptr`

* Fix oopsie

* Add support for non-coherent mapped memory

* Add `DeviceOwned` subtrait to `Suballocator`

* Move granularities to suballocators, fix tests

* Add cache control

* Fix oopsie where alignment of 0 is possible

* Store `Arc<DeviceMemory>` in suballocators

* Add `MemoryAllocator::create_{buffer, image}`

* Remove `MemoryPool`

* Fix examples

* Remove `MemoryAlloc::{memory, memory_type_index}`

* Minor improvement to `AllocationCreationError`

* Add some example docs

* Add support for external memory

* Swicheroo

* Small fix

* Shorten sm names, cache atom size in suballocators

* Add config for allocation type to generic allocatr

* Engrish

* Fix a big oopsie

* Spliteroo

* Inglisch
2022-10-26 16:25:01 +02:00
Rua
0b5ad98b44
Move resource locking to submit function (#2041) 2022-10-23 17:29:40 -05:00
Rua
cdab36a322
Remove type parameter from Surface (#2036) 2022-10-20 02:26:34 -05:00
Rua
43223f564b
Add safety checks to semaphores, add importing and exporting (#2035)
* Add safety checks to semaphores, add importing and exporting

* Small fix

* Limit test to unix only
2022-10-12 19:04:54 -05:00
Rua
df26f8105e
Buffer and image uploads take a command buffer instead of making one (#2030) 2022-10-08 08:22:37 -05:00
marc0246
3c6c1c909f
Remove unneccessary muts left after #1957 (#2029) 2022-10-07 08:59:54 +02:00
marc0246
ef65c98ad1
Move to manual management of descriptor set and command buffer allocators (#1957)
* Rename `Pool` -> `Allocator`

* Fix module names

* Rename actual pool types

* Remove internally managed allocators

* Fix doc tests

* Update docs

* Update examples

* Fix merging oopsie

* Fix cb allocators only working for one q family

* Make `DescriptorPool` `!Sync`, remove `&mut`

* Combine lean files

* Consistency

* Rename single layout pools

* Re-export variable descriptor set pool

Co-authored-by: comrademarc <40955683+comrademarc@users.noreply.github.com>
2022-10-05 11:09:26 +02:00
Austin Johnson
6e4d8c3494
Swapchain acquisition checks (#2009)
* Initial solution to swapchain acquisition checks

* replace internal_object comparisons
2022-10-02 10:44:46 +02:00
Rua
f96519a8a3
Add state tracking and validation to Fence (#2010)
* Add state tracking and validation to `Fence`

* Forgot bind_sparse
2022-10-01 21:32:17 -05:00
Rua
6b19b6ccf4
Remove command_buffer::submit module, make new Queue methods public (#2002) 2022-09-27 02:58:47 -05:00
Rua
c085dd8d9f
Queue operations refactoring (#1995) 2022-09-24 01:45:06 -05:00
Rua
0bab019d10
Treat atomic writes in shaders as write accesses (#1989) 2022-09-18 02:45:55 -05:00
Austin Johnson
8f99ceab32
Example Tweaks (#1987)
* Example Tweaks

* use released glium
2022-09-17 17:37:22 +02:00
Rua
46187e85fb
Rename next and chunk methods of CpuBufferPool for consistency (#1978) 2022-09-17 02:51:26 -05:00
Austin Johnson
8e8482016a
Impl Present Wait Feature (#1965)
* impl present_wait feature

* handle timeout case

* add missing doc

* document the return type of wait_for_present

* impl check for VUID-04999

* don't enforce gt if present_id is zero

* impl PresentInfoExt

* Remove NonZeroU64 from wait_for_present in favor of an error

* fix gl-interop example

* fix docs and fmt

* PresentInfoExt -> PresentInfo, Added swapchain + index to info

* fix doc test,  didn't save file...

* fix gl-interop

* Remove Whitespace
2022-09-17 09:38:32 +02:00
Codotaku
e0af8af960
fix (#1977) 2022-09-13 21:11:54 +02:00
Rua
e99ad4fce5
Add khr_external_fence and remaining parts of khr_external_semaphore (#1972) 2022-09-13 04:07:10 -05:00
Rua
4abc27b9e5
Make PhysicalDevice an independent object (#1967)
* Better validation and errors

* Small fix

* Make `PhysicalDevice` an independent object

Co-authored-by: Austin Johnson <me@austinj.work>
2022-09-10 01:00:08 -05:00
Rua
2705984c77
Macrofy all Vulkan bitflag and enum types, check for device support (#1964) 2022-09-05 15:16:40 -05:00
Rua
f96768f556
Slight change 2022-09-05 15:57:53 +02:00
Rua
5a1df026dc
Reword for clarity 2022-09-05 15:57:11 +02:00
Rua
f77644bcef
Refactor bind/push commands (#1962) 2022-09-02 11:02:41 -05:00
Rua
f0e6e4c6b7
Fix or allow all Clippy errors, re-enable dead code and unused variable warnings (#1953) 2022-08-12 05:18:35 -05:00
antonino maniscalco
77e59002de
Merged ImmutableBuffer into DeviceLocalBuffer #1934 (#1936)
* Merged `ImmutableBuffer` into `DeviceLocalBuffer` #1934

* Updated documentation
2022-07-31 11:54:46 +02:00
Rua
14f14f76ee
Update winit to 0.27 (#1933)
* Update winit to 0.27

* Fix windows

* Better fix?
2022-07-30 01:58:44 -05:00
Rua
6a755cd2f3
Add VulkanLibrary as first initialization step before Instance (#1932)
* Add `VulkanLibrary` as first initialization step before `Instance`

* Fix MacOS error

* Fix Vulkano-utils
2022-07-30 01:53:52 -05:00
Austin Johnson
df97b2c55f
Support for VK_KHR_portability_subset Devices (#1927)
* opt-in portability

* Only enable portability flag if extension is present

Automatically enable khr_portability_subset on Device; Remove required_extensions from PhysicalDevice & Device

* enable InstanceCreateInfo.enumerate_portability on all examples

* add additional documentation for enumerate_portability
2022-07-18 15:11:43 +02:00
Joseph Micheli
e8cf282e51
Documentation todos (#1920)
* Added ImageUsage::transient_input_attachment()

* Address TODOs in examples

* Added actual example to command_buffer module documentation.

* Fixed error in command_buffer example

* Check  max_framebuffer_height/width/layers in AttachmentImage constructors.

* Add detailed explanation for shader! macro to triangle examples
2022-07-13 12:26:47 +02:00
Okko Hakola
18f68337a5
Vulkano util proposal (#1918)
* Init vulkano util library

* Add window & renderer structs

* Update fractal to use vulkano utils

* Add general purpose image view generation to storage image

* Add some missing functionality

* Fix game of life

* Rename error

* Fix tests

* Update documentation texts

* Modify license comment

* Add to changelog

* Improve docs

* Allow option to wait on the future

* Update doc text

* Add filter fn

* Modify queue selection

* Fix import error

* Remove non working tests

* Rename start and finish frame to acquire and present

* Allow pub creation of window renderer

* Ensure config members are pub and it has send + sync

* Remove send syncs
2022-06-24 17:27:33 +02:00
Rua
6352adf4ff
Add support for dynamic rendering (#1902) 2022-05-29 11:53:36 -05:00
Ryan Andersen
a89359007b
Image extent zero length (#1893)
* Updating examples and SwapchainCreationError enum to resolve #1892 and related discussion

* Slightly better documentation
2022-05-09 14:25:26 +02:00
Ryan Andersen
ba7f0b20e6
Device local example (#1890) 2022-05-06 18:31:08 +02:00
Rua
9e2b41a5c4
Improve render pass commands, more validation (#1884)
* Use only the selected range of buffer and image views in synchronization

* Improve render pass commands, more validation

Co-authored-by: Austin Johnson <me@austinj.work>
2022-04-23 20:16:19 -05:00
Okko Hakola
f523234e41
Fix debug utils message severity error (#1883) 2022-04-19 16:24:58 +02:00
Rua
201e21d3e6
Rewrite copy commands (#1873)
* Allow `SyncCommandBufferBuilder` commands to specify the access range

* Allow `SyncCommandBufferBuilder` commands to specify the access range

* Better handling of image initialization

* Small fix

* Rewrite copy commands

* Better handling of maintenance1

* Small leftovers

* Remove conflict_key
2022-04-16 15:02:42 +02:00
Rua
44e30574d9
Rename debug commands, add some new ones (#1878) 2022-04-16 07:54:32 -05:00
Okko Hakola
d1ab3f6726
Fix game of life example on macos (#1829) 2022-03-28 15:28:51 +02:00
Rua
c70fcc575f
Rework mapped memory, add BufferContents trait with bytemuck (#1853)
* Rework mapped memory, add `BufferContents` trait with bytemuck

* Platform fix
2022-03-07 02:30:49 +07:00
Rua
9e8682fce7
Add UnsafeImageCreateInfo and ImageViewCreateInfo (#1844) 2022-02-27 00:18:14 -06:00
Rua
a593fee072
Add SamplerCreateInfo and SamplerYcbcrConversionCreateInfo (#1842) 2022-02-26 02:46:53 -06:00
Rua
42b4bd9441
Add CreateInfo for Event, Fence and Semaphore. (#1841)
* Add `CreateInfo` for `Event`, `Fence` and `Semaphore`.

* Small fixup

* Random idea...

* Fix CI error on Windows and Mac
2022-02-26 02:42:14 -06:00
Rua
c61ed1bfe3
Add QueryPoolCreateInfo (#1840) 2022-02-25 17:52:59 -06:00
Rua
786683c2a9
Add DescriptorSetLayoutCreateInfo and PipelineLayoutCreateInfo (#1834)
* Add `DescriptorSetLayoutCreateInfo` and `PipelineLayoutCreateInfo`

* DescriptorType non_exhaustive
2022-02-25 16:52:44 -06:00
Austin Johnson
51c5d197bf
Update examples readme
The readme still redirected users to the vulkano-examples repository. This has since been achieved. Included a step-by-step guide to switching version tag.
2022-02-23 02:17:35 -06:00
Rua
645faa4530
Add SwapchainCreateInfo, various related changes (#1832) 2022-02-20 10:55:34 +01:00
Rua
21330c747a
Add RenderPassCreateInfo and FramebufferCreateInfo (#1828) 2022-02-19 18:14:16 -06:00
Rua
8775777f47
Add InstanceCreateInfo and DeviceCreateInfo (#1814)
* Convert creation of `Instance` and `Device` to use a builder

* Big oops

* Add `InstanceCreateInfo` and `DeviceCreateInfo`

* Doc fix

* impl FromStr for Version, remove elidable qf2
2022-02-14 16:32:27 +07:00
Austin Johnson
901d2b2bc2
Refactor VertexBuffersCollection to acccept Arc<dyn BufferAccess> (#1824) 2022-02-13 11:38:14 +01:00
Okko Hakola
96c52ad11a
Add multi-window game of life application example (#1812) 2022-02-02 17:21:32 +01:00
Rua
0c06394e6c
Better validation of image view creation, descriptor set updates, draw-time resources and others (#1806) 2022-01-30 03:53:33 +07:00
Todd York
ec4f7631e0
Fix support for 2D array images (#1803)
* Fix mipmap generation for arrayed images

* Add example for texture array

* Change ImageView constructor to explicitly require ImageViewType

* Revert "Change ImageView constructor to explicitly require ImageViewType"

This reverts commit 3ad55717c4.
2022-01-29 18:59:45 +01:00
Rua
4c7cdb44fe
Sampler improvements (#1787)
* Sampler improvements

* Check Filter::Cubic for blits as well

* Small doc fix

* Better checks for blits

* Doc fix

* can_be_sampled > can_sample
2022-01-11 10:32:53 +07:00
Rua
16171c51ac
Improve shader analysis, add and refine DescriptorRequirements fields (#1786)
* Improve shader analysis, add and refine DescriptorRequirements fields

* Simplify a bit
2022-01-11 09:06:22 +07:00
Francisco Ayala Le Brun
adef9bd17a
Fix undefined behaviour on external semaphore & image creation; Fix wrong device chosen on hybrid graphics (#1783)
* Fix device memory missing p_next structures

* Fix exportable attachment image missing p_next; Fix mutable bit off

* Fix fd export for StorageImage

* Fix undefined behaviour on external semaphore & image creation

* Add uuid check on physical device creation

* Add rev specification to glium dependency
2022-01-05 04:14:18 +07:00
Amjad Alsharafi
657012142b
Allow copy_image, blit_image and copy_buffer source and destination to be the same image (#1782)
* Allow `copy_image` source and destination to be the same image

The doc: `srcImage and dstImage can be the same image or alias the same
memory`.

This was achieved by locking only one image exclusively if both are the same.

* Allow `blit_image` and `copy_buffer` to have the same src/dest buffers

Regarding this and the previous commits, I noticed an important note in
the docs.
`regions must not overlap`

Before this, it was not important check for us to do, since we can't
have overlapping regions if both buffers are different. But now we must
add some checks to make sure its safe to use these functions while also
allowing for shared buffers between src and dest.

* Added bounds and overlapping checks for `copy_buffer`

* Added overlap checks for `blit_image` and `copy_image`

Created utility file `src/command_buffer/validity/ranges.rs` which hold
functions that help compute if there is overlap in regions.

* Fixed bug in regions overlap check

It should be ANDed together and not ORed

* Added `image_blit` to the `image-self-copy` example

* Added example for `copy_buffer_dimensions` using `basic-compute-shaders`

Also updated copyright year for this and the `image-self-copy-blit`
example.
2022-01-03 03:54:02 +07:00
Amjad Alsharafi
d75390042f
Added command clear_attachment (#1779)
* Added command `clear_attachment`

This command implements `vkClearAttachments`, most checks are done
except for:
- Handling attachments with `VK_ATTACHMENT_UNUSED`, `vulkano` doesn't
  support unused attachments for now.
- command buffer protection and protectedNoFault, which `vulkano` is not
  supporting now.

* Added `clear_attachments` example

This explains the usage of `clear_attachments` command

* Modified `ClearRect.rect_offset` to use `u32`

Since, in vulkan docs, it says that the rect must be inside the render
area, its better to use `u32` so that we don't get negative values since
its not applicable here.

I was using `i32` because in vulkan docs its using `VkRect2D` inside
`VkClearRect` which is a general rectangle object. Since ours is only
specific to `ClearRect` its better to make it specific.
2021-12-19 19:20:51 +07:00
Rua
2151697af0
Remove DescriptorSetBuilder, use descriptor writes directly (#1774)
* Remove DescriptorSetBuilder, use descriptor writes directly

* Merge two error types
2021-12-18 17:32:38 +07:00
Rua
f069fdc35f
Upgrade to Rust 2021, update dependencies (#1772)
* Upgrade to Rust 2021, update dependencies

* Missed one

* Fix raw_window_handle breaking changes
2021-12-16 15:46:44 +07:00