MaranBr
2 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
3 changed files with
5 additions and
12 deletions
src/video_core/shader_environment.cpp
src/video_core/texture_cache/image_info.cpp
src/video_core/texture_cache/image_view_info.cpp
@ -59,7 +59,7 @@ static Shader::TextureType ConvertTextureType(const Tegra::Texture::TICEntry& en
case Tegra : : Texture : : TextureType : : TextureCubeArray :
return Shader : : TextureType : : ColorArrayCube ;
default :
UNIMPLEMENTED ( ) ;
LOG_ERROR ( Shader , " Invalid texture_type={}, falling back to texture_type={} " , static_cast < int > ( entry . texture_type . Value ( ) ) , Shader : : TextureType : : Color2D ) ;
return Shader : : TextureType : : Color2D ;
}
}
@ -51,10 +51,8 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
config . texture_type ! = TextureType : : Texture2DNoMipmap ) {
ASSERT ( ! config . IsPitchLinear ( ) ) ;
}
//Normalize so that the 1D that actually uses layers is treated as 1DArray
TextureType tex_type = config . texture_type ;
if ( tex_type = = TextureType : : Texture1D & &
( config . Depth ( ) > 1 | | config . BaseLayer ( ) ! = 0 ) ) {
if ( tex_type = = TextureType : : Texture1D & & ( config . Depth ( ) > 1 | | config . BaseLayer ( ) ! = 0 ) ) {
tex_type = TextureType : : Texture1DArray ;
}
switch ( tex_type ) {
@ -113,7 +111,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
resources . layers = 1 ;
break ;
default :
ASSERT_MSG ( false , " Invalid texture_type={} " , static_cast < int > ( config . texture _type . Value ( ) ) ) ;
ASSERT_MSG ( false , " Invalid texture_type={} " , static_cast < int > ( tex_type ) ) ;
break ;
}
if ( num_samples > 1 ) {
@ -41,9 +41,7 @@ ImageViewInfo::ImageViewInfo(const TICEntry& config, s32 base_layer) noexcept
} ;
range . extent . levels = config . res_max_mip_level - config . res_min_mip_level + 1 ;
TextureType tex_type = config . texture_type ;
//normalize 1D texture with many layers
if ( tex_type = = TextureType : : Texture1D & &
( config . Depth ( ) > 1 | | base_layer ! = 0 ) ) {
if ( tex_type = = TextureType : : Texture1D & & ( config . Depth ( ) > 1 | | base_layer ! = 0 ) ) {
tex_type = TextureType : : Texture1DArray ;
}
switch ( tex_type ) {
@ -74,18 +72,15 @@ ImageViewInfo::ImageViewInfo(const TICEntry& config, s32 base_layer) noexcept
type = ImageViewType : : Cube ;
range . extent . layers = 6 ;
break ;
case TextureType : : TextureCubeArray :
type = ImageViewType : : CubeArray ;
range . extent . layers = config . Depth ( ) * 6 ;
break ;
case TextureType : : Texture1DBuffer :
type = ImageViewType : : Buffer ;
break ;
default :
ASSERT_MSG ( false , " Invalid texture_type={} " , static_cast < int > ( config . texture _type . Value ( ) ) ) ;
ASSERT_MSG ( false , " Invalid texture_type={} " , static_cast < int > ( tex_type ) ) ;
break ;
}
}