Commit Graph

2751 Commits

Author SHA1 Message Date
Ilya Lakhin
1fd6bd2dd3 Vulkano-win version bump 2021-05-16 23:47:36 +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
Ilya Lakhin
8c0630d3c8
Release 0.23.0 (#1576) 2021-05-10 21:58:23 +07:00
prataprc
116abf4d58
Collection of commits. (#1567)
* Add core instance extensions.

core extensions added as part of `vulkano::instance::InstanceExtensions`

VK_KHR_device_group_creation
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_get_display_properties2
VK_EXT_acquire_xlib_display
VK_EXT_debug_report
VK_EXT_direct_mode_display
VK_EXT_display_surface_counter

* export FunctionPointers::entry_points method.

Similar to PhysicalDevice.instance().pointers() export root-level
entry_points() method. This will allow applications to call vk-functions
like `vkEnumerateInstanceExtensionProperties` directly.

* heap: Add MEMORY_HEAP_MULTI_INSTANCE_BIT for MemoryHeap.

A new method is_multi_instance() method is added to `MemoryHeap` to
know whether the heap is enabled for multi-instance.

* CHANGE-LOG.
2021-05-10 21:32:08 +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
9f250aae04
Minor refactor of UnsafeBuffer (#1565)
* Replace UnsafeBuffer usage functions with single `usage` function

* Refactor SparseLevel too
2021-05-03 19:39:46 +07:00
Rua
2e15060683
Change all flags conversions to use From (#1564) 2021-04-27 00:01:49 +07:00
Rua
0c1e0ff40d
Simplify handling of command buffer usage flags (#1563) 2021-04-26 21:53:18 +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
Rua
f1dad10cd4
Remove format structs and some related traits (#1550)
* Remove format structs, StrongStorage trait

* Remove a bunch of superfluous traits and functions

* Remove FormatDesc trait

* Make formats macro a bit easier to read

* Rename AcceptsPixels trait to Pixel, reverse implementation direction

* Changelog

* Documentation

* Improved image aspects, add aspects to Format
2021-04-17 20:05:09 +07:00
Arc'blroth
fb187e8884
#[derive(Copy, Clone)] on BufferlessDefinition and BufferlessVertices to allow cloning unfinished graphics pipeline builders (#1543)
Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2021-04-16 13:43:42 +07:00
Okko Hakola
7db41e5309
Fix pointer problems in device memory builder (#1554)
* Take a stab at fixing pointer trashing in memory builder

* Repr C for base structure

* Add to changelog
2021-04-14 20:12:27 +07:00
Ilya Lakhin
a4ef1e6d9f
Readme update(fixes) 2021-04-11 14:15:47 +07:00
Dana Marcuse
cbd915b107
Add 8-bit push constant support to vulkano-shaders (#1544) 2021-04-11 11:57:22 +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
Ilya Lakhin
fc42de0c48
Readme update(removing some mentions of safety due to controversial opinions on this topic) 2021-04-10 22:38:59 +07:00
Rua
5577099029
Partial safe support for queries (#1542)
* Add get_results to UnsafeQueriesRange

* Add copy_query_pool_results command, remove "Unsafe" from names

* Documentation + changelog

* Add reset_query_pool

* Add begin_query and end_query

* Add query feature checks when starting an AutoCommandBufferBuilder

* Add write_timestamp

* Re-exports

* Further safety checks for write_timestamp

* Track query active state in AutoCommandBufferBuilder, further safety checks

* Move query/mod.rs to query.rs as there's no other submodules

* Check for query state when building
2021-04-10 19:07:59 +07:00
Ilya Lakhin
e8e9c69d83
Readme update(Sierra) 2021-04-10 18:19:20 +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
Ilya Lakhin
f89c2e325f
Readme fix(maintainer link) 2021-04-10 18:04:23 +07:00
Ilya Lakhin
0b4fd13bfe
Readme fix(wgpu description) 2021-04-10 17:56:15 +07:00
Ilya Lakhin
674efa655f
Readme update (#1547) 2021-04-10 17:47:40 +07:00
Rua
a3465537cc
Fix check for array layer count with cube descriptors (#1541) 2021-04-10 13:40:32 +07:00
Rua
78b12ca64f
Add component mapping to ImageView, create ImageViewBuilder (#1538) 2021-04-10 13:35:09 +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
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
Danny Hadley
bba6a0e776
fix typo in scissor doc comment (#1528)
* fix typo in scissor doc comment

* change comment

* rm link
2021-04-05 15:49:20 +07:00
Rua
2a6d80fc5a
Re-export DispatchIndirectError (#1536) 2021-04-04 09:52:03 +07:00
Rua
c68882eb7f
Replace deprecated Error::cause with source (#1532)
* Replace deprecated Error::cause with source

* Changelog
2021-04-04 09:31:35 +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
Rua
440a34b2bb
Comment in changelog with formatting instructions (#1526)
* Comment in changelog with formatting instructions

* Remove duplicate
2021-03-31 17:55:54 +07:00
Ilya Lakhin
7e32ae9b88
Release 0.22.0 (#1525) 2021-03-31 16:40:50 +07:00
Rua
4f009c3c93
Convert all code to Rust 2018 edition (#1508)
* Convert to 2018 edition of Rust

* Merge branch 'master' of https://github.com/vulkano-rs/vulkano into edition2018
2021-03-31 16:20:41 +07:00
mvilim
fc2e470d14
Use include_bytes! in shader! for automatic recompilation (#1523) 2021-03-31 15:35:35 +07:00
stephan-cr
eb21fea03b
Make {CpuAccessibleBuffer,ImmutableBuffer}::from_data sound (#1517)
from_data needs flat memory structures. Types which implement
Copy (either implicity or explicitly) ensure this property.

This commit adds the Copy trait bound to
{CpuAccessibleBuffer,ImmutableBuffer}::from_data and adapts the unit
tests accordingly.
2021-03-31 11:51:38 +07:00
Rua
c2d404c669
Add dispatch_indirect to AutoCommandBufferBuilder (#1516)
* Add dispatch_indirect to AutoCommandBufferBuilder

* Merge branch 'master' of https://github.com/vulkano-rs/vulkano into dispatch-indirect

* Pfff...

* Fix bug in dispatch_indirect assert
2021-03-30 21:18:45 +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
c38f484baa
Fix panic string literal warnings (#1515) 2021-03-28 17:46:55 +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
Rua
4a58b34545
UnsafeCommandBuffer and SyncCommandBuffer no longer contain a command pool reference (#1504) 2021-03-15 02:49:07 +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
Okko Hakola
0e581c07b2
Allow external memory support with DeviceLocalBuffers (#1506)
* Add posix handle type shortcut

* Expose device local buffer's memory

* Add exportable memory option for pools & device local memory

* Add test for device local with exportable fd

* Use a convenience function in test

* Dont expose memory, but instead allow export fd directly

* Fix mistakes & clean

* Remove test due to IncompatibleDriver error
2021-03-14 20:56:27 +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
Ilya Lakhin
5b4aee845b Missing changelogs 2021-03-14 18:35:50 +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
Rua
3da1a3fd8d
Replace deprecated compare_and_swap (#1498) 2021-03-14 16:41:49 +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