Commit Graph

2699 Commits

Author SHA1 Message Date
Ilya Lakhin
ff1dd87a32
Changelog for #1489 2021-02-11 04:16:35 +07:00
Philipp Renoth
9046655752
add DeviceExtensions::required_extensions(phys) (#1489) 2021-02-11 04:09:39 +07:00
A. Cody Schuffelen
6af7ece14c
Fix reuse command buffers test (#1491)
* Fix file out of alignment with `cargo fmt`.

* Make the reuse_command_buffers test more stable.

The per-thread weak reference to StandardCommandPoolPerThread in
StandardCommandPool can expire forcing the recreation of the pool and
its internal objects. This is a problem for the reuse_command_buffers
test which asserts that a destroyed command pool must be reused if
possible.

This change fixes the test by introducing an extra command buffer that
is held through the rest of the test, introducing an extra strong
reference to the command pool that keeps the weak reference alive for
the duration of the test.

This test fails consistently on my machine with a NVidia 1070 Max-Q
otherwise.
2021-02-10 20:55:08 +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
EthanYidong
c57e2f471b
Replace filter map (#1486)
* Replace map to filter_map to prevent panics

* cargo fmt

* Update changelog

* Update docs to reflect changes
2021-02-08 18:43:56 +07:00
Rua
4a98caacbf
Update various dependencies (#1483) 2021-02-06 02:35:24 +07:00
Arc'blroth
bcdbd35ec9
Fix descriptor pool allocation for layouts that contain arrays (#1481)
Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2021-02-06 02:30:24 +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
gurchetansingh
34d54547f2
vulkano: image: add image usage check (#1479)
We never really validated this yet ...
2021-02-05 22:19:14 +07:00
gurchetansingh
f1b81a0514
vulkano: memory: fix opaque fd support (#1477)
Don't panic if user doesn't request dma-buf and dma-buf
isn't present on the system.

Fixes: 2d60c08c10 ("Initial YUV and external memory support")
2021-01-21 15:23:45 +07:00
Arc'blroth
ccb5a1091b
Store shader bytecode as a static rather than on the stack. This fixes stack overflow errors for large shaders. (#1476)
Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2021-01-18 08:38:29 +07:00
funmaker
8c6ff4aba9
Fixed race condition in StandardCommandPool when allocating buffers. (#1474) 2021-01-17 08:19:29 +07:00
stephan-cr
3e990190f7
Fix invalid reference to dropped PipelineCache object in ComputePipeline (#1469)
* Fix invalid reference to dropped cache object in compute pipeline

This is achieved by preventing the cache object from being partially
moved.

This fixes issue #1466.

* Add entry to changelog
2021-01-11 23:16:06 +07:00
gurchetansingh
2d60c08c10
Initial YUV and external memory support (#1467)
* vulkano: image: improve formatting

Ran cargo fmt --all.  Should we use clippy too ?

* vk_sys: add additional formats

This updates the vk formats enum to the header that's on my
system (vk 1.2-ish).

* vulkano: image: Add NV12 and YV12 support

These formats are commonly used as targets for hardware and
software video decode.  The common case is the swapchain allocator
(gralloc in the Android use case) allocates some memory, the video
stack decodes to it, and then memory can be composited by Vulkan
or sent directly to the display.

* vk_sys: update structure types

This updates the structure types to a VK 1.2-ish state.  Long term,
it makes a ton of sense to autogenerate vk-sys to make adding
additional features and enumerations easier [1].  For now, we can
hand edit.

[1] (https://github.com/vulkano-rs/vulkano/issues/89)

* vk_sys: add VK_KHR_external_memory_fd bindings

This adds some basic external memory features.  Most of these
features are core in VK1.1.

* vulkano: memory: add and use DeviceMemoryBuilder

We'll need to:

(a) Create exportable memory
(b) import from a OS descriptor to create DeviceMemory
(c) Also support dedicated allocations

The device memory API is becoming rather complicated.  Let's use
the common builder pattern to simplify this.

* vulkano: memory: implement some external features

This change is sufficient to create exportable memory and
export it.  It's only been tested on Linux platforms and depends
on Unix file descriptors, so enable it only there for now.

Import support will be added later.  Support for external buffers
and images can also be added later if someone needs it.
2021-01-09 19:02:08 +07:00
Austin Johnson
3113d1fea5
remove trailing whitespace in github workflows file (#1463) 2020-12-26 16:44:54 -06:00
Ilya Lakhin
de01dff7c8 Vulkano version bump to 0.20.0 and vk-sys to 0.5.3 2020-12-26 19:25:09 +07:00
Ilya Lakhin
9f2257e83e
Update Readme Build Status badge 2020-12-21 07:44:14 +07:00
Sam Blazes
e03a80d341
Fix Cubemap and CubemapArray framebuffer attachments (#1459)
* change framebuffer attachment dimensions so cubemap and cubemap arrays are properly cleared

* update changelog
2020-12-20 17:27:15 +07:00
Ilya Lakhin
af3ea98d5e
Shader types derive (#1460)
* Shader struct types derives and impls

* Vulkano Shaders fixes and cleanup. Example for Types-meta option

* Changelog update

* cargo fmt
2020-12-20 12:08:55 +07:00
Rua
ba6fe09155
Upgrade to winit 0.24 (#1457)
* Upgrade to winit 0.24

* Changelog
2020-12-20 05:57:57 +07:00
Arc'blroth
6e0e87f222
Fix vulkano-shaders bytes documentation (#1458)
Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2020-12-20 05:55:42 +07:00
Arc'blroth
c2495404b2
Add support for including precompiled shaders in vulkano-shaders (#1455)
Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
2020-12-19 10:22:04 +07:00
qnope
d90106d4df
[Vulkano-1441] Adding the possibility to generate mipmaps at image (#1451)
creation

To do so, we created a SubImage that implements the ImageAccess trait
This SubImage will decorate an ImageAccess image and will represent
one or more mip level / array layer level
2020-12-19 10:08:48 +07:00
Robin Heinemann
d8f1e77502
Add 8bit storage support (#1452) 2020-12-09 05:36:14 +07:00
Robin Heinemann
63aaa853ff
CpuAccessibleBuffer: switch to parking_lot RwLock (#1450)
This allows ReadLock and WriteLock to be Send and Sync.
2020-12-09 05:23:14 +07:00
Jan Tebernum
782272c08d
Unlock images correctly on Err (#1449)
* Unlock images correctly on Err

If the CommandBuffer encountered an error in the lock_submit function,
it would unlock all the previously locked resources and return the
error. It would unlock all the images with a None value which would
panic in an assertion in the unlock method of the images. Now it checks
for the final_layout and unlocks the image this way.
This change should help with the panics mentioned in #1441 and #1447.
With this fix it should return the error that is occuring instead of
panicking.

* Add fix to the change log to inform users.
2020-12-05 06:28:01 +07:00
Ivan Zvonimir Horvat
9320d97115
examples: bin; pipeline_caching, add underscore for unused var (#1448) 2020-12-03 22:44:10 +07:00
Rua
a5553e14e1
Check usage bits on image when creating image view (#1444)
* Check usage bits on image when creating image view

* Changelog entry
2020-12-03 22:36:59 +07:00
Jan Tebernum
dea9a421d0
Finish pipeline cache (#1443)
* Implement caching for GraphicsPipeline

Added the method build_with_cache to set an Option that holds an Arc
containing a PipelineCache. This could probably be optimized to just
hold a vk::PipelineCache(u64) and start with a vk::NULL_HANDLE and
set the value to the internal_object of the PipelineCache. Using the Arc
is probably safer for now, but it is an idea.

* Add changes to the CHANGELOG

* Added a cache option to the ComputePipeline

This is a breaking change as there is no ComputePipelineBuilder and the
cache has to be added in the new function and the underlying functions
that build the ComputePipeline.
This needs to be discussed.

* Document the cache feature for the ComputePipeline

* Formatting with cargo fmt

* Remove outdated documentation

* Added testing for the PipelineCache

Checking that the cache returns the same data if the get_data method is
invoked twice without building a new pipeline.
Checking that the cache returns the same data if the same pipeline is
built two times with the cache.
Checking that the cache returns different data if there is a different
pipeline built in between the get_data calls.

* Create an example for the PipelineCache

* Formatting
2020-11-29 15:40:44 +07:00
Cassiano Honorio da Silva
620b829bdb
Rename feature shader_f3264 to shader_float64 (#1440)
Fixes shader_f3264 device feature name
2020-11-23 17:34:02 +07:00
Matej Kormuth
4ebc2c8211
add debug_marker_{begin, end, insert} methods (#1439) 2020-11-20 07:40:07 +07:00
Austin Johnson
3ecaaf5f48
Update examples to winit 0.23 (#1438) 2020-11-10 14:32:29 -06:00
Travis Finkenauer
ccd22a4aa4
Convert HTTP links to HTTPS (#1397)
* Convert readme HTTP links to HTTPS

* Convert source files' URLs to HTTPS
2020-11-10 11:03:50 -06:00
Rua
f5d6dff620
Bump winit to 0.23 (#1427) 2020-11-10 11:01:42 -06:00
Rua
862593abae
Some safety checks for AutoCommandBufferBuilder::execute_commands (#1431)
* Move SubpassContents to command_buffer module, use it as parameter type instead of bool, add RenderPassState internally

* Add some safety checks to execute_commands

* Move Kind and related types to top-level module, add CommandBuffer::kind trait method, keep Kind value in AutoCommandBuffer(Builder)

* Some minor code cleanup

* Documentation update
2020-11-10 11:01:13 -06:00
Austin Johnson
3a473699eb
github actions (#1437) 2020-11-10 10:29:09 -06:00
Ivan Zvonimir Horvat
6f67a70fb1
1418: unsafe array; pass-by-ref (#1436) 2020-11-10 09:57:00 -06:00
Federico Morrone
3892ed7e32
Added arch example in Readme (#1419) 2020-10-25 19:33:59 +07:00
Ilya Lakhin
770ea22bb8
Changelog entry for PR #1410 and turning off Travis Linux Nightly build job (#1424)
Changelog entry for PR #1410; Nightly build temporary disabled until #1423 resolved
2020-10-25 19:30:44 +07:00
Tetrel
70186b5034
Copy buffer dimensions (#1407)
Add a method to AutoCommandBufferBuilder that allows copying elements of buffers containing arrays
2020-10-08 14:31:32 +07:00
sburton84
3449bee270
Call the correct surface creation function on Windows. (#1410)
On Windows 'Surface::from_hwnd' should be called rather than 'Surface::from_wayland'.
2020-10-08 14:23:16 +07:00
Colin Marc
aa1f402c9d
Update MoltenVK setup instructions (#1385) 2020-06-12 11:13:17 -05:00
Antonino Siena
b0c8eca283
Improve vulkano-win (#1386)
* Use winit's hinstance() function

* Require HasRawWindowHandle for the window and remove handle parameter

Co-authored-by: Antonino Siena <a.siena@gmx.de>
2020-06-12 11:12:47 -05:00
Antonino Siena
c5dd6eda3e
Feature: Create a Surface from a RawWindowHandle (#1381)
* Feature: Create a Surface from a RawWindowHandle

* Comment on the new features

* Updated changelog

* Corrected feature name

* Compiler error corrections

* Empty commit for CI

Co-authored-by: Antonino Siena <a.siena@gmx.de>
2020-06-09 03:23:22 -05:00
Richard Diamond
cf669bb6be
Support a number of SPIRV capability related features. (#1382) 2020-06-08 21:00:56 -05:00
Trangar
737016c047
Ran rustfmt and added rustfmt checkbox to pull req template (#1367)
* Ran rustfmt, updated PULL_REQUEST_TEMPLATE.md  and added a rustfmt check to CI

* Disabled the travis rustfmt check
2020-06-04 13:47:34 -05:00
Rua
e4e324d632
Add properties method to Format (#1379)
* Add properties method to Format

* Documentation

* Changelog
2020-06-04 13:41:39 -05:00
Austin Johnson
eee101bc4d
publish 0.18.1 && vk-sys 0.5.2 (#1374) 2020-06-01 13:52:18 -05:00
Rua
1f27ab3ea9
AutoCommandBufferBuilder takes &mut self instead of self (#1376)
* AutoCommandBufferBuilder takes &mut self instead of self

* Changelog message
2020-06-01 09:41:42 -05:00
Austin Johnson
a4591a20cf
update examples to use ImageUsage::color_attachment instead of caps.supported_usage_flags (#1373)
* add additional ImageUsage constructors

* update examples to use ImageUsage::color_attachment instead of caps.supported_usage_flags

* fix additional usage in multi-window example

* update ignore to not include mandelbrot.png and triangle.png

* update ignore to not include mandelbrot.png and triangle.png
2020-06-01 02:10:02 -05:00