summaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorGravatar bunnei2020-05-02 00:45:41 -0400
committerGravatar GitHub2020-05-02 00:45:41 -0400
commite6b4311178b4f87b67eb2383f2a64520c2a8dd25 (patch)
tree066f25773f9db49747f26ddf94b23a5007502ff8 /src/video_core/texture_cache
parentMerge pull request #3859 from jbeich/clang (diff)
parentshader/texture: Support multiple unknown sampler properties (diff)
downloadyuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.tar.gz
yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.tar.xz
yuzu-e6b4311178b4f87b67eb2383f2a64520c2a8dd25.zip
Merge pull request #3693 from ReinUsesLisp/clean-samplers
shader/texture: Support multiple unknown sampler properties
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/surface_params.cpp10
-rw-r--r--src/video_core/texture_cache/texture_cache.h4
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
249VideoCore::Surface::SurfaceTarget SurfaceParams::ExpectedTarget( 249VideoCore::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
254VideoCore::Surface::SurfaceTarget SurfaceParams::ExpectedTarget( 254VideoCore::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
259bool SurfaceParams::IsLayered() const { 259bool SurfaceParams::IsLayered() const {
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index d2d2846e6..d6efc34b2 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -1172,7 +1172,7 @@ private:
1172 /// Returns true the shader sampler entry is compatible with the TIC texture type. 1172 /// Returns true the shader sampler entry is compatible with the TIC texture type.
1173 static bool IsTypeCompatible(Tegra::Texture::TextureType tic_type, 1173 static bool IsTypeCompatible(Tegra::Texture::TextureType tic_type,
1174 const VideoCommon::Shader::Sampler& entry) { 1174 const VideoCommon::Shader::Sampler& entry) {
1175 const auto shader_type = entry.GetType(); 1175 const auto shader_type = entry.type;
1176 switch (tic_type) { 1176 switch (tic_type) {
1177 case Tegra::Texture::TextureType::Texture1D: 1177 case Tegra::Texture::TextureType::Texture1D:
1178 case Tegra::Texture::TextureType::Texture1DArray: 1178 case Tegra::Texture::TextureType::Texture1DArray:
@@ -1193,7 +1193,7 @@ private:
1193 if (shader_type == Tegra::Shader::TextureType::TextureCube) { 1193 if (shader_type == Tegra::Shader::TextureType::TextureCube) {
1194 return true; 1194 return true;
1195 } 1195 }
1196 return shader_type == Tegra::Shader::TextureType::Texture2D && entry.IsArray(); 1196 return shader_type == Tegra::Shader::TextureType::Texture2D && entry.is_array;
1197 } 1197 }
1198 UNREACHABLE(); 1198 UNREACHABLE();
1199 return true; 1199 return true;