From 707523c67938ef42f266afb144303202d345f642 Mon Sep 17 00:00:00 2001 From: raven02 Date: Mon, 22 Aug 2016 23:14:32 +0800 Subject: [PATCH] Vulkan: set ColorBlendState info (used by logicOp) (#2080) * Vulkan: set ColorBlendState info (used by logicOp) * fix attachmentCount --- rpcs3/Emu/RSX/VK/VKGSRender.cpp | 3 +++ rpcs3/Emu/RSX/VK/VKProgramBuffer.h | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/RSX/VK/VKGSRender.cpp b/rpcs3/Emu/RSX/VK/VKGSRender.cpp index f9ebfa5d88..c08ebcf182 100644 --- a/rpcs3/Emu/RSX/VK/VKGSRender.cpp +++ b/rpcs3/Emu/RSX/VK/VKGSRender.cpp @@ -926,6 +926,9 @@ bool VKGSRender::load_program() } } + properties.cs.attachmentCount = m_draw_buffers_count; + properties.cs.pAttachments = properties.att_state; + if (rsx::method_registers.logic_op_enabled()) { properties.cs.logicOpEnable = true; diff --git a/rpcs3/Emu/RSX/VK/VKProgramBuffer.h b/rpcs3/Emu/RSX/VK/VKProgramBuffer.h index 3cacf6cee3..1f48a77e90 100644 --- a/rpcs3/Emu/RSX/VK/VKProgramBuffer.h +++ b/rpcs3/Emu/RSX/VK/VKProgramBuffer.h @@ -57,6 +57,7 @@ namespace std seed ^= hash_struct(pipelineProperties.ia); seed ^= hash_struct(pipelineProperties.ds); seed ^= hash_struct(pipelineProperties.rs); + seed ^= hash_struct(pipelineProperties.cs); seed ^= hash_struct(pipelineProperties.att_state[0]); return hash()(seed); } @@ -122,18 +123,13 @@ struct VKTraits ms.pSampleMask = NULL; ms.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; - VkPipelineColorBlendStateCreateInfo cb = {}; - cb.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; - cb.attachmentCount = 1; - cb.pAttachments = pipelineProperties.att_state; - VkPipeline pipeline; VkGraphicsPipelineCreateInfo info = {}; info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; info.pVertexInputState = &vi; info.pInputAssemblyState = &pipelineProperties.ia; info.pRasterizationState = &pipelineProperties.rs; - info.pColorBlendState = &cb; + info.pColorBlendState = &pipelineProperties.cs; info.pMultisampleState = &ms; info.pViewportState = &vp; info.pDepthStencilState = &pipelineProperties.ds;