Commit Graph

76 Commits

Author SHA1 Message Date
Józef Kucia 7e5dd39f5f libs/vkd3d: Prefer VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL.
Use VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL if depth/stencil
writes are disabled.
2017-10-30 14:04:53 +01:00
Józef Kucia 2b21fbf6b8 libs/vkd3d: Add VKD3D_SHADER_DUMP_PATH environment variable for dumping shaders.
A similar functionality was helpful numerous number of times when
developing libvkd3d-shader.
2017-10-24 15:22:01 +02:00
Józef Kucia f4cfebcd7e libs/vkd3d: Remove hack for creating root signatures from description. 2017-10-10 16:02:09 +02:00
Józef Kucia 5b5cffcf84 libs/vkd3d: Implement creating root signature from bytecode. 2017-10-10 16:02:09 +02:00
Józef Kucia 5a020d6673 libs/vkd3d-shader: Implement shader visibility for descriptors. 2017-09-22 16:42:07 +02:00
Józef Kucia 8cb004bdc4 libs/vkd3d: Create single default sampler per device. 2017-09-21 15:12:13 +02:00
Józef Kucia cfa827b2f8 libs/vkd3d: Call compute_input_layout_offsets() unconditionally. 2017-09-21 15:12:13 +02:00
Józef Kucia acfd64c20e libs/vkd3d: Avoid copying descriptors for dirty root descriptor tables. 2017-09-18 15:40:42 +02:00
Józef Kucia 2425e2939a libs/vkd3d: Match input layout elements with vertex shader inputs. 2017-09-11 22:35:16 +02:00
Józef Kucia cd99601b3c libs/vkd3d: Implement offset computation for D3D12_APPEND_ALIGNED_ELEMENT. 2017-09-11 22:35:16 +02:00
Józef Kucia 8e802ed0af libs/vkd3d: Update descriptor table ranges only with matching descriptor types. 2017-09-11 22:35:16 +02:00
Józef Kucia 32966338df libs/vkd3d: Get rid of UAV counter count from d3d12_pipeline_state. 2017-09-08 15:30:48 +02:00
Józef Kucia 9afaed918d libs/vkd3d: Bind descriptor set for UAV counters. 2017-09-08 15:04:30 +02:00
Józef Kucia 0d28036d2a libs/vkd3d: Add UAV counter support for compute pipelines.
UAV counter descriptors are stored in a separate VkDescriptorSet.
A VkPipelineLayout created for compute pipeline is compatible for all
other descriptor sets with the VkPipelineLayout created for the root
signature. This ensures that only UAV counter bindings in the last
descriptor set may be disturbed when switching between pipelines with
compatible root signatures.

The implementation of vkd3d_popcount() is based on
https://graphics.stanford.edu/~seander/bithacks.html
2017-09-08 15:04:30 +02:00
Józef Kucia 7416c83ae2 libs/vkd3d-shader: Rename vkd3d_descriptor_type to vkd3d_shader_descriptor_type. 2017-09-07 17:15:54 +02:00
Józef Kucia efdf2ec691 libs/vkd3d-shader: Rename vkd3d_shader_push_constant to vkd3d_shader_push_constant_buffer.
This should be clearer. Multiple constant buffers can be assigned to
a single push constant range.
2017-09-07 17:15:54 +02:00
Józef Kucia bd0c886281 libs/vkd3d: Store push constant ranges in root signatures.
In prep for UAV counters support.
2017-09-07 17:15:54 +02:00
Józef Kucia ce8a0290b4 libs/vkd3d: Factor out vkd3d_create_pipeline_layout() function. 2017-09-07 17:15:54 +02:00
Józef Kucia 22b019137b libs/vkd3d: Factor out vkd3d_create_descriptor_set_layout() function. 2017-09-07 17:15:53 +02:00
Józef Kucia f587670445 libs/vkd3d: Drop support for SPIR-V shaders. 2017-09-07 17:15:53 +02:00
Józef Kucia 9eee65c3ab libs/vkd3d: Validate root signature size. 2017-09-05 11:53:55 +02:00
Józef Kucia 62bd4e6e63 libs/vkd3d: Add support for OffsetInDescriptorsFromTableStart. 2017-08-31 11:21:34 +02:00
Henri Verbeet 3019a3e8f1 libs/vkd3d: Support both native and Win32 wchar_t. 2017-08-29 16:36:05 +02:00
Józef Kucia 92bb7969a5 libs/vkd3d: Create push descriptor set only if needed. 2017-08-18 17:08:56 +02:00
Józef Kucia 1d5b8b7d32 libs/vkd3d: Implement depth/stencil resource views. 2017-08-16 17:38:33 +02:00
Józef Kucia f5515c46df libs/vkd3d: Create default sampler for each root signature.
We need a sampler for SpvOpImageFetch aka texelFetch().
2017-08-16 13:11:52 +02:00
Józef Kucia e3d6bac31b libs/vkd3d-shader: Introduce vkd3d_shader_interface structure. 2017-08-16 13:11:52 +02:00
Józef Kucia 32e69fa945 libs/vkd3d: Use KHR_push_descriptor for root descriptors.
Thanks to KHR_push_descriptor, we do not have to allocate descriptor
sets for subsequent root descriptor parameters updates.
2017-08-11 13:58:04 +02:00
Józef Kucia 5a9b625522 libs/vkd3d: Factor out d3d12_root_signature_init_root_descriptor_tables() function. 2017-08-11 13:58:04 +02:00
Józef Kucia cc0cfb5a81 libs/vkd3d: Factor out d3d12_root_signature_init_root_descriptors() function.
Root descriptors are going to be assigned to a separate descriptor set
in order to be used with VK_KHR_push_descriptor.
2017-08-11 13:58:04 +02:00
Józef Kucia e3cdf5226f libs/vkd3d: Factor out d3d12_root_signature_init_static_samplers() function. 2017-08-11 13:58:04 +02:00
Józef Kucia 9c2b126f38 libs/vkd3d: Factor out d3d12_root_signature_init_descriptor_pool_size(). 2017-08-11 13:58:04 +02:00
Józef Kucia 69745d1c08 libs/vkd3d: Fix mapping for SRV/UAV root descriptors. 2017-08-11 13:58:04 +02:00
Józef Kucia b0e47baebf libs/vkd3d: Implement d3d12_command_list_Set{Compute,Graphics}RootUnorderedAccessView(). 2017-08-09 18:44:16 +02:00
Józef Kucia 2665cbe522 libs/vkd3d: Duplicate Vulkan descriptors for SRVs and UAVs.
Vulkan has different descriptor types for buffers and textures.
Therefore, we do not know the exact Vulkan descriptor type for D3D12 SRV
and UAV descriptors up front. This information can be extracted from
shaders when creating PSOs but creating incompatible Vulkan descriptor
set layouts for PSOs with the same root signature would introduce a lot
of complexity.

In order to preserve compatibility between resource bindings for PSOs
with the same root signature we duplicate Vulkan descriptors for SRVs
and UAVs (a buffer view and an image view descriptor). This strategy may
be reasonable for small root signatures.
2017-08-08 17:09:35 +02:00
Józef Kucia 1b02322c1d libs/vkd3d: Overallocate descriptors for SRV and UAV descriptor ranges. 2017-08-08 17:09:35 +02:00
Józef Kucia 3eb5e59e37 libs/vkd3d: Count buffer SRVs and UAVs separately.
SRV and UAV root parameters are buffer views.
2017-08-08 17:09:35 +02:00
Józef Kucia cdc5cd499f libs/vkd3d: Avoid potential double free. 2017-08-07 14:53:51 +02:00
Józef Kucia fa0a2eab21 libs/vkd3d: Store Vulkan bindings for descriptor table root parameters in root signature. 2017-08-04 17:06:33 +02:00
Józef Kucia 573460550e libs/vkd3d: Do not assume CBV root parameter index is equal to Vulkan descriptor binding. 2017-08-02 15:30:15 +02:00
Józef Kucia cd75aab7ba libs/vkd3d: Factor out d3d12_root_signature_init_push_constants() helper function. 2017-08-01 10:51:45 +02:00
Józef Kucia 40cb21353e libs/vkd3d: Extract descriptors counting to helper function. 2017-08-01 10:51:45 +02:00
Józef Kucia 3e91bc7c2d libs/vkd3d: Fix push constant ranges allocation.
Any two push constant ranges must not include the same stage.
2017-08-01 10:51:45 +02:00
Józef Kucia d75966ab9e libs/vkd3d: Assign non-overlapping push constant ranges for root constants. 2017-08-01 10:51:45 +02:00
Józef Kucia e074c30dc7 libs/vkd3d: Pass push constants mapping to shader compiler. 2017-07-28 10:19:37 +02:00
Józef Kucia 72f723522e libs/vkd3d: Implement d3d12_command_list_SetComputeRoot32BitConstant(). 2017-07-28 10:19:37 +02:00
Józef Kucia 92fcb9ffa2 libs/vkd3d-shader: Add support for push constants. 2017-07-27 15:24:38 +02:00
Józef Kucia bb80c759fc libs/vkd3d: Introduce d3d12_root_signature_cleanup() helper function.
Reduces code duplication.
2017-07-27 14:19:41 +02:00
Józef Kucia e3d3819789 libs/vkd3d: Fix copy-paste error in d3d12_root_signature_init(). 2017-07-26 16:09:40 +02:00
Józef Kucia 1589ce7682 libs/vkd3d: Fix Vulkan bindings assignment.
Fixes 6d569fcbc6,
2017-07-26 14:50:39 +02:00