|
|
|
@ -5,6 +5,7 @@ |
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <array>
|
|
|
|
|
|
|
|
#include "video_core/renderer_vulkan/vk_texture_cache.h"
|
|
|
|
|
|
|
|
@ -135,15 +136,18 @@ VkPipelineInputAssemblyStateCreateInfo GetPipelineInputAssemblyStateCreateInfo(c |
|
|
|
.primitiveRestartEnable = device.IsMoltenVK() ? VK_TRUE : VK_FALSE, |
|
|
|
}; |
|
|
|
} |
|
|
|
constexpr VkPipelineViewportStateCreateInfo PIPELINE_VIEWPORT_STATE_CREATE_INFO{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
.flags = 0, |
|
|
|
.viewportCount = 1, |
|
|
|
.pViewports = nullptr, |
|
|
|
.scissorCount = 1, |
|
|
|
.pScissors = nullptr, |
|
|
|
}; |
|
|
|
VkPipelineViewportStateCreateInfo GetPipelineViewportStateCreateInfo(const Device& device) { |
|
|
|
const u32 viewport_count = device.GetViewportCount(); |
|
|
|
return VkPipelineViewportStateCreateInfo{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
.flags = 0, |
|
|
|
.viewportCount = viewport_count, |
|
|
|
.pViewports = nullptr, |
|
|
|
.scissorCount = viewport_count, |
|
|
|
.pScissors = nullptr, |
|
|
|
}; |
|
|
|
} |
|
|
|
constexpr VkPipelineRasterizationStateCreateInfo PIPELINE_RASTERIZATION_STATE_CREATE_INFO{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -361,7 +365,7 @@ void UpdateTwoTexturesDescriptorSet(const Device& device, VkDescriptorSet descri |
|
|
|
device.GetLogical().UpdateDescriptorSets(write_descriptor_sets, nullptr); |
|
|
|
} |
|
|
|
|
|
|
|
void BindBlitState(vk::CommandBuffer cmdbuf, const Region2D& dst_region) { |
|
|
|
void BindBlitState(const Device& device, vk::CommandBuffer cmdbuf, const Region2D& dst_region) { |
|
|
|
const VkOffset2D offset{ |
|
|
|
.x = (std::min)(dst_region.start.x, dst_region.end.x), |
|
|
|
.y = (std::min)(dst_region.start.y, dst_region.end.y), |
|
|
|
@ -383,13 +387,17 @@ void BindBlitState(vk::CommandBuffer cmdbuf, const Region2D& dst_region) { |
|
|
|
.offset = offset, |
|
|
|
.extent = extent, |
|
|
|
}; |
|
|
|
cmdbuf.SetViewport(0, viewport); |
|
|
|
cmdbuf.SetScissor(0, scissor); |
|
|
|
const u32 viewport_count = device.GetViewportCount(); |
|
|
|
const std::array<VkViewport, 2> viewports{viewport, viewport}; |
|
|
|
const std::array<VkRect2D, 2> scissors{scissor, scissor}; |
|
|
|
cmdbuf.SetViewport(0, vk::Span<VkViewport>(viewports.data(), viewport_count)); |
|
|
|
cmdbuf.SetScissor(0, vk::Span<VkRect2D>(scissors.data(), viewport_count)); |
|
|
|
} |
|
|
|
|
|
|
|
void BindBlitState(vk::CommandBuffer cmdbuf, VkPipelineLayout layout, const Region2D& dst_region, |
|
|
|
const Region2D& src_region, const Extent3D& src_size = {1, 1, 1}) { |
|
|
|
BindBlitState(cmdbuf, dst_region); |
|
|
|
void BindBlitState(const Device& device, vk::CommandBuffer cmdbuf, VkPipelineLayout layout, |
|
|
|
const Region2D& dst_region, const Region2D& src_region, |
|
|
|
const Extent3D& src_size = {1, 1, 1}) { |
|
|
|
BindBlitState(device, cmdbuf, dst_region); |
|
|
|
const float scale_x = static_cast<float>(src_region.end.x - src_region.start.x) / |
|
|
|
static_cast<float>(src_size.width); |
|
|
|
const float scale_y = static_cast<float>(src_region.end.y - src_region.start.y) / |
|
|
|
@ -559,7 +567,7 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, const ImageV |
|
|
|
cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); |
|
|
|
cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, |
|
|
|
nullptr); |
|
|
|
BindBlitState(cmdbuf, layout, dst_region, src_region); |
|
|
|
BindBlitState(device, cmdbuf, layout, dst_region, src_region); |
|
|
|
cmdbuf.Draw(3, 1, 0, 0); |
|
|
|
}); |
|
|
|
scheduler.InvalidateState(); |
|
|
|
@ -585,7 +593,7 @@ void BlitImageHelper::BlitColor(const Framebuffer* dst_framebuffer, VkImageView |
|
|
|
cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); |
|
|
|
cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, |
|
|
|
nullptr); |
|
|
|
BindBlitState(cmdbuf, layout, dst_region, src_region, src_size); |
|
|
|
BindBlitState(device, cmdbuf, layout, dst_region, src_region, src_size); |
|
|
|
cmdbuf.Draw(3, 1, 0, 0); |
|
|
|
cmdbuf.EndRenderPass(); |
|
|
|
}); |
|
|
|
@ -621,7 +629,7 @@ void BlitImageHelper::BlitDepthStencil(const Framebuffer* dst_framebuffer, |
|
|
|
cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); |
|
|
|
cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, |
|
|
|
nullptr); |
|
|
|
BindBlitState(cmdbuf, layout, dst_region, src_region); |
|
|
|
BindBlitState(device, cmdbuf, layout, dst_region, src_region); |
|
|
|
cmdbuf.Draw(3, 1, 0, 0); |
|
|
|
}); |
|
|
|
scheduler.InvalidateState(); |
|
|
|
@ -702,13 +710,13 @@ void BlitImageHelper::ClearColor(const Framebuffer* dst_framebuffer, u8 color_ma |
|
|
|
const VkPipelineLayout layout = *clear_color_pipeline_layout; |
|
|
|
scheduler.RequestRenderpass(dst_framebuffer); |
|
|
|
scheduler.Record( |
|
|
|
[pipeline, layout, color_mask, clear_color, dst_region](vk::CommandBuffer cmdbuf) { |
|
|
|
[pipeline, layout, color_mask, clear_color, dst_region, this](vk::CommandBuffer cmdbuf) { |
|
|
|
cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); |
|
|
|
const std::array blend_color = { |
|
|
|
(color_mask & 0x1) ? 1.0f : 0.0f, (color_mask & 0x2) ? 1.0f : 0.0f, |
|
|
|
(color_mask & 0x4) ? 1.0f : 0.0f, (color_mask & 0x8) ? 1.0f : 0.0f}; |
|
|
|
cmdbuf.SetBlendConstants(blend_color.data()); |
|
|
|
BindBlitState(cmdbuf, dst_region); |
|
|
|
BindBlitState(device, cmdbuf, dst_region); |
|
|
|
cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_color); |
|
|
|
cmdbuf.Draw(3, 1, 0, 0); |
|
|
|
}); |
|
|
|
@ -728,11 +736,11 @@ void BlitImageHelper::ClearDepthStencil(const Framebuffer* dst_framebuffer, bool |
|
|
|
const VkPipeline pipeline = FindOrEmplaceClearStencilPipeline(key); |
|
|
|
const VkPipelineLayout layout = *clear_color_pipeline_layout; |
|
|
|
scheduler.RequestRenderpass(dst_framebuffer); |
|
|
|
scheduler.Record([pipeline, layout, clear_depth, dst_region](vk::CommandBuffer cmdbuf) { |
|
|
|
scheduler.Record([pipeline, layout, clear_depth, dst_region, this](vk::CommandBuffer cmdbuf) { |
|
|
|
constexpr std::array blend_constants{0.0f, 0.0f, 0.0f, 0.0f}; |
|
|
|
cmdbuf.SetBlendConstants(blend_constants.data()); |
|
|
|
cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); |
|
|
|
BindBlitState(cmdbuf, dst_region); |
|
|
|
BindBlitState(device, cmdbuf, dst_region); |
|
|
|
cmdbuf.PushConstants(layout, VK_SHADER_STAGE_FRAGMENT_BIT, clear_depth); |
|
|
|
cmdbuf.Draw(3, 1, 0, 0); |
|
|
|
}); |
|
|
|
@ -775,8 +783,11 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb |
|
|
|
cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); |
|
|
|
cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, |
|
|
|
nullptr); |
|
|
|
cmdbuf.SetViewport(0, viewport); |
|
|
|
cmdbuf.SetScissor(0, scissor); |
|
|
|
const u32 viewport_count = device.GetViewportCount(); |
|
|
|
const std::array<VkViewport, 2> viewports{viewport, viewport}; |
|
|
|
const std::array<VkRect2D, 2> scissors{scissor, scissor}; |
|
|
|
cmdbuf.SetViewport(0, vk::Span<VkViewport>(viewports.data(), viewport_count)); |
|
|
|
cmdbuf.SetScissor(0, vk::Span<VkRect2D>(scissors.data(), viewport_count)); |
|
|
|
cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); |
|
|
|
cmdbuf.Draw(3, 1, 0, 0); |
|
|
|
}); |
|
|
|
@ -821,8 +832,11 @@ void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer |
|
|
|
cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); |
|
|
|
cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, |
|
|
|
nullptr); |
|
|
|
cmdbuf.SetViewport(0, viewport); |
|
|
|
cmdbuf.SetScissor(0, scissor); |
|
|
|
const u32 viewport_count = device.GetViewportCount(); |
|
|
|
const std::array<VkViewport, 2> viewports{viewport, viewport}; |
|
|
|
const std::array<VkRect2D, 2> scissors{scissor, scissor}; |
|
|
|
cmdbuf.SetViewport(0, vk::Span<VkViewport>(viewports.data(), viewport_count)); |
|
|
|
cmdbuf.SetScissor(0, vk::Span<VkRect2D>(scissors.data(), viewport_count)); |
|
|
|
cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); |
|
|
|
cmdbuf.Draw(3, 1, 0, 0); |
|
|
|
}); |
|
|
|
@ -860,6 +874,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceColorPipeline(const BlitImagePipelineKe |
|
|
|
.blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, |
|
|
|
}; |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
blit_color_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -869,7 +884,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceColorPipeline(const BlitImagePipelineKe |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = nullptr, |
|
|
|
@ -892,6 +907,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceDepthStencilPipeline(const BlitImagePip |
|
|
|
blit_depth_stencil_keys.push_back(key); |
|
|
|
const std::array stages = MakeStages(*full_screen_vert, *blit_depth_stencil_frag); |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
blit_depth_stencil_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -901,7 +917,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceDepthStencilPipeline(const BlitImagePip |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, |
|
|
|
@ -945,6 +961,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearColorPipeline(const BlitImagePipel |
|
|
|
.blendConstants = {0.0f, 0.0f, 0.0f, 0.0f}, |
|
|
|
}; |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
clear_color_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -954,7 +971,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearColorPipeline(const BlitImagePipel |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, |
|
|
|
@ -1001,6 +1018,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearStencilPipeline( |
|
|
|
.maxDepthBounds = 0.0f, |
|
|
|
}; |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
clear_stencil_pipelines.push_back(device.GetLogical().CreateGraphicsPipeline({ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -1010,7 +1028,7 @@ VkPipeline BlitImageHelper::FindOrEmplaceClearStencilPipeline( |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = &depth_stencil_ci, |
|
|
|
@ -1032,6 +1050,7 @@ void BlitImageHelper::ConvertDepthToColorPipeline(vk::Pipeline& pipeline, VkRend |
|
|
|
VkShaderModule frag_shader = *convert_float_to_depth_frag; |
|
|
|
const std::array stages = MakeStages(*full_screen_vert, frag_shader); |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -1041,7 +1060,7 @@ void BlitImageHelper::ConvertDepthToColorPipeline(vk::Pipeline& pipeline, VkRend |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, |
|
|
|
@ -1062,6 +1081,7 @@ void BlitImageHelper::ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRend |
|
|
|
VkShaderModule frag_shader = *convert_depth_to_float_frag; |
|
|
|
const std::array stages = MakeStages(*full_screen_vert, frag_shader); |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -1071,7 +1091,7 @@ void BlitImageHelper::ConvertColorToDepthPipeline(vk::Pipeline& pipeline, VkRend |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO, |
|
|
|
@ -1093,6 +1113,7 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass ren |
|
|
|
} |
|
|
|
const std::array stages = MakeStages(*full_screen_vert, *module); |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -1102,7 +1123,7 @@ void BlitImageHelper::ConvertPipelineEx(vk::Pipeline& pipeline, VkRenderPass ren |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = is_target_depth ? &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO : nullptr, |
|
|
|
@ -1135,6 +1156,7 @@ void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass rende |
|
|
|
is_target_depth ? *convert_float_to_depth_frag : *convert_depth_to_float_frag; |
|
|
|
const std::array stages = MakeStages(*full_screen_vert, frag_shader); |
|
|
|
const VkPipelineInputAssemblyStateCreateInfo input_assembly_ci = GetPipelineInputAssemblyStateCreateInfo(device); |
|
|
|
const VkPipelineViewportStateCreateInfo viewport_ci = GetPipelineViewportStateCreateInfo(device); |
|
|
|
pipeline = device.GetLogical().CreateGraphicsPipeline(VkGraphicsPipelineCreateInfo{ |
|
|
|
.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO, |
|
|
|
.pNext = nullptr, |
|
|
|
@ -1144,7 +1166,7 @@ void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass rende |
|
|
|
.pVertexInputState = &PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO, |
|
|
|
.pInputAssemblyState = &input_assembly_ci, |
|
|
|
.pTessellationState = nullptr, |
|
|
|
.pViewportState = &PIPELINE_VIEWPORT_STATE_CREATE_INFO, |
|
|
|
.pViewportState = &viewport_ci, |
|
|
|
.pRasterizationState = &PIPELINE_RASTERIZATION_STATE_CREATE_INFO, |
|
|
|
.pMultisampleState = &PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, |
|
|
|
.pDepthStencilState = is_target_depth ? &PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO : nullptr, |
|
|
|
|