Commit Graph

203 Commits

Author SHA1 Message Date
Austin Johnson
2e562b5773
convert fnv types into std (#1847) 2022-02-27 08:47:22 +01:00
Rua
db51e15e5e
Vulkan 1.3 support, updated dependencies (#1836) 2022-02-25 16:58:09 -06:00
Rua
786683c2a9
Add DescriptorSetLayoutCreateInfo and PipelineLayoutCreateInfo (#1834)
* Add `DescriptorSetLayoutCreateInfo` and `PipelineLayoutCreateInfo`

* DescriptorType non_exhaustive
2022-02-25 16:52:44 -06:00
Eemeli Lehtonen
3054690ed7
fix shader macro for geometry stages (#1823) 2022-02-10 22:41:43 +01:00
Rua
e3146aac0e
Sampler ycbcr conversion (#1807)
* Better validation of image view creation, descriptor set updates, draw-time resources and others

* Add sampler YCbCr conversion

* Add shader validation

* Minor fixes

* Add YCbCr example

* Typo
2022-01-30 08:52:57 +07: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
Rua
07c1ec1dc1
Update dependencies (#1793) 2022-01-18 19:49:24 +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
Rua
906877421f
Always generate shader requirements for the exact entrypoint interface (#1778) 2021-12-19 17:44:58 +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
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
Ilya Lakhin
29dcd28dc4
Fixes a bug when using vulkan-shaders macro with multiple shaders in release mode (#1765) 2021-11-24 22:53:43 +07:00
Rua
66d545c4cf
Add shaderc-debug feature to Vulkano-shaders (#1754) 2021-11-24 20:51:55 +07:00
Will Song
9041858430
Shader improvements (#1753)
* add Eq, PartialEq to ShaderExecution and thus GeometryShaderExecution

* use (String, ExecutionModel) to describe each entry point instead

* update tests

* Revert "update tests"

This reverts commit 2bd07d1ef4.

* keep old entry_point interface but introduce new entry_point_with_execution for fine grained selection

* update tests

* move traits to autogen

* oops
2021-11-24 20:03:10 +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
5a326db546
Add DescriptorRequirements (#1729)
* Add DescriptorRequirements

* Doc fix
2021-10-26 00:16:54 +07:00
Rua
17820738d8
Replace Iterator parameters with IntoIterator where possible, replace various iterator types with impl Iterator (#1719) 2021-09-29 01:15:39 -05: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
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
b6b423c3d3
Refactoring of DescriptorDesc and related changes (#1680)
* Various changes to DescriptorSetDesc

* More changes to DescriptorSetDesc

* Small comment fix
2021-08-24 04:16:09 -05:00
Rua
010d7fe551
Better SPIR-V Capability checks (#1664)
* Restructure DeviceRequirement in shaderc

* Add missing SPIR-V capabilities

* Avoid generating a check for every instruction in the file XD
2021-08-17 01:12:43 +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
Robin Heinemann
f331bf9c77
Add 8bit uniform and storage support (#1647) 2021-07-28 03:53:56 -05:00
Rua
7bc7d4ddac
Fix storage buffer detection to work for all SPIR-V versions (#1642) 2021-07-26 00:23:57 -05: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
d5fd3d3f0b
Convert Vulkano-shaders to use spirv_headers crate (#1624)
* Convert Vulkano-shaders to use spirv_headers crate

* Fix issue after merge
2021-06-28 15:57:30 +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
fd546e464c
Include image format on descriptor, if provided by shader (#1623) 2021-06-28 14:51:59 +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
Icy Defiance
c09a46dea3
Add CapabilityDrawParameters (#1587) 2021-05-31 03:58:15 +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
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
8bedccf9bd
Allow specifying the target Vulkan and SPIR-V versions in vulkano-shaders (#1584) 2021-05-17 19:38:15 +07:00
Rua
6f3deceb8b
Add support for instance and device versions, check version in vulkano-shaders (#1569)
* Move physical device functions into their own module

* Add method to FunctionPointers to query Vulkan api version

* Store the versions of instances and devices, allow user to query

* Check Vulkan version in vulkano-shaders, changelog

* Small mistake in changelog
2021-05-16 03:04:55 +07:00
Arc'blroth
a83f0fe489
Add exact_entrypoint_interface flag to shader! (Fixes #1556) (#1559)
* add `exact_entrypoint_interface` flag to vulkano-shaders

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* cargo fmt

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* oops

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2021-04-26 21:32:52 +07:00
Dana Marcuse
cbd915b107
Add 8-bit push constant support to vulkano-shaders (#1544) 2021-04-11 11:57:22 +07:00
Rua
1af922a607
Fix and refine the generation of readonly descriptor attribute (#1534)
* Vulkano-shaders: Improve handling of readonly descriptors

* Changelog

* Fixed image readonly detection for real this time
2021-04-05 17:53:18 +07:00
mvilim
57cbf80746
Consider included files in automatic shader recompilation (#1529)
* Consider included files in automatic shader recompilation

* Fix shader include test paths on Windows
2021-04-04 07:56:58 +07:00
mvilim
fc2e470d14
Use include_bytes! in shader! for automatic recompilation (#1523) 2021-03-31 15:35:35 +07:00
Daniel Tang
b18bb01430
Fix descriptor set TypeStruct readonly detection (#1513) 2021-03-29 01:35:41 +07:00
Rua
c38f484baa
Fix panic string literal warnings (#1515) 2021-03-28 17:46:55 +07:00
Arc'blroth
73eb8e7a9f
Fix generated descriptor set layouts for shader modules with multiple entrypoints (#1497)
* Write descriptor set layout structs for each entrypoint rather than for the entire module

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Fix descriptor set calculation for all storage classes across all SPIRV versions by inspecting each entrypoint's instruction tree. Also adds 27 instructions to parse.rs.

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Add unit tests for descriptor set calculations

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Fix BufferBlock not counting as a Block decoration on structs (this fixes the unit tests from 4875bcc2)

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* cargo fmt

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Update changelog

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2021-03-14 16:33:44 +07:00
Arc'blroth
32095992f9
[Breaking] Add support for dynamic buffers (#1480)
* Add glue to allow using dynamic uniform buffers

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* **EXTREMELY BREAKING** Add `dynamic_offsets` argument to all draw-related calls in AutoCommandBufferBuilder

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* **BREAKING** Pass data to update_buffer by reference (this allows using unsized data)

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* run cargo fmt

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Dynamic offset safety checks™

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Fix tests

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Make `PipelineLayoutDescTweaks` public

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* Add a dynamic (uniform) buffer example

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>

* all the breaking changes

Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2021-02-05 22:38:36 +07:00