diff options
| author | 2020-04-16 01:34:45 -0300 | |
|---|---|---|
| committer | 2020-04-23 18:00:06 -0300 | |
| commit | 72deb773fdcc59b1df9752de4e846422b7bb5280 (patch) | |
| tree | 524006956b6dbb6789831652129013e54f185f16 /src/video_core/texture_cache | |
| parent | Merge pull request #3768 from H27CK/cmd-title-fmt (diff) | |
| download | yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.tar.gz yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.tar.xz yuzu-72deb773fdcc59b1df9752de4e846422b7bb5280.zip | |
shader_ir: Turn classes into data structures
Diffstat (limited to 'src/video_core/texture_cache')
| -rw-r--r-- | src/video_core/texture_cache/surface_params.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp index 0de499946..884fabffe 100644 --- a/src/video_core/texture_cache/surface_params.cpp +++ b/src/video_core/texture_cache/surface_params.cpp | |||
| @@ -81,7 +81,7 @@ SurfaceParams SurfaceParams::CreateForTexture(const FormatLookupTable& lookup_ta | |||
| 81 | params.pixel_format = lookup_table.GetPixelFormat( | 81 | params.pixel_format = lookup_table.GetPixelFormat( |
| 82 | tic.format, params.srgb_conversion, tic.r_type, tic.g_type, tic.b_type, tic.a_type); | 82 | tic.format, params.srgb_conversion, tic.r_type, tic.g_type, tic.b_type, tic.a_type); |
| 83 | params.type = GetFormatType(params.pixel_format); | 83 | params.type = GetFormatType(params.pixel_format); |
| 84 | if (entry.IsShadow() && params.type == SurfaceType::ColorTexture) { | 84 | if (entry.is_shadow && params.type == SurfaceType::ColorTexture) { |
| 85 | switch (params.pixel_format) { | 85 | switch (params.pixel_format) { |
| 86 | case PixelFormat::R16U: | 86 | case PixelFormat::R16U: |
| 87 | case PixelFormat::R16F: | 87 | case PixelFormat::R16F: |
| @@ -108,7 +108,7 @@ SurfaceParams SurfaceParams::CreateForTexture(const FormatLookupTable& lookup_ta | |||
| 108 | params.emulated_levels = 1; | 108 | params.emulated_levels = 1; |
| 109 | params.is_layered = false; | 109 | params.is_layered = false; |
| 110 | } else { | 110 | } else { |
| 111 | params.target = TextureTypeToSurfaceTarget(entry.GetType(), entry.IsArray()); | 111 | params.target = TextureTypeToSurfaceTarget(entry.type, entry.is_array); |
| 112 | params.width = tic.Width(); | 112 | params.width = tic.Width(); |
| 113 | params.height = tic.Height(); | 113 | params.height = tic.Height(); |
| 114 | params.depth = tic.Depth(); | 114 | params.depth = tic.Depth(); |
| @@ -138,7 +138,7 @@ SurfaceParams SurfaceParams::CreateForImage(const FormatLookupTable& lookup_tabl | |||
| 138 | tic.format, params.srgb_conversion, tic.r_type, tic.g_type, tic.b_type, tic.a_type); | 138 | tic.format, params.srgb_conversion, tic.r_type, tic.g_type, tic.b_type, tic.a_type); |
| 139 | params.type = GetFormatType(params.pixel_format); | 139 | params.type = GetFormatType(params.pixel_format); |
| 140 | params.type = GetFormatType(params.pixel_format); | 140 | params.type = GetFormatType(params.pixel_format); |
| 141 | params.target = ImageTypeToSurfaceTarget(entry.GetType()); | 141 | params.target = ImageTypeToSurfaceTarget(entry.type); |
| 142 | // TODO: on 1DBuffer we should use the tic info. | 142 | // TODO: on 1DBuffer we should use the tic info. |
| 143 | if (tic.IsBuffer()) { | 143 | if (tic.IsBuffer()) { |
| 144 | params.target = SurfaceTarget::TextureBuffer; | 144 | params.target = SurfaceTarget::TextureBuffer; |
| @@ -248,12 +248,12 @@ SurfaceParams SurfaceParams::CreateForFermiCopySurface( | |||
| 248 | 248 | ||
| 249 | VideoCore::Surface::SurfaceTarget SurfaceParams::ExpectedTarget( | 249 | VideoCore::Surface::SurfaceTarget SurfaceParams::ExpectedTarget( |
| 250 | const VideoCommon::Shader::Sampler& entry) { | 250 | const VideoCommon::Shader::Sampler& entry) { |
| 251 | return TextureTypeToSurfaceTarget(entry.GetType(), entry.IsArray()); | 251 | return TextureTypeToSurfaceTarget(entry.type, entry.is_array); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | VideoCore::Surface::SurfaceTarget SurfaceParams::ExpectedTarget( | 254 | VideoCore::Surface::SurfaceTarget SurfaceParams::ExpectedTarget( |
| 255 | const VideoCommon::Shader::Image& entry) { | 255 | const VideoCommon::Shader::Image& entry) { |
| 256 | return ImageTypeToSurfaceTarget(entry.GetType()); | 256 | return ImageTypeToSurfaceTarget(entry.type); |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | bool SurfaceParams::IsLayered() const { | 259 | bool SurfaceParams::IsLayered() const { |
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index cf6bd005a..215d4254d 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -1156,7 +1156,7 @@ private: | |||
| 1156 | /// Returns true the shader sampler entry is compatible with the TIC texture type. | 1156 | /// Returns true the shader sampler entry is compatible with the TIC texture type. |
| 1157 | static bool IsTypeCompatible(Tegra::Texture::TextureType tic_type, | 1157 | static bool IsTypeCompatible(Tegra::Texture::TextureType tic_type, |
| 1158 | const VideoCommon::Shader::Sampler& entry) { | 1158 | const VideoCommon::Shader::Sampler& entry) { |
| 1159 | const auto shader_type = entry.GetType(); | 1159 | const auto shader_type = entry.type; |
| 1160 | switch (tic_type) { | 1160 | switch (tic_type) { |
| 1161 | case Tegra::Texture::TextureType::Texture1D: | 1161 | case Tegra::Texture::TextureType::Texture1D: |
| 1162 | case Tegra::Texture::TextureType::Texture1DArray: | 1162 | case Tegra::Texture::TextureType::Texture1DArray: |
| @@ -1177,7 +1177,7 @@ private: | |||
| 1177 | if (shader_type == Tegra::Shader::TextureType::TextureCube) { | 1177 | if (shader_type == Tegra::Shader::TextureType::TextureCube) { |
| 1178 | return true; | 1178 | return true; |
| 1179 | } | 1179 | } |
| 1180 | return shader_type == Tegra::Shader::TextureType::Texture2D && entry.IsArray(); | 1180 | return shader_type == Tegra::Shader::TextureType::Texture2D && entry.is_array; |
| 1181 | } | 1181 | } |
| 1182 | UNREACHABLE(); | 1182 | UNREACHABLE(); |
| 1183 | return true; | 1183 | return true; |