Commit Graph

280 Commits

Author SHA1 Message Date
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
Francisco Ayala Le Brun
5d0c2390ba
Fix gl-interop validation error & window not closing (#1768) 2021-12-06 04:11:59 +07:00
Rua
0ebf05f35d
Bring vertex input in line with other pipeline state, reorganise modules (#1758)
* Bring vertex input in line with other pipeline state, reorganise modules

* Documentation improvement

* Use ShaderInterfaceEntryType in shader interface instead of format

* Example fix
2021-12-06 03:30:56 +07:00
Will Song
aa5a97481e
use repr(C) (#1757) 2021-11-24 21:19:57 +07:00
Rua
9ac0de2842
Allocate less than the maximum descriptor count when variable (#1751)
* Allocate less than the maximum descriptor count when variable

* Workaround for driver bug
2021-11-24 01:33:10 +07:00
Ilya Lakhin
b84b0c9c55 #1734 Changelog update 2021-11-23 19:59:37 +07:00
Francisco Ayala Le Brun
4d0e709c18
Fixes related to Image export & OpenGL Interop (#1734)
* Fix device memory missing p_next structures

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

* Fix fd export for StorageImage

* Add gl-interop example; Remove debug assert comment

* Fix gl-interop example being run on Windows and MacOS

* Add builder field to DeviceMemoryBuilder
2021-11-23 19:55:32 +07:00
Rua
c6959aa961
Move shader analysis to Vulkano crate, make available for runtime shaders (#1747)
* Move shader parsing and information extraction to Vulkano, make available for runtime shaders

* Small change

* Add new pipeline stages to match shader stages

* Fix review issues
2021-11-13 22:06:16 +07:00
Rua
325ef8ee38
Check against DescriptorRequirements instead of pipeline layout at draw time (#1744) 2021-11-13 17:10:52 +07:00
Rua
189a589002
Arcs, Arcs everywhere (#1739)
* `Arc`s, `Arc`s everywhere

* Additional types that I forgot

* Include Arc when returning image from ImageView
2021-11-03 03:33:58 +07:00
Rua
5a326db546
Add DescriptorRequirements (#1729)
* Add DescriptorRequirements

* Doc fix
2021-10-26 00:16:54 +07:00
Rua
35fed6b577
Add basic support for khr_push_descriptor (#1727)
* Add basic support for khr_push_descriptor

* Add basic support for khr_push_descriptor

* Support arrays in `DescriptorWrite`

* Use assert when creating the builder
2021-10-20 21:56:56 +07:00
Rua
64ca6f78e1
Lots of additional dynamic state, and some new pipeline state (#1724)
* Add extra dynamic state commands to the command buffer builders

* Add TessellationState

* Re-enable InputAssemblyState, add dynamic state, update Ash

* Rework depth_stencil module, add dynamic state

* Rename module raster > rasterization, add dynamic state

* Replace DynamicStateMode with bool, replace Option with StateMode enum for potentially dynamic states, rename Blend > ColorBlendState, add dynamic state

* Re-enable MultisampleState

* Re-enable ViewportState, add state to GraphicsPipeline with retrieval methods, add dynamic state

* Add builder methods for state types

* Color blend improvements

* Further checks on input assembly dynamic state

* Add color_write_enable

* Add topology class, check that it matches

* Add line_stipple

* Move some builder code to the individual state types

* Add discard rectangles

* Trim down GraphicsPipelineCreationError variants, order alphabetically
2021-10-12 19:42:32 +07:00
Rua
885fbc6a4c
Add Send + Sync requirements to various traits (#1720)
* Remove Send + Sync and BufferAccess traits where they are redundant

* Require Send + Sync for ImageViewAbstract

* Require Send + Sync for ImageAccess, AttachmentsList and MemoryPoolAlloc

* Require Send + Sync for DescriptorSet and DescriptorPoolAlloc

* Require Send + Sync for FramebufferAbstract

* Minor rearranging

* Require Send + Sync for PrimaryCommandBuffer, SecondaryCommandBuffer and CommandPoolAlloc

* Require Send + Sync for Command (private trait)

* Cargo fmt
2021-09-29 12:00:56 -05:00
Okko Hakola
2151a4d1ce
Remove validation layer request from fractal example (#1708)
* Add interactive fractal example

* Rename folder

* Update guide

* Remove layers & debug callback from fractal example
2021-09-14 21:45:49 +07:00
Okko Hakola
e0839af295
Add an interactive fractal example (#1707)
* Add interactive fractal example

* Rename folder

* Update guide
2021-09-13 22:14:54 +07:00
Rua
8d321430cb
Add auto-generated SPIR-V parsing (#1701)
* Add auto-generated SPIR-V parsing

* Add further reflection utilities for decorations, names and members, clean up Vulkano-shaders
2021-09-13 19:39:17 +07:00
Ilya Lakhin
ddbde190ff
Sharing generated Rust types between shaders (#1694)
* Vulkano-shader mutual compilation mode

* Tests fixes

* Shared constants option for multi-shader

* Cargo fmt

* Fix doc typos
2021-09-06 02:18:04 +07:00
Austin Johnson
588f91dc59
fix warnings/errors (#1692) 2021-09-04 01:41:17 -05:00
Rua
cd8302328f
Update dependencies (#1689) 2021-09-03 23:21:15 -05:00
Rua
ebf3ace481
Add support for immutable samplers, some small changes (#1688) 2021-09-03 23:20:05 -05:00
Rua
7a50bd5cb5
Add generation of Format to autogen (#1687)
* Add generation of `Format` to autogen

* Better documentation
2021-09-02 04:05:23 -05:00
Austin Johnson
0a3791c303
Support for Runtime Descriptor Arrays (#1674) 2021-09-02 03:29:27 -05:00
Rua
aa1c6eb607
Move command buffer binding and state-setting into their own commands (#1684)
* Move binding and state-setting into their own commands

* Fix test failing on documentation
2021-08-27 01:24:16 -05:00
Rua
874e502545
Replace VertexSource with VertexBuffersCollection, remove pipeline traits (#1671)
* Replace VertexSource with VertexBuffersCollection

* Remove pipeline traits
2021-08-17 02:10:07 +07:00
Rua
3da6c298a8
Add vertex and instance parameters to draw commands (#1661)
* Add vertex and instance parameters to draw commands

* Remove BufferlessDefinition
2021-08-12 21:14:02 +07:00
Will Song
4f4580e749
update push constant ranges to match the spec. overlapping ranges are OK but intersecting stage flags are not (#1659)
* update push constant ranges to match the spec. overlapping ranges are OK but intersecting stage flags are not

* add a check for push constant ranges
2021-08-09 22:19:54 +07:00
Will Song
0bf8c86eea
add some logic for known properties (#1654)
* add some logic for known properties

* update examples

* fix tests

* fix indentation
2021-08-09 20:44:58 +07:00
Rua
7bc7d4ddac
Fix storage buffer detection to work for all SPIR-V versions (#1642) 2021-07-26 00:23:57 -05:00
Rua
0ad56aaeda
Add DescriptorSetWithOffsets type (#1641)
* Add DescriptorSetWithOffsets, remove the dynamic_offsets parameters on AutoCommandBufferBuilder

* Modify StateCacher, add checking to DescriptorSetWithOffsets constructor

* Add DescriptorSetWithOffsets to SyncCommandBufferBuilder
2021-07-21 00:06:22 +07:00
Rua
1771714bc4
Descriptor set/pipeline layout refactoring (#1629)
* Remove DescriptorSetDesc trait, add layout method to DescriptorSet

* Add struct DescriptorSetDesc, forward PipelineLayoutDesc to it, rename is_superset_of to ensure_superset_of, union doesn't take self

* DescriptorSetLayout takes DescriptorSetDesc in constructor

* PipelineLayout takes DescriptorSetLayout in constructor

* EntryPointAbstract takes/returns descriptor set descs and push constant descs separately

* Remove PipelineLayoutDesc

* Remove PipelineLayout::descriptor_set_layout

* Minor changes

* Small additions
2021-07-05 11:35:38 +07:00
Rua
0eebf0c4f4
Rework VertexDefinition trait, add BuffersDefinition, support instance rate divisors (#1619)
* Rework VertexDefinition trait, add BuffersDefinition

* Add support for instance rate divisors
2021-07-05 11:19:32 +07:00
Rua
aee11063d4
Rename Features::superset_of to is_superset_of, add is_superset_of to extensions (#1625) 2021-06-28 16:07:54 +07:00
Rua
d5bcffa902
Rearrange descriptor set modules and types (#1622)
* Move descriptor_set.rs to parent, make descriptor.rs its child

* Rename UnsafeDescriptorSetLayout to DescriptorSetLayout, as there isn't actually anything unsafe about it

* Make fixed_size_pool and persistent modules public, reduce number of re-exports from there

* Split off pool.rs from sys.rs

* Move std_pool module to pool::standard

* Make sys public, remove re-exports

* Move descriptor module and DescriptorSetDesc into layout module

* Move ShaderStages to pipeline::shader

* Make descriptor_set::collection module private

* Documentation
2021-06-28 15:28:09 +07:00
Rua
e5bd8807e4
Move instance/physical_device.rs to device/physical.rs, rewrite and refactor some parts of it (#1617)
* Move instance/physical_device.rs to device/physical.rs, rewrite some of it

* Deprecate supported_by_device_raw as well
2021-06-28 15:04:28 +07:00
Rua
847c81bb88
Better feature and device selection in examples (#1614)
* Don't enable any features in examples unless the example requires it

* More elaborate device selection code in the triangle example

* Better device selection for all other examples
2021-06-28 13:24:44 +07:00
Rua
0d5edc130d
Add auto-generated device properties (#1605)
* Migrate to using Ash as a base

* Small change to test, to make it applicable to Vulkan 1.1

* Auto-generate extensions, check extension requirements

* Add documentation to extensions, use vk.xml from Ash 0.32.1

* Remove `RawDeviceExtensions` and `RawInstanceExtensions`

* Add extension conflict checking

* Small fix

* Add auto-generated features, more requirements checks

* Features documentation

* Macrofy required_if_supported_extensions

* Include vulkano-gen tool

* Move autogen imports to macros

* Change autogen into a build script

* Delete leftover file

* Autogenerate device properties

* Propagate bugfix in properties chain to features
2021-06-14 02:47:10 +07:00
Tim Balsfulland
748097a159
add support for VK_KHR_multiview (#1598)
* initial support for the `VK_KHR_multiview` extension

The `VK_KHR_multiview` extension can be used to efficiently draw to multiple layers of a framebuffer at once with.
This is particularly useful for virtual reality applications or other types of stereoscopic rendering where both eyes need to be rendered and they share almost all visible vertices.

* allow creation of multi-layer attachment images

Using the `AttachmentImage::multisampled_with_usage_with_layers` constructor.
More constructors with different combinations could be added for the `AttachmentImage` but `multisampled_with_usage_with_layers` already exposes all possible options.
I think all these different constructors should be replaced with a constructor that takes a struct that implements `Default` or an enum with the different possibilities.

* compliance with VUID-VkFramebufferCreateInfo-renderPass-02531

* removed changelog entries according to new policy

* migrate `VK_KHR_multiview` support to ash

* add more comments

* add remaining `VK_KHR_multiview` validation

* validate instanced drawing using `multiview` limits

* add some missing validation relating to `VIEW_LOCAL` dependencies

* use the vulkano device feature instead of depending on the `multiview` extension directly
2021-06-07 21:41:13 +07:00