summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-03-27 04:59:58 -0300
committerGravatar ameerj2021-07-22 21:51:24 -0400
commitdbd882ddeb1a1a9233c0085d0b8ccb022db385b2 (patch)
tree5a8456364cc41a0a53acf93e22e3f9ce855bd413 /src/video_core/renderer_vulkan
parentspirv: Remove dependencies on Environment when generating SPIR-V (diff)
downloadyuzu-dbd882ddeb1a1a9233c0085d0b8ccb022db385b2.tar.gz
yuzu-dbd882ddeb1a1a9233c0085d0b8ccb022db385b2.tar.xz
yuzu-dbd882ddeb1a1a9233c0085d0b8ccb022db385b2.zip
shader: Better interpolation and disabled attributes support
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index 82536b9d6..278509bf0 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -221,10 +221,10 @@ void GraphicsPipeline::MakePipeline(const Device& device, const FixedPipelineSta
221 } 221 }
222 } 222 }
223 static_vector<VkVertexInputAttributeDescription, 32> vertex_attributes; 223 static_vector<VkVertexInputAttributeDescription, 32> vertex_attributes;
224 const auto& input_attributes = stage_infos[0].loads_generics; 224 const auto& input_attributes = stage_infos[0].input_generics;
225 for (size_t index = 0; index < state.attributes.size(); ++index) { 225 for (size_t index = 0; index < state.attributes.size(); ++index) {
226 const auto& attribute = state.attributes[index]; 226 const auto& attribute = state.attributes[index];
227 if (!attribute.enabled || !input_attributes[index]) { 227 if (!attribute.enabled || !input_attributes[index].used) {
228 continue; 228 continue;
229 } 229 }
230 vertex_attributes.push_back({ 230 vertex_attributes.push_back({
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 251559b16..69dd945b2 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -755,6 +755,9 @@ ComputePipeline PipelineCache::CreateComputePipeline(ShaderPools& pools,
755} 755}
756 756
757static Shader::AttributeType CastAttributeType(const FixedPipelineState::VertexAttribute& attr) { 757static Shader::AttributeType CastAttributeType(const FixedPipelineState::VertexAttribute& attr) {
758 if (attr.enabled == 0) {
759 return Shader::AttributeType::Disabled;
760 }
758 switch (attr.Type()) { 761 switch (attr.Type()) {
759 case Maxwell::VertexAttribute::Type::SignedNorm: 762 case Maxwell::VertexAttribute::Type::SignedNorm:
760 case Maxwell::VertexAttribute::Type::UnsignedNorm: 763 case Maxwell::VertexAttribute::Type::UnsignedNorm: