diff options
| -rw-r--r-- | src/video_core/renderer_vulkan/blit_image.cpp | 47 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/blit_image.h | 3 |
2 files changed, 0 insertions, 50 deletions
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index cd5995897..2c3914459 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp | |||
| @@ -518,53 +518,6 @@ void BlitImageHelper::Convert(VkPipeline pipeline, const Framebuffer* dst_frameb | |||
| 518 | scheduler.InvalidateState(); | 518 | scheduler.InvalidateState(); |
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | void BlitImageHelper::ConvertColor(VkPipeline pipeline, const Framebuffer* dst_framebuffer, | ||
| 522 | ImageView& src_image_view, u32 up_scale, u32 down_shift) { | ||
| 523 | const VkPipelineLayout layout = *one_texture_pipeline_layout; | ||
| 524 | const VkImageView src_view = src_image_view.ColorView(); | ||
| 525 | const VkSampler sampler = *nearest_sampler; | ||
| 526 | const VkExtent2D extent{ | ||
| 527 | .width = std::max((src_image_view.size.width * up_scale) >> down_shift, 1U), | ||
| 528 | .height = std::max((src_image_view.size.height * up_scale) >> down_shift, 1U), | ||
| 529 | }; | ||
| 530 | scheduler.RequestRenderpass(dst_framebuffer); | ||
| 531 | scheduler.Record([pipeline, layout, sampler, src_view, extent, up_scale, down_shift, | ||
| 532 | this](vk::CommandBuffer cmdbuf) { | ||
| 533 | const VkOffset2D offset{ | ||
| 534 | .x = 0, | ||
| 535 | .y = 0, | ||
| 536 | }; | ||
| 537 | const VkViewport viewport{ | ||
| 538 | .x = 0.0f, | ||
| 539 | .y = 0.0f, | ||
| 540 | .width = static_cast<float>(extent.width), | ||
| 541 | .height = static_cast<float>(extent.height), | ||
| 542 | .minDepth = 0.0f, | ||
| 543 | .maxDepth = 0.0f, | ||
| 544 | }; | ||
| 545 | const VkRect2D scissor{ | ||
| 546 | .offset = offset, | ||
| 547 | .extent = extent, | ||
| 548 | }; | ||
| 549 | const PushConstants push_constants{ | ||
| 550 | .tex_scale = {viewport.width, viewport.height}, | ||
| 551 | .tex_offset = {0.0f, 0.0f}, | ||
| 552 | }; | ||
| 553 | const VkDescriptorSet descriptor_set = one_texture_descriptor_allocator.Commit(); | ||
| 554 | UpdateOneTextureDescriptorSet(device, descriptor_set, sampler, src_view); | ||
| 555 | |||
| 556 | // TODO: Barriers | ||
| 557 | cmdbuf.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline); | ||
| 558 | cmdbuf.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, layout, 0, descriptor_set, | ||
| 559 | nullptr); | ||
| 560 | cmdbuf.SetViewport(0, viewport); | ||
| 561 | cmdbuf.SetScissor(0, scissor); | ||
| 562 | cmdbuf.PushConstants(layout, VK_SHADER_STAGE_VERTEX_BIT, push_constants); | ||
| 563 | cmdbuf.Draw(3, 1, 0, 0); | ||
| 564 | }); | ||
| 565 | scheduler.InvalidateState(); | ||
| 566 | } | ||
| 567 | |||
| 568 | void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer* dst_framebuffer, | 521 | void BlitImageHelper::ConvertDepthStencil(VkPipeline pipeline, const Framebuffer* dst_framebuffer, |
| 569 | ImageView& src_image_view) { | 522 | ImageView& src_image_view) { |
| 570 | const VkPipelineLayout layout = *two_textures_pipeline_layout; | 523 | const VkPipelineLayout layout = *two_textures_pipeline_layout; |
diff --git a/src/video_core/renderer_vulkan/blit_image.h b/src/video_core/renderer_vulkan/blit_image.h index 1d9f61a52..85e7dca5b 100644 --- a/src/video_core/renderer_vulkan/blit_image.h +++ b/src/video_core/renderer_vulkan/blit_image.h | |||
| @@ -60,9 +60,6 @@ private: | |||
| 60 | void Convert(VkPipeline pipeline, const Framebuffer* dst_framebuffer, | 60 | void Convert(VkPipeline pipeline, const Framebuffer* dst_framebuffer, |
| 61 | const ImageView& src_image_view); | 61 | const ImageView& src_image_view); |
| 62 | 62 | ||
| 63 | void ConvertColor(VkPipeline pipeline, const Framebuffer* dst_framebuffer, | ||
| 64 | ImageView& src_image_view, u32 up_scale, u32 down_shift); | ||
| 65 | |||
| 66 | void ConvertDepthStencil(VkPipeline pipeline, const Framebuffer* dst_framebuffer, | 63 | void ConvertDepthStencil(VkPipeline pipeline, const Framebuffer* dst_framebuffer, |
| 67 | ImageView& src_image_view); | 64 | ImageView& src_image_view); |
| 68 | 65 | ||