@ -54,48 +54,63 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
TextureType tex_type = config . texture_type ;
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 ;
tex_type = TextureType : : Texture1DArray ;
} else if ( tex_type = = TextureType : : Texture2D & & ( config . Depth ( ) > 1 | | config . BaseLayer ( ) ! = 0 ) ) {
tex_type = TextureType : : Texture2DArray ;
}
}
switch ( tex_type ) {
switch ( tex_type ) {
case TextureType : : Texture1D :
case TextureType : : Texture1D :
ASSERT ( config . BaseLayer ( ) = = 0 ) ;
ASSERT ( config . BaseLayer ( ) = = 0 ) ;
ASSERT ( config . Depth ( ) = = 1 ) ;
type = ImageType : : e1D ;
type = ImageType : : e1D ;
size . width = config . Width ( ) ;
size . width = config . Width ( ) ;
size . depth = 1 ;
resources . layers = 1 ;
resources . layers = 1 ;
break ;
break ;
case TextureType : : Texture1DArray :
case TextureType : : Texture1DArray :
ASSERT ( config . Depth ( ) > 0 ) ;
ASSERT ( config . BaseLayer ( ) < config . Depth ( ) ) ;
type = ImageType : : e1D ;
type = ImageType : : e1D ;
size . width = config . Width ( ) ;
size . width = config . Width ( ) ;
resources . layers = config . BaseLayer ( ) + config . Depth ( ) ;
size . depth = 1 ;
resources . layers = config . Depth ( ) - config . BaseLayer ( ) ;
break ;
break ;
case TextureType : : Texture2D :
case TextureType : : Texture2D :
case TextureType : : Texture2DNoMipmap :
case TextureType : : Texture2DNoMipmap :
ASSERT ( config . BaseLayer ( ) = = 0 ) ;
ASSERT ( config . Depth ( ) = = 1 ) ;
ASSERT ( config . Depth ( ) = = 1 ) ;
type = config . IsPitchLinear ( ) ? ImageType : : Linear : ImageType : : e2D ;
type = config . IsPitchLinear ( ) ? ImageType : : Linear : ImageType : : e2D ;
rescaleable = ! config . IsPitchLinear ( ) ;
rescaleable = ! config . IsPitchLinear ( ) ;
size . width = config . Width ( ) ;
size . width = config . Width ( ) ;
size . height = config . Height ( ) ;
size . height = config . Height ( ) ;
resources . layers = config . BaseLayer ( ) + 1 ;
size . depth = 1 ;
resources . layers = 1 ;
break ;
break ;
case TextureType : : Texture2DArray :
case TextureType : : Texture2DArray :
ASSERT ( config . Depth ( ) > 0 ) ;
ASSERT ( config . BaseLayer ( ) < config . Depth ( ) ) ;
type = ImageType : : e2D ;
type = ImageType : : e2D ;
rescaleable = true ;
rescaleable = true ;
size . width = config . Width ( ) ;
size . width = config . Width ( ) ;
size . height = config . Height ( ) ;
size . height = config . Height ( ) ;
resources . layers = config . BaseLayer ( ) + config . Depth ( ) ;
size . depth = 1 ;
resources . layers = config . Depth ( ) - config . BaseLayer ( ) ;
break ;
break ;
case TextureType : : TextureCubemap :
case TextureType : : TextureCubemap :
ASSERT ( config . Depth ( ) = = 1 ) ;
ASSERT ( config . Depth ( ) = = 1 ) ;
type = ImageType : : e2D ;
type = ImageType : : e2D ;
size . width = config . Width ( ) ;
size . width = config . Width ( ) ;
size . height = config . Height ( ) ;
size . height = config . Height ( ) ;
resources . layers = config . BaseLayer ( ) + 6 ;
size . depth = 1 ;
resources . layers = 6 ;
break ;
break ;
case TextureType : : TextureCubeArray :
case TextureType : : TextureCubeArray :
UNIMPLEMENTED_IF ( config . load_store_hint ! = 0 ) ;
UNIMPLEMENTED_IF ( config . load_store_hint ! = 0 ) ;
ASSERT ( config . Depth ( ) > 0 ) ;
type = ImageType : : e2D ;
type = ImageType : : e2D ;
size . width = config . Width ( ) ;
size . width = config . Width ( ) ;
size . height = config . Height ( ) ;
size . height = config . Height ( ) ;
resources . layers = config . BaseLayer ( ) + config . Depth ( ) * 6 ;
size . depth = 1 ;
resources . layers = ( config . Depth ( ) - config . BaseLayer ( ) ) * 6 ;
break ;
break ;
case TextureType : : Texture3D :
case TextureType : : Texture3D :
ASSERT ( config . BaseLayer ( ) = = 0 ) ;
ASSERT ( config . BaseLayer ( ) = = 0 ) ;
@ -108,6 +123,7 @@ ImageInfo::ImageInfo(const TICEntry& config) noexcept {
case TextureType : : Texture1DBuffer :
case TextureType : : Texture1DBuffer :
type = ImageType : : Buffer ;
type = ImageType : : Buffer ;
size . width = config . Width ( ) ;
size . width = config . Width ( ) ;
size . depth = 1 ;
resources . layers = 1 ;
resources . layers = 1 ;
break ;
break ;
default :
default :