diff options
| author | bunnei <bunneidev@gmail.com> | 2020-06-09 21:52:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-09 21:52:15 -0400 |
| commit | 83e3b77ed7eaa12ec497fd7d978c2e889c5d14db (patch) | |
| tree | 2940fc6a036c7b1f5ecc13aca6248ba657ed48f4 /src/video_core/texture_cache/surface_params.cpp | |
| parent | 3626254f48b6f16dbee1ee0770f781ae7e27ef95 (diff) | |
| parent | bd43c0547085fcfb585ac3a90521eeb8414fd538 (diff) | |
Merge pull request #4027 from ReinUsesLisp/3d-slices
texture_cache: Implement rendering to 3D textures
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; |
