Commit Graph

258 Commits

Author SHA1 Message Date
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
Nicolas Patry
28637e8c67
Fixing the teapot example on ArchLinux (GTX 1650). (#1594) 2021-05-31 03:53:42 +07:00
Rua
f4b189792a
Migrate to using Ash as a base (#1593)
* Migrate to using Ash as a base

* Small change to test, to make it applicable to Vulkan 1.1
2021-05-31 03:42:51 +07:00
CABrinegar
81ec4bff40
Minor correction (#1589)
Correction to outdated comments describing function usage.
Corrections to English grammar.
Opinionated changes to sentence structures.
2021-05-24 17:00:12 +07:00
Rua
5175722c6b
Update winit to 0.25 (#1586) 2021-05-23 23:37:01 +07:00
Rua
2f7e7af7ee
Allow choosing the Vulkan max API version when creating Instance (#1585)
* Allow choosing the Vulkan max API version when creating Instance

* Rewrite feature handling, include all Vulkan 1.1 and 1.2 features

* Fixes

* Move features.rs to device module

* More small fixes

* Changelog
2021-05-23 23:09:50 +07:00
Rua
d36e5a2b1d
Major refactor of shader interface and pipeline layout types (#1581)
* Convert trait `ShaderInterfaceDef` into struct `ShaderInterface`

* Convert some instances of PipelineLayoutDesc to RuntimePipelineDesc

* Use regular Vec for now

* Convert PipelineLayoutDescUnion to RuntimePipelineDesc

* Convert PipelineLayoutDescTweaks to use RuntimePipelineDesc

* Remove PipelineLayoutDesc trait, replace with what used to be RuntimePipelineDesc

* Remove PipelineLayoutAbstract trait

* Fix bug

* Provide value for push constants to entry point instead of type

* Remove GraphicsEntryPointAbstract, allow pipelines without fragment shader

* Move descriptor::pipeline_layout to pipeline::layout

* Small changelog addition

* Fix bug
2021-05-23 22:33:25 +07:00
Rua
87e161cc78
Add SwapchainBuilder for easier (re)creation (#1566)
* Add `SwapchainBuilder` for easier (re)creation

* Small ergonomic improvement

* Add inline, some documentation fixes, remove `Option` from dimensions
2021-05-03 20:07:41 +07:00
Rua
0c1e0ff40d
Simplify handling of command buffer usage flags (#1563) 2021-04-26 21:53:18 +07:00
Rua
bb51359d32
Add an example demonstrating the basics of occlusion queries (#1548)
* Add an example demonstrating the basics of occlusion queries

* Make some functions const
2021-04-10 23:07:15 +07:00
Rua
803eacfcd6
Render pass restructuring (#1531)
* Create generic render pass description type, macro generates that instead of making its own type

* Replace EmptySinglePassRenderPassDesc with empty() constructor

* Remove RenderPass type parameter

* Remove RenderPassAbstract trait, type parameters that use it. Add GraphicsPipelineAbstract::subpass and Framebuffer::render_pass

* Remove RenderPassDescClearValues trait

* Remove RenderPassSubpassInterface and RenderPassCompatible traits

* Change RenderPassDesc into a struct

* Rename framebuffer module to render_pass, move/rename other things

* Rustfmt + changelog

* Documentation update
2021-04-10 18:09:03 +07:00
Rua
3b06879511
Split AutoCommandBuffer into primary and secondary (#1522)
* Split CommandBuffer trait into Primary and Secondary

* Split AutoCommandBuffer

* Rename Kind to CommandBufferLevel, change how it's structured
2021-04-05 18:25:20 +07:00
Daniel Tang
375db33ff9
Add script to run all examples (#1519) 2021-03-29 22:22:33 +07:00
Daniel Tang
b18bb01430
Fix descriptor set TypeStruct readonly detection (#1513) 2021-03-29 01:35:41 +07:00
Rua
58d19e5848
Make execute_commands safe to use (#1511)
* Add pipeline barriers when executing secondary command buffers

* Add locking for secondary command buffers when executed on a primary

* Propagate flags of secondary to primary

* Forgot the vec variant

* Add poisoning as a stopgap measure to protect against inconsistent builder state
2021-03-28 17:36:14 +07:00
gurchetansingh
65254ed10c
More memory changes with some thoughts on error handling (#1510)
* vulkano: instance: derive Ord, PartialOrd for PhysicalDeviceType

Useful for want differeniating integrated and discrete GPUs in a
hash table.

* vulkano: don't pull in all of crossbeam

Just pull in crossbeam-queue, since that's what used.

Having a smaller set of packages is easier for system integrators
such as myself.

* vulkano: memory: add import support, separate device memory and mappings, and much more!

- Chaining structs copied shamelessly and poorly from Ash :-)
- Import support, as previously promised.
- DeviceMemoryMappings so we can maybe one day expose the binding model.
- Attempts to rigorously check Valid Usage IDs (VUIDs).

A note about error handling:

- Currently, Vulkano error handling is a bit unclear.  For example, I
  didn't define a "DeviceMemoryMappingError" and simply reused the
  "DeviceMemoryAllocError" already present in the file.  In reality,
  both a theoretical "DeviceMemoryMappingError" and the already
  present "DeviceMemoryAllocError" should mostly just check the valid
  usage IDs present in the Vulkan spec (or return an error from the
  implementation).  This code pattern is common throughout Vulkano.
  Perhaps we should go to a simpler VulkanoResult<T>??? Just an idea.

- Also, is Vulkano a validation layer??? LunarG tracks every single
  VUIDs in their uber layer already:

  https://www.lunarg.com/wp-content/uploads/2019/04/UberLayer_V3.pdf

  Of course, given how Vulkan drivers are relatively straigtforward
  compared to OpenGL, it's generally possible to match LunarG *using
  Rust* if we just have a big enough community.  Whether we want to or
  not may be up for debate. For now, I just followed the original
  vision of tomaka and added validation.  If we do want to do it, then
  we have to be more rigorous about it.
2021-03-27 20:50:51 +07:00
Ilya Lakhin
b5c756298d
Migration to a newer API for #1296 (#1507) 2021-03-14 21:46:39 +07:00
Daniel Tang
24e8d72a4a
Allow const usage of features and BufferUsage (#1502) 2021-03-14 20:58:42 +07:00
Rua
1faa0c0668
Major rearrange of image and view types (#1499)
* Rename Dimensions > ImageViewDimensions, ViewType > ImageViewType

* Remove cubemap_compatible from ImageDimensions, add ImageCreateFlags to UnsafeImage creation

* Replace various UnsafeImage features/usage methods with new ones that return them directly

* Create image::view module, move view-related types into it

* Create safe ImageView type, remove some of the validity checks from UnsafeImageView

* Removed ImageViewAccess::samples and moved the descriptor_set_* functions to ImageAccess

* Remove ImageViewAccess::dimensions

* Impl ImageAccess for ImageView, remove impl on image types

* Rename ImageViewAccess to ImageViewAbstract, move some methods around

* Remove ImageViewDimensions (formerly Dimensions)

* impl Error for ImageViewCreationError

* Missing pub

* Typo

* Some small documentation changes

* Check for ImageCreateFlags that are currently not properly supported
2021-03-14 19:09:08 +07:00
Kazz
2527f56fda
Add example immutable-buffer-initialization (#1296)
* add example `immutable-buffer-initialization`

* 2017 -> 2020

* 2019 -> 2020

* fix API usage issues

Co-authored-by: Kazzix <kazzix14@gmail.com>
2021-03-14 16:43:59 +07:00
Philipp Renoth
e66e9a1fa2
segfaulting: DebugUtilsMessengerCallbackDataEXT::pMessageIdName may be null in debug callback (#1487)
* vulkano: DebugUtilsMessengerCallbackDataEXT::pMessageIdName may be null in debug callback

- https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDebugUtilsMessengerCallbackDataEXT.html#VUID-VkDebugUtilsMessengerCallbackDataEXT-pMessageIdName-parameter

* make `Message::layer_prefix` an Option
2021-02-11 04:39:15 +07:00
Philipp Renoth
9046655752
add DeviceExtensions::required_extensions(phys) (#1489) 2021-02-11 04:09:39 +07:00
Philipp Renoth
647c99d458
examples: fix debug example layers on macos using "VK_LAYER_KHRONOS_validation" (#1488) 2021-02-10 20:20:41 +07:00