MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / GetTextureDimension

Function GetTextureDimension

Source/HLEGraphics/RDPStateManager.cpp:592–609  ·  view source on GitHub ↗

Limit the tile's width/height to the number of bits specified by mask_s/t. See the detailed noted in BaseRenderer::UpdateTileSnapshots for issues relating to this.

Source from the content-addressed store, hash-verified

590// Limit the tile's width/height to the number of bits specified by mask_s/t.
591// See the detailed noted in BaseRenderer::UpdateTileSnapshots for issues relating to this.
592static inline u16 GetTextureDimension( u16 tile_dimension, u8 mask, bool clamp )
593{
594 if (mask)
595 {
596 u16 mask_dimension {(u16)(1 << mask)};
597
598 // If clamp is enabled, the maximum addressable texel is the
599 // smaller of the mask dimension and the tile dimension.
600 if (clamp)
601 {
602 return Min< u16 >( mask_dimension, tile_dimension );
603 }
604
605 return mask_dimension;
606 }
607
608 return tile_dimension;
609}
610
611const TextureInfo & CRDPStateManager::GetUpdatedTextureDescriptor( u32 idx )
612{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected