summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-07-03 14:40:29 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-07-03 14:40:29 +0200
commit0aab55d26a66dd86f181e09c20efa44a86f45812 (patch)
tree55a2fe0e232aa29390326d6d57d1bf3c4cb1a7b4
parentTextureCache: Fix 1D to 2D overlapps. (diff)
downloadyuzu-0aab55d26a66dd86f181e09c20efa44a86f45812.tar
yuzu-0aab55d26a66dd86f181e09c20efa44a86f45812.tar.gz
yuzu-0aab55d26a66dd86f181e09c20efa44a86f45812.tar.bz2
yuzu-0aab55d26a66dd86f181e09c20efa44a86f45812.tar.lz
yuzu-0aab55d26a66dd86f181e09c20efa44a86f45812.tar.xz
yuzu-0aab55d26a66dd86f181e09c20efa44a86f45812.tar.zst
yuzu-0aab55d26a66dd86f181e09c20efa44a86f45812.zip
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index 23948feed..a2c1599f7 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -341,6 +341,20 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4
[[nodiscard]] CopyOrigin MakeCopyOrigin(VideoCommon::Offset3D offset,
VideoCommon::SubresourceLayers subresource, GLenum target) {
switch (target) {
+ case GL_TEXTURE_1D:
+ return CopyOrigin{
+ .level = static_cast<GLint>(subresource.base_level),
+ .x = static_cast<GLint>(offset.x),
+ .y = static_cast<GLint>(0),
+ .z = static_cast<GLint>(0),
+ };
+ case GL_TEXTURE_1D_ARRAY:
+ return CopyOrigin{
+ .level = static_cast<GLint>(subresource.base_level),
+ .x = static_cast<GLint>(offset.x),
+ .y = static_cast<GLint>(0),
+ .z = static_cast<GLint>(subresource.base_layer),
+ };
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
return CopyOrigin{
@@ -366,6 +380,18 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4
VideoCommon::SubresourceLayers dst_subresource,
GLenum target) {
switch (target) {
+ case GL_TEXTURE_1D:
+ return CopyRegion{
+ .width = static_cast<GLsizei>(extent.width),
+ .height = static_cast<GLsizei>(1),
+ .depth = static_cast<GLsizei>(1),
+ };
+ case GL_TEXTURE_1D_ARRAY:
+ return CopyRegion{
+ .width = static_cast<GLsizei>(extent.width),
+ .height = static_cast<GLsizei>(1),
+ .depth = static_cast<GLsizei>(dst_subresource.num_layers),
+ };
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
return CopyRegion{