diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-16 03:30:35 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-09-17 01:49:12 +0200 |
commit | ab808fe7cf66c143e9323bb51922989d5bb37752 (patch) | |
tree | 18fe9a57339e2c8e18bc2ffe473483c95c7762a7 /src/video_core/renderer_opengl/util_shaders.cpp | |
parent | util_shaders: Unify BGRA copy passes (diff) | |
download | yuzu-ab808fe7cf66c143e9323bb51922989d5bb37752.tar yuzu-ab808fe7cf66c143e9323bb51922989d5bb37752.tar.gz yuzu-ab808fe7cf66c143e9323bb51922989d5bb37752.tar.bz2 yuzu-ab808fe7cf66c143e9323bb51922989d5bb37752.tar.lz yuzu-ab808fe7cf66c143e9323bb51922989d5bb37752.tar.xz yuzu-ab808fe7cf66c143e9323bb51922989d5bb37752.tar.zst yuzu-ab808fe7cf66c143e9323bb51922989d5bb37752.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/util_shaders.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/video_core/renderer_opengl/util_shaders.cpp b/src/video_core/renderer_opengl/util_shaders.cpp index 2cb6e19b3..b4083cc36 100644 --- a/src/video_core/renderer_opengl/util_shaders.cpp +++ b/src/video_core/renderer_opengl/util_shaders.cpp @@ -44,11 +44,6 @@ namespace { OGLProgram MakeProgram(std::string_view source) { return CreateProgram(source, GL_COMPUTE_SHADER); } - -size_t NumPixelsInCopy(const VideoCommon::ImageCopy& copy) { - return static_cast<size_t>(copy.extent.width * copy.extent.height * - copy.src_subresource.num_layers); -} } // Anonymous namespace UtilShaders::UtilShaders(ProgramManager& program_manager_) @@ -255,36 +250,6 @@ void UtilShaders::CopyBC4(Image& dst_image, Image& src_image, std::span<const Im program_manager.RestoreGuestCompute(); } -void UtilShaders::CopyBGR(Image& dst_image, Image& src_image, - std::span<const VideoCommon::ImageCopy> copies) { - static constexpr VideoCommon::Offset3D zero_offset{0, 0, 0}; - for (const ImageCopy& copy : copies) { - ASSERT(copy.src_offset == zero_offset); - ASSERT(copy.dst_offset == zero_offset); - - if (bgr_pbo_size < dst_image.unswizzled_size_bytes) { - bgr_pbo.Create(); - bgr_pbo_size = dst_image.unswizzled_size_bytes; - glNamedBufferData(bgr_pbo.handle, bgr_pbo_size, nullptr, GL_STREAM_COPY); - } - // Copy from source to PBO - glPixelStorei(GL_PACK_ALIGNMENT, 1); - glPixelStorei(GL_PACK_ROW_LENGTH, copy.extent.width); - glBindBuffer(GL_PIXEL_PACK_BUFFER, bgr_pbo.handle); - glGetTextureSubImage(src_image.Handle(), 0, 0, 0, 0, copy.extent.width, copy.extent.height, - copy.src_subresource.num_layers, src_image.GlFormat(), - src_image.GlType(), static_cast<GLsizei>(bgr_pbo_size), nullptr); - - // Copy from PBO to destination in reverse order - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glPixelStorei(GL_UNPACK_ROW_LENGTH, copy.extent.width); - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, bgr_pbo.handle); - glTextureSubImage3D(dst_image.Handle(), 0, 0, 0, 0, copy.extent.width, copy.extent.height, - copy.dst_subresource.num_layers, dst_image.GlFormat(), - dst_image.GlType(), nullptr); - } -} - GLenum StoreFormat(u32 bytes_per_block) { switch (bytes_per_block) { case 1: |