diff options
Diffstat (limited to 'src/video_core/renderer_vulkan/blit_image.cpp')
| -rw-r--r-- | src/video_core/renderer_vulkan/blit_image.cpp | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/blit_image.cpp b/src/video_core/renderer_vulkan/blit_image.cpp index 1eeed165fb..cf8c5454cc 100644 --- a/src/video_core/renderer_vulkan/blit_image.cpp +++ b/src/video_core/renderer_vulkan/blit_image.cpp @@ -30,6 +30,14 @@ #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" #include "video_core/host_shaders/convert_abgr8_srgb_to_d24s8_frag_spv.h" +#include "video_core/host_shaders/convert_rgba8_to_bgra8_frag_spv.h" +#include "video_core/host_shaders/convert_yuv420_to_rgb_comp_spv.h" +#include "video_core/host_shaders/convert_rgb_to_yuv420_comp_spv.h" +#include "video_core/host_shaders/convert_bc7_to_rgba8_comp_spv.h" +#include "video_core/host_shaders/convert_astc_hdr_to_rgba16f_comp_spv.h" +#include "video_core/host_shaders/convert_rgba16f_to_rgba8_frag_spv.h" +#include "video_core/host_shaders/dither_temporal_frag_spv.h" +#include "video_core/host_shaders/dynamic_resolution_scale_comp_spv.h" namespace Vulkan { @@ -442,6 +450,14 @@ BlitImageHelper::BlitImageHelper(const Device& device_, Scheduler& scheduler_, convert_d24s8_to_abgr8_frag(BuildShader(device, CONVERT_D24S8_TO_ABGR8_FRAG_SPV)), convert_s8d24_to_abgr8_frag(BuildShader(device, CONVERT_S8D24_TO_ABGR8_FRAG_SPV)), convert_abgr8_srgb_to_d24s8_frag(BuildShader(device, CONVERT_ABGR8_SRGB_TO_D24S8_FRAG_SPV)), + convert_rgba_to_bgra_frag(BuildShader(device, CONVERT_RGBA8_TO_BGRA8_FRAG_SPV)), + convert_yuv420_to_rgb_comp(BuildShader(device, CONVERT_YUV420_TO_RGB_COMP_SPV)), + convert_rgb_to_yuv420_comp(BuildShader(device, CONVERT_RGB_TO_YUV420_COMP_SPV)), + convert_bc7_to_rgba8_comp(BuildShader(device, CONVERT_BC7_TO_RGBA8_COMP_SPV)), + convert_astc_hdr_to_rgba16f_comp(BuildShader(device, CONVERT_ASTC_HDR_TO_RGBA16F_COMP_SPV)), + convert_rgba16f_to_rgba8_frag(BuildShader(device, CONVERT_RGBA16F_TO_RGBA8_FRAG_SPV)), + dither_temporal_frag(BuildShader(device, DITHER_TEMPORAL_FRAG_SPV)), + dynamic_resolution_scale_comp(BuildShader(device, DYNAMIC_RESOLUTION_SCALE_COMP_SPV)), linear_sampler(device.GetLogical().CreateSampler(SAMPLER_CREATE_INFO<VK_FILTER_LINEAR>)), nearest_sampler(device.GetLogical().CreateSampler(SAMPLER_CREATE_INFO<VK_FILTER_NEAREST>)) {} @@ -1060,4 +1076,68 @@ void BlitImageHelper::ConvertPipeline(vk::Pipeline& pipeline, VkRenderPass rende }); } +void BlitImageHelper::ConvertRGBAtoGBRA(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(convert_rgba_to_bgra_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*convert_rgba_to_bgra_pipeline, dst_framebuffer, src_image_view); +} + +void BlitImageHelper::ConvertYUV420toRGB(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(convert_yuv420_to_rgb_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*convert_yuv420_to_rgb_pipeline, dst_framebuffer, src_image_view); +} + +void BlitImageHelper::ConvertRGBtoYUV420(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(convert_rgb_to_yuv420_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*convert_rgb_to_yuv420_pipeline, dst_framebuffer, src_image_view); +} + +void BlitImageHelper::ConvertBC7toRGBA8(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(convert_bc7_to_rgba8_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*convert_bc7_to_rgba8_pipeline, dst_framebuffer, src_image_view); +} + +void BlitImageHelper::ConvertASTCHDRtoRGBA16F(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(convert_astc_hdr_to_rgba16f_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*convert_astc_hdr_to_rgba16f_pipeline, dst_framebuffer, src_image_view); +} + +void BlitImageHelper::ConvertRGBA16FtoRGBA8(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(convert_rgba16f_to_rgba8_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*convert_rgba16f_to_rgba8_pipeline, dst_framebuffer, src_image_view); +} + +void BlitImageHelper::ApplyDitherTemporal(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(dither_temporal_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*dither_temporal_pipeline, dst_framebuffer, src_image_view); +} + +void BlitImageHelper::ApplyDynamicResolutionScale(const Framebuffer* dst_framebuffer, + const ImageView& src_image_view) { + ConvertPipeline(dynamic_resolution_scale_pipeline, + dst_framebuffer->RenderPass(), + false); + Convert(*dynamic_resolution_scale_pipeline, dst_framebuffer, src_image_view); +} + } // namespace Vulkan |
