diff options
| author | VolcaEM <63682805+VolcaEM@users.noreply.github.com> | 2020-06-25 23:34:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-25 23:34:37 +0200 |
| commit | 0f4512291a0504b32fac248f73a68fec34f657fe (patch) | |
| tree | 3c69736a2ac82a9a0076ec3b79673c814e5f1abd /src/video_core/texture_cache/surface_params.cpp | |
| parent | a46df409397855812812e83ae3ed6ce6261b72cb (diff) | |
| parent | a980b4cbc16cf1efad077053e1bf2bbb53c3d60a (diff) | |
Merge branch 'master' into quickstart-faq
Diffstat (limited to 'src/video_core/texture_cache/surface_params.cpp')
| -rw-r--r-- | src/video_core/texture_cache/surface_params.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp index 884fabffe..0b2b2b8c4 100644 --- a/src/video_core/texture_cache/surface_params.cpp +++ b/src/video_core/texture_cache/surface_params.cpp @@ -215,10 +215,19 @@ SurfaceParams SurfaceParams::CreateForFramebuffer(Core::System& system, std::siz params.num_levels = 1; params.emulated_levels = 1; - const bool is_layered = config.layers > 1 && params.block_depth == 0; - params.is_layered = is_layered; - params.depth = is_layered ? config.layers.Value() : 1; - params.target = is_layered ? SurfaceTarget::Texture2DArray : SurfaceTarget::Texture2D; + if (config.memory_layout.is_3d != 0) { + params.depth = config.layers.Value(); + params.is_layered = false; + params.target = SurfaceTarget::Texture3D; + } else if (config.layers > 1) { + params.depth = config.layers.Value(); + params.is_layered = true; + params.target = SurfaceTarget::Texture2DArray; + } else { + params.depth = 1; + params.is_layered = false; + params.target = SurfaceTarget::Texture2D; + } return params; } @@ -237,7 +246,7 @@ SurfaceParams SurfaceParams::CreateForFermiCopySurface( params.width = config.width; params.height = config.height; params.pitch = config.pitch; - // TODO(Rodrigo): Try to guess the surface target from depth and layer parameters + // TODO(Rodrigo): Try to guess texture arrays from parameters params.target = SurfaceTarget::Texture2D; params.depth = 1; params.num_levels = 1; |
