summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar liamwhite2023-02-09 22:14:55 -0500
committerGravatar GitHub2023-02-09 22:14:55 -0500
commitc5743d5499db336718b93a6954ec1168c660fbec (patch)
tree5a5e94006a7dc5f3f13a6147c2253735e4e7c171 /src/video_core/renderer_vulkan
parentMerge pull request #9750 from ameerj/glsl-sample-id-mask (diff)
parentRemove fake vertex bindings when dynamic state is enabled (diff)
downloadyuzu-c5743d5499db336718b93a6954ec1168c660fbec.tar.gz
yuzu-c5743d5499db336718b93a6954ec1168c660fbec.tar.xz
yuzu-c5743d5499db336718b93a6954ec1168c660fbec.zip
Merge pull request #9736 from Kelebek1/dynamic_vertex_attribs
Remove fake vertex bindings when dynamic state is enabled
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index f91bb5a1d..baedc4424 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -548,31 +548,7 @@ void GraphicsPipeline::MakePipeline(VkRenderPass render_pass) {
548 static_vector<VkVertexInputBindingDescription, 32> vertex_bindings; 548 static_vector<VkVertexInputBindingDescription, 32> vertex_bindings;
549 static_vector<VkVertexInputBindingDivisorDescriptionEXT, 32> vertex_binding_divisors; 549 static_vector<VkVertexInputBindingDivisorDescriptionEXT, 32> vertex_binding_divisors;
550 static_vector<VkVertexInputAttributeDescription, 32> vertex_attributes; 550 static_vector<VkVertexInputAttributeDescription, 32> vertex_attributes;
551 if (key.state.dynamic_vertex_input) { 551 if (!key.state.dynamic_vertex_input) {
552 const size_t num_vertex_arrays = std::min(
553 key.state.attributes.size(), static_cast<size_t>(device.GetMaxVertexInputBindings()));
554 for (size_t index = 0; index < num_vertex_arrays; ++index) {
555 const u32 type = key.state.DynamicAttributeType(index);
556 if (!stage_infos[0].loads.Generic(index) || type == 0) {
557 continue;
558 }
559 vertex_attributes.push_back({
560 .location = static_cast<u32>(index),
561 .binding = 0,
562 .format = type == 1 ? VK_FORMAT_R32_SFLOAT
563 : type == 2 ? VK_FORMAT_R32_SINT
564 : VK_FORMAT_R32_UINT,
565 .offset = 0,
566 });
567 }
568 if (!vertex_attributes.empty()) {
569 vertex_bindings.push_back({
570 .binding = 0,
571 .stride = 4,
572 .inputRate = VK_VERTEX_INPUT_RATE_VERTEX,
573 });
574 }
575 } else {
576 const size_t num_vertex_arrays = std::min( 552 const size_t num_vertex_arrays = std::min(
577 Maxwell::NumVertexArrays, static_cast<size_t>(device.GetMaxVertexInputBindings())); 553 Maxwell::NumVertexArrays, static_cast<size_t>(device.GetMaxVertexInputBindings()));
578 for (size_t index = 0; index < num_vertex_arrays; ++index) { 554 for (size_t index = 0; index < num_vertex_arrays; ++index) {