Twilight Princess
Remastered version of the GameCube game
Loading...
Searching...
No Matches
Toolbox.Library.GX2 Class Reference
+ Collaboration diagram for Toolbox.Library.GX2:

Classes

class  Flags
 
class  GX2Surface
 
class  surfaceIn
 
class  surfaceOut
 
class  TileInfo
 

Public Types

enum  TEX_FORMAT : uint {
  UNKNOWN = 0 , R32G32B32A32_TYPELESS = 1 , R32G32B32A32_FLOAT = 2 , R32G32B32A32_UINT = 3 ,
  R32G32B32A32_SINT = 4 , R32G32B32_TYPELESS = 5 , R32G32B32_FLOAT = 6 , R32G32B32_UINT = 7 ,
  R32G32B32_SINT = 8 , R16G16B16A16_TYPELESS = 9 , R16G16B16A16_FLOAT = 10 , R16G16B16A16_UNORM = 11 ,
  R16G16B16A16_UINT = 12 , R16G16B16A16_SNORM = 13 , R16G16B16A16_SINT = 14 , R32G32_TYPELESS = 15 ,
  R32G32_FLOAT = 16 , R32G32_UINT = 17 , R32G32_SINT = 18 , R32G8X24_TYPELESS = 19 ,
  D32_FLOAT_S8X24_UINT = 20 , R32_FLOAT_X8X24_TYPELESS = 21 , X32_TYPELESS_G8X24_UINT = 22 , R10G10B10A2_TYPELESS = 23 ,
  R10G10B10A2_UNORM = 24 , R10G10B10A2_UINT = 25 , R11G11B10_FLOAT = 26 , R8G8B8A8_TYPELESS = 27 ,
  R8G8B8A8_UNORM = 28 , R8G8B8A8_UNORM_SRGB = 29 , R8G8B8A8_UINT = 30 , R8G8B8A8_SNORM = 31 ,
  R8G8B8A8_SINT = 32 , R16G16_TYPELESS = 33 , R16G16_FLOAT = 34 , R16G16_UNORM = 35 ,
  R16G16_UINT = 36 , R16G16_SNORM = 37 , R16G16_SINT = 38 , R32_TYPELESS = 39 ,
  D32_FLOAT = 40 , R32_FLOAT = 41 , R32_UINT = 42 , R32_SINT = 43 ,
  R24G8_TYPELESS = 44 , D24_UNORM_S8_UINT = 45 , R24_UNORM_X8_TYPELESS = 46 , X24_TYPELESS_G8_UINT = 47 ,
  R8G8_TYPELESS = 48 , R8G8_UNORM = 49 , R8G8_UINT = 50 , R8G8_SNORM = 51 ,
  R8G8_SINT = 52 , R16_TYPELESS = 53 , R16_FLOAT = 54 , D16_UNORM = 55 ,
  R16_UNORM = 56 , R16_UINT = 57 , R16_SNORM = 58 , R16_SINT = 59 ,
  R8_TYPELESS = 60 , R8_UNORM = 61 , R8_UINT = 62 , R8_SNORM = 63 ,
  R8_SINT = 64 , A8_UNORM = 65 , R1_UNORM = 66 , R9G9B9E5_SHAREDEXP = 67 ,
  R8G8_B8G8_UNORM = 68 , G8R8_G8B8_UNORM = 69 , BC1_TYPELESS = 70 , BC1_UNORM = 71 ,
  BC1_UNORM_SRGB = 72 , BC2_TYPELESS = 73 , BC2_UNORM = 74 , BC2_UNORM_SRGB = 75 ,
  BC3_TYPELESS = 76 , BC3_UNORM = 77 , BC3_UNORM_SRGB = 78 , BC4_TYPELESS = 79 ,
  BC4_UNORM = 80 , BC4_SNORM = 81 , BC5_TYPELESS = 82 , BC5_UNORM = 83 ,
  BC5_SNORM = 84 , B5G6R5_UNORM = 85 , B5G5R5A1_UNORM = 86 , B8G8R8A8_UNORM = 87 ,
  B8G8R8X8_UNORM = 88 , R10G10B10_XR_BIAS_A2_UNORM = 89 , B8G8R8A8_TYPELESS = 90 , B8G8R8A8_UNORM_SRGB = 91 ,
  B8G8R8X8_TYPELESS = 92 , B8G8R8X8_UNORM_SRGB = 93 , BC6H_TYPELESS = 94 , BC6H_UF16 = 95 ,
  BC6H_SF16 = 96 , BC7_TYPELESS = 97 , BC7_UNORM = 98 , BC7_UNORM_SRGB = 99 ,
  AYUV = 100 , Y410 = 101 , Y416 = 102 , NV12 = 103 ,
  P010 = 104 , P016 = 105 , Format_420_OPAQUE = 106 , YUY2 = 107 ,
  Y210 = 108 , Y216 = 109 , NV11 = 110 , AI44 = 111 ,
  IA44 = 112 , P8 = 113 , A8P8 = 114 , B4G4R4A4_UNORM = 115 ,
  P208 = 130 , V208 = 131 , V408 = 132 , R32G8X24_FLOAT = 133 ,
  ASTC_4x4_UNORM = 134 , ASTC_4x4_SRGB = 135 , ASTC_5x4_UNORM = 138 , ASTC_5x4_SRGB = 139 ,
  ASTC_5x5_UNORM = 142 , ASTC_5x5_SRGB = 143 , ASTC_6x5_UNORM = 146 , ASTC_6x5_SRGB = 147 ,
  ASTC_6x6_UNORM = 150 , ASTC_6x6_SRGB = 151 , ASTC_8x5_UNORM = 154 , ASTC_8x5_SRGB = 155 ,
  ASTC_8x6_UNORM = 158 , ASTC_8x6_SRGB = 159 , ASTC_8x8_UNORM = 162 , ASTC_8x8_SRGB = 163 ,
  ASTC_10x5_UNORM = 166 , ASTC_10x5_SRGB = 167 , ASTC_10x6_UNORM = 170 , ASTC_10x6_SRGB = 171 ,
  ASTC_10x8_UNORM = 174 , ASTC_10x8_SRGB = 175 , ASTC_10x10_UNORM = 178 , ASTC_10x10_SRGB = 179 ,
  ASTC_12x10_UNORM = 182 , ASTC_12x10_SRGB = 183 , ASTC_12x12_UNORM = 186 , ASTC_12x12_SRGB = 187 ,
  ETC1_SRGB = 229 , ETC1_UNORM = 230 , ETC1_A4 = 231 , L4 = 232 ,
  LA4 = 233 , L8 = 234 , LA8 = 235 , HIL08 = 236 ,
  A4 = 237 , R4G4_UNORM = 238 , I4 = 239 , I8 = 240 ,
  IA4 = 241 , IA8 = 242 , R5G5B5_UNORM = 243 , R5G5B5A3_UNORM = 244 ,
  RGBA32 = 245 , C4 = 246 , C8 = 247 , C14X2 = 248 ,
  CMPR = 249 , RGB565 = 250 , RGB5A3 = 251 , R5G5B5A1_UNORM = 252
}
 
enum  GX2SurfaceDimension {
  DIM_1D = 0x0 , DIM_2D = 0x1 , DIM_3D = 0x2 , DIM_CUBE = 0x3 ,
  DIM_1D_ARRAY = 0x4 , DIM_2D_ARRAY = 0x5 , DIM_2D_MSAA = 0x6 , DIM_2D_MSAA_ARRAY = 0x7 ,
  DIM_FIRST = 0x0 , DIM_LAST = 0x7
}
 
enum  GX2SurfaceFormat {
  INVALID = 0x0 , TC_R8_UNORM = 0x1 , TC_R8_UINT = 0x101 , TC_R8_SNORM = 0x201 ,
  TC_R8_SINT = 0x301 , T_R4_G4_UNORM = 0x2 , TCD_R16_UNORM = 0x5 , TC_R16_UINT = 0x105 ,
  TC_R16_SNORM = 0x205 , TC_R16_SINT = 0x305 , TC_R16_FLOAT = 0x806 , TC_R8_G8_UNORM = 0x7 ,
  TC_R8_G8_UINT = 0x107 , TC_R8_G8_SNORM = 0x207 , TC_R8_G8_SINT = 0x307 , TCS_R5_G6_B5_UNORM = 0x8 ,
  TC_R5_G5_B5_A1_UNORM = 0xA , TC_R4_G4_B4_A4_UNORM = 0xB , TC_A1_B5_G5_R5_UNORM = 0xC , TC_R32_UINT = 0x10D ,
  TC_R32_SINT = 0x30D , TCD_R32_FLOAT = 0x80E , TC_R16_G16_UNORM = 0xF , TC_R16_G16_UINT = 0x10F ,
  TC_R16_G16_SNORM = 0x20F , TC_R16_G16_SINT = 0x30F , TC_R16_G16_FLOAT = 0x810 , D_D24_S8_UNORM = 0x11 ,
  T_R24_UNORM_X8 = 0x11 , T_X24_G8_UINT = 0x111 , D_D24_S8_FLOAT = 0x811 , TC_R11_G11_B10_FLOAT = 0x816 ,
  TCS_R10_G10_B10_A2_UNORM = 0x19 , TC_R10_G10_B10_A2_UINT = 0x119 , T_R10_G10_B10_A2_SNORM = 0x219 , TC_R10_G10_B10_A2_SNORM = 0x219 ,
  TC_R10_G10_B10_A2_SINT = 0x319 , TCS_R8_G8_B8_A8_UNORM = 0x1A , TC_R8_G8_B8_A8_UINT = 0x11A , TC_R8_G8_B8_A8_SNORM = 0x21A ,
  TC_R8_G8_B8_A8_SINT = 0x31A , TCS_R8_G8_B8_A8_SRGB = 0x41A , TCS_A2_B10_G10_R10_UNORM = 0x1B , TC_A2_B10_G10_R10_UINT = 0x11B ,
  D_D32_FLOAT_S8_UINT_X24 = 0x81C , T_R32_FLOAT_X8_X24 = 0x81C , T_X32_G8_UINT_X24 = 0x11C , TC_R32_G32_UINT = 0x11D ,
  TC_R32_G32_SINT = 0x31D , TC_R32_G32_FLOAT = 0x81E , TC_R16_G16_B16_A16_UNORM = 0x1F , TC_R16_G16_B16_A16_UINT = 0x11F ,
  TC_R16_G16_B16_A16_SNORM = 0x21F , TC_R16_G16_B16_A16_SINT = 0x31F , TC_R16_G16_B16_A16_FLOAT = 0x820 , TC_R32_G32_B32_A32_UINT = 0x122 ,
  TC_R32_G32_B32_A32_SINT = 0x322 , TC_R32_G32_B32_A32_FLOAT = 0x823 , T_BC1_UNORM = 0x31 , T_BC1_SRGB = 0x431 ,
  T_BC2_UNORM = 0x32 , T_BC2_SRGB = 0x432 , T_BC3_UNORM = 0x33 , T_BC3_SRGB = 0x433 ,
  T_BC4_UNORM = 0x34 , T_BC4_SNORM = 0x234 , T_BC5_UNORM = 0x35 , T_BC5_SNORM = 0x235 ,
  T_NV12_UNORM = 0x81 , FIRST = 0x1 , LAST = 0x83F
}
 
enum  GX2AAMode {
  GX2_AA_MODE_1X = 0x0 , GX2_AA_MODE_2X = 0x1 , GX2_AA_MODE_4X = 0x2 , GX2_AA_MODE_8X = 0x3 ,
  GX2_AA_MODE_FIRST = 0x0 , GX2_AA_MODE_LAST = 0x3
}
 
enum  GX2SurfaceUse : uint {
  USE_TEXTURE = 0x1 , USE_COLOR_BUFFER = 0x2 , USE_DEPTH_BUFFER = 0x4 , USE_SCAN_BUFFER = 0x8 ,
  USE_FTV = 0x80000000 , USE_COLOR_BUFFER_TEXTURE = 0x3 , USE_DEPTH_BUFFER_TEXTURE = 0x5 , USE_COLOR_BUFFER_FTV = 0x80000002 ,
  USE_COLOR_BUFFER_TEXTURE_FTV = 0x80000003 , USE_FIRST = 0x1 , USE_LAST = 0x8
}
 
enum  GX2RResourceFlags {
  GX2R_RESOURCE_FLAGS_NONE = 0x0 , GX2R_BIND_NONE = 0x0 , GX2R_BIND_TEXTURE = 0x1 , GX2R_BIND_COLOR_BUFFER = 0x2 ,
  GX2R_BIND_DEPTH_BUFFER = 0x4 , GX2R_BIND_SCAN_BUFFER = 0x8 , GX2R_BIND_VERTEX_BUFFER = 0x10 , GX2R_BIND_INDEX_BUFFER = 0x20 ,
  GX2R_BIND_UNIFORM_BLOCK = 0x40 , GX2R_BIND_SHADER_PROGRAM = 0x80 , GX2R_BIND_STREAM_OUTPUT = 0x100 , GX2R_BIND_DISPLAY_LIST = 0x200 ,
  GX2R_BIND_GS_RING = 0x400 , GX2R_USAGE_NONE = 0x0 , GX2R_USAGE_CPU_READ = 0x800 , GX2R_USAGE_CPU_WRITE = 0x1000 ,
  GX2R_USAGE_GPU_READ = 0x2000 , GX2R_USAGE_GPU_WRITE = 0x4000 , GX2R_USAGE_DMA_READ = 0x8000 , GX2R_USAGE_DMA_WRITE = 0x10000 ,
  GX2R_USAGE_FORCE_MEM1 = 0x20000 , GX2R_USAGE_FORCE_MEM2 = 0x40000 , GX2R_USAGE_MEM_DEFAULT = 0x0 , GX2R_USAGE_CPU_READWRITE = 0x1800 ,
  GX2R_USAGE_GPU_READWRITE = 0x6000 , GX2R_USAGE_NON_CPU_WRITE = 0x14000 , GX2R_OPTION_NONE = 0x0 , GX2R_OPTION_IGNORE_IN_USE = 0x80000 ,
  GX2R_OPTION_FIRST = 0x80000 , GX2R_OPTION_NO_CPU_INVALIDATE = 0x100000 , GX2R_OPTION_NO_GPU_INVALIDATE = 0x200000 , GX2R_OPTION_LOCK_READONLY = 0x400000 ,
  GX2R_OPTION_NO_TOUCH_DESTROY = 0x800000 , GX2R_OPTION_LAST = 0x800000 , GX2R_OPTION_NO_INVALIDATE = 0x300000 , GX2R_OPTION_MASK = 0xF80000 ,
  GX2R_RESOURCE_FLAG_RESERVED2 = 0x10000000 , GX2R_RESOURCE_FLAG_RESERVED1 = 0x20000000 , GX2R_RESOURCE_FLAG_RESERVED0 = 0x40000000
}
 
enum  GX2TileMode {
  MODE_DEFAULT = 0x0 , MODE_LINEAR_SPECIAL = 0x10 , MODE_LINEAR_ALIGNED = 0x1 , MODE_1D_TILED_THIN1 = 0x2 ,
  MODE_1D_TILED_THICK = 0x3 , MODE_2D_TILED_THIN1 = 0x4 , MODE_2D_TILED_THIN2 = 0x5 , MODE_2D_TILED_THIN4 = 0x6 ,
  MODE_2D_TILED_THICK = 0x7 , MODE_2B_TILED_THIN1 = 0x8 , MODE_2B_TILED_THIN2 = 0x9 , MODE_2B_TILED_THIN4 = 0xA ,
  MODE_2B_TILED_THICK = 0xB , MODE_3D_TILED_THIN1 = 0xC , MODE_3D_TILED_THICK = 0xD , MODE_3B_TILED_THIN1 = 0xE ,
  MODE_3B_TILED_THICK = 0xF , MODE_LAST = 0x20
}
 
enum  AddrTileMode {
  ADDR_TM_LINEAR_GENERAL = 0x0 , ADDR_TM_LINEAR_ALIGNED = 0x1 , ADDR_TM_1D_TILED_THIN1 = 0x2 , ADDR_TM_1D_TILED_THICK = 0x3 ,
  ADDR_TM_2D_TILED_THIN1 = 0x4 , ADDR_TM_2D_TILED_THIN2 = 0x5 , ADDR_TM_2D_TILED_THIN4 = 0x6 , ADDR_TM_2D_TILED_THICK = 0x7 ,
  ADDR_TM_2B_TILED_THIN1 = 0x8 , ADDR_TM_2B_TILED_THIN2 = 0x9 , ADDR_TM_2B_TILED_THIN4 = 0x0A , ADDR_TM_2B_TILED_THICK = 0x0B ,
  ADDR_TM_3D_TILED_THIN1 = 0x0C , ADDR_TM_3D_TILED_THICK = 0x0D , ADDR_TM_3B_TILED_THIN1 = 0x0E , ADDR_TM_3B_TILED_THICK = 0x0F ,
  ADDR_TM_2D_TILED_XTHICK = 0x10 , ADDR_TM_3D_TILED_XTHICK = 0x11 , ADDR_TM_POWER_SAVE = 0x12 , ADDR_TM_COUNT = 0x13
}
 
enum  AddrTileType { ADDR_DISPLAYABLE = 0 , ADDR_NON_DISPLAYABLE = 1 , ADDR_DEPTH_SAMPLE_ORDER = 2 , ADDR_THICK_TILING = 3 }
 
enum  AddrPipeCfg {
  ADDR_PIPECFG_INVALID = 0x0 , ADDR_PIPECFG_P2 = 0x1 , ADDR_PIPECFG_P4_8x16 = 0x5 , ADDR_PIPECFG_P4_16x16 = 0x6 ,
  ADDR_PIPECFG_P4_16x32 = 0x7 , ADDR_PIPECFG_P4_32x32 = 0x8 , ADDR_PIPECFG_P8_16x16_8x16 = 0x9 , ADDR_PIPECFG_P8_16x32_8x16 = 0xA ,
  ADDR_PIPECFG_P8_32x32_8x16 = 0xB , ADDR_PIPECFG_P8_16x32_16x16 = 0xC , ADDR_PIPECFG_P8_32x32_16x16 = 0xD , ADDR_PIPECFG_P8_32x32_16x32 = 0xE ,
  ADDR_PIPECFG_P8_32x64_32x32 = 0xF , ADDR_PIPECFG_MAX = 0x10
}
 
enum  AddrFormat {
  ADDR_FMT_INVALID = 0x0 , ADDR_FMT_8 = 0x1 , ADDR_FMT_4_4 = 0x2 , ADDR_FMT_3_3_2 = 0x3 ,
  ADDR_FMT_RESERVED_4 = 0x4 , ADDR_FMT_16 = 0x5 , ADDR_FMT_16_FLOAT = 0x6 , ADDR_FMT_8_8 = 0x7 ,
  ADDR_FMT_5_6_5 = 0x8 , ADDR_FMT_6_5_5 = 0x9 , ADDR_FMT_1_5_5_5 = 0xA , ADDR_FMT_4_4_4_4 = 0xB ,
  ADDR_FMT_5_5_5_1 = 0xC , ADDR_FMT_32 = 0xD , ADDR_FMT_32_FLOAT = 0xE , ADDR_FMT_16_16 = 0xF ,
  ADDR_FMT_16_16_FLOAT = 0x10 , ADDR_FMT_8_24 = 0x11 , ADDR_FMT_8_24_FLOAT = 0x12 , ADDR_FMT_24_8 = 0x13 ,
  ADDR_FMT_24_8_FLOAT = 0x14 , ADDR_FMT_10_11_11 = 0x15 , ADDR_FMT_10_11_11_FLOAT = 0x16 , ADDR_FMT_11_11_10 = 0x17 ,
  ADDR_FMT_11_11_10_FLOAT = 0x18 , ADDR_FMT_2_10_10_10 = 0x19 , ADDR_FMT_8_8_8_8 = 0x1A , ADDR_FMT_10_10_10_2 = 0x1B ,
  ADDR_FMT_X24_8_32_FLOAT = 0x1C , ADDR_FMT_32_32 = 0x1D , ADDR_FMT_32_32_FLOAT = 0x1E , ADDR_FMT_16_16_16_16 = 0x1F ,
  ADDR_FMT_16_16_16_16_FLOAT = 0x20 , ADDR_FMT_RESERVED_33 = 0x21 , ADDR_FMT_32_32_32_32 = 0x22 , ADDR_FMT_32_32_32_32_FLOAT = 0x23 ,
  ADDR_FMT_RESERVED_36 = 0x24 , ADDR_FMT_1 = 0x25 , ADDR_FMT_1_REVERSED = 0x26 , ADDR_FMT_GB_GR = 0x27 ,
  ADDR_FMT_BG_RG = 0x28 , ADDR_FMT_32_AS_8 = 0x29 , ADDR_FMT_32_AS_8_8 = 0x2A , ADDR_FMT_5_9_9_9_SHAREDEXP = 0x2B ,
  ADDR_FMT_8_8_8 = 0x2C , ADDR_FMT_16_16_16 = 0x2D , ADDR_FMT_16_16_16_FLOAT = 0x2E , ADDR_FMT_32_32_32 = 0x2F ,
  ADDR_FMT_32_32_32_FLOAT = 0x30 , ADDR_FMT_BC1 = 0x31 , ADDR_FMT_BC2 = 0x32 , ADDR_FMT_BC3 = 0x33 ,
  ADDR_FMT_BC4 = 0x34 , ADDR_FMT_BC5 = 0x35 , ADDR_FMT_BC6 = 0x36 , ADDR_FMT_BC7 = 0x37 ,
  ADDR_FMT_32_AS_32_32_32_32 = 0x38 , ADDR_FMT_APC3 = 0x39 , ADDR_FMT_APC4 = 0x3A , ADDR_FMT_APC5 = 0x3B ,
  ADDR_FMT_APC6 = 0x3C , ADDR_FMT_APC7 = 0x3D , ADDR_FMT_CTX1 = 0x3E , ADDR_FMT_RESERVED_63 = 0x3F
}
 

Static Public Member Functions

static GX2SurfaceFormat ConvertToGx2Format (TEX_FORMAT texFormat)
 
static void Debug (surfaceOut surf)
 
static GX2Surface CreateGx2Texture (byte[] imageData, string Name, uint TileMode, uint AAMode, uint Width, uint Height, uint Depth, uint Format, uint swizzle, uint SurfaceDim, uint MipCount)
 
static uint[] CreateRegisters (GX2Surface surface)
 
static uint[] GenerateMipOffsets (GX2Surface tex)
 
static byte[] Decode (GX2Surface tex, int ArrayIndex=-1, int MipIndex=-1, string DebugTextureName="")
 
static List< List< byte[]> > Decode (GX2Surface tex, string DebugTextureName="")
 
static bool IsFormatBCN (GX2SurfaceFormat Format)
 
static byte[] deswizzle (uint width, uint height, uint depth, uint height_, uint format_, uint aa, uint use, uint tileMode, uint swizzle_, uint pitch, uint bpp, uint slice, uint sample, byte[] data)
 
static byte[] swizzle (uint width, uint height, uint depth, uint height_, uint format_, uint aa, uint use, uint tileMode, uint swizzle_, uint pitch, uint bpp, uint slice, uint sample, byte[] data)
 
static uint surfaceGetBitsPerPixel (uint surfaceFormat)
 
static uint nextPow2 (uint dim)
 
static uint getDefaultGX2TileMode (uint dim, uint width, uint height, uint depth, uint format_, uint aa, uint use)
 
static uint computeSurfaceMipLevelTileMode (uint baseTileMode, uint bpp, uint level, uint width, uint height, uint numSlices, uint numSamples, uint isDepth, uint noRecursive)
 
static surfaceOut getSurfaceInfo (GX2SurfaceFormat surfaceFormat, uint surfaceWidth, uint surfaceHeight, uint surfaceDepth, uint surfaceDim, uint surfaceTileMode, uint surfaceAA, int level)
 Gets the surface info of a GX2 texture.
 
static byte[] CombineByteArray (params byte[][] arrays)
 

Static Public Attributes

const uint SwizzleMask = 0xFF00FF
 
static uint expPitch = 0
 
static uint expHeight = 0
 
static uint expNumSlices = 0
 

Static Private Member Functions

static int RoundUp (int X, int Y)
 
static uint RoundUp (uint X, uint Y)
 
static byte[] SubArray (byte[] data, int offset, int length)
 
static uint DIV_ROUND_UP (uint n, uint d)
 
static byte[] swizzleSurf (uint width, uint height, uint depth, uint format, uint aa, uint use, uint tileMode, uint swizzle_, uint pitch, uint bitsPerPixel, uint slice, uint sample, byte[] data, int swizzle)
 
static uint GX2TileModeToAddrTileMode (uint tileMode)
 
static uint computeSurfaceThickness (AddrTileMode tileMode)
 
static uint computePixelIndexWithinMicroTile (uint x, uint y, uint z, uint bpp, AddrTileMode tileMode, bool IsDepth)
 
static uint computePipeFromCoordWoRotation (uint x, uint y)
 
static uint computeBankFromCoordWoRotation (uint x, uint y)
 
static uint computeSurfaceRotationFromTileMode (AddrTileMode tileMode)
 
static uint isThickMacroTiled (AddrTileMode tileMode)
 
static uint isBankSwappedTileMode (AddrTileMode tileMode)
 
static uint computeMacroTileAspectRatio (AddrTileMode tileMode)
 
static uint computeSurfaceBankSwappedWidth (AddrTileMode tileMode, uint bpp, uint numSamples, uint pitch)
 
static ulong computeSurfaceAddrFromCoordLinear (uint x, uint y, uint slice, uint sample, uint bpp, uint pitch, uint height, uint numSlices)
 
static ulong computeSurfaceAddrFromCoordMicroTiled (uint x, uint y, uint slice, uint bpp, uint pitch, uint height, AddrTileMode tileMode, bool IsDepth)
 
static ulong computeSurfaceAddrFromCoordMacroTiled (uint x, uint y, uint slice, uint sample, uint bpp, uint pitch, uint height, uint numSamples, AddrTileMode tileMode, bool IsDepth, uint pipeSwizzle, uint bankSwizzle)
 
static uint computeSurfaceTileSlices (uint tileMode, uint bpp, uint numSamples)
 
static uint ComputeSurfaceInfoEx ()
 
static uint[] computeSurfaceInfoLinear (uint tileMode, uint bpp, uint numSamples, uint pitch, uint height, uint numSlices, uint mipLevel, uint padDims, Flags flags)
 
static Tuple< uint, uint, uint > computeSurfaceAlignmentsLinear (uint tileMode, uint bpp, Flags flags)
 
static uint convertToNonBankSwappedMode (AddrTileMode tileMode)
 
static void computeSurfaceInfo (surfaceIn aSurfIn, surfaceOut pSurfOut)
 
static uint[] computeSurfaceInfoMicroTiled (uint tileMode, uint bpp, uint numSamples, uint pitch, uint height, uint numSlices, uint mipLevel, uint padDims, Flags flags)
 
static Tuple< uint, uint, uint > padDimensions (uint tileMode, uint padDims, uint isCube, uint pitchAlign, uint heightAlign, uint sliceAlign)
 
static uint[] computeSurfaceInfoMacroTiled (uint tileMode, uint baseTileMode, uint bpp, uint numSamples, uint pitch, uint height, uint numSlices, uint mipLevel, uint padDims, Flags flags)
 
static Tuple< uint, uint, uint > computeSurfaceAlignmentsMicroTiled (uint tileMode, uint bpp, Flags flags, uint numSamples)
 
static Tuple< uint, uint, uint, uint, uint > computeSurfaceAlignmentsMacroTiled (uint tileMode, uint bpp, Flags flags, uint numSamples)
 
static uint adjustPitchAlignment (Flags flags, uint pitchAlign)
 
static uint adjustSurfaceInfo (uint elemMode, uint expandX, uint expandY, uint bpp, uint width, uint height)
 
static void computeMipLevel ()
 
static uint restoreSurfaceInfo (uint elemMode, uint expandX, uint expandY, uint bpp)
 
static uint hwlComputeMipLevel ()
 
static uint powTwoAlign (uint x, uint align)
 

Static Private Attributes

static surfaceIn pIn = new surfaceIn()
 
static surfaceOut pOut = new surfaceOut()
 
static bool DebugSurface = false
 
static byte[] formatHwInfo
 
static byte[] formatExInfo
 
static byte[] bankSwapOrder = { 0, 1, 3, 2, 6, 7, 5, 4, 0, 0 }
 

Member Enumeration Documentation

◆ AddrFormat

Enumerator
ADDR_FMT_INVALID 
ADDR_FMT_8 
ADDR_FMT_4_4 
ADDR_FMT_3_3_2 
ADDR_FMT_RESERVED_4 
ADDR_FMT_16 
ADDR_FMT_16_FLOAT 
ADDR_FMT_8_8 
ADDR_FMT_5_6_5 
ADDR_FMT_6_5_5 
ADDR_FMT_1_5_5_5 
ADDR_FMT_4_4_4_4 
ADDR_FMT_5_5_5_1 
ADDR_FMT_32 
ADDR_FMT_32_FLOAT 
ADDR_FMT_16_16 
ADDR_FMT_16_16_FLOAT 
ADDR_FMT_8_24 
ADDR_FMT_8_24_FLOAT 
ADDR_FMT_24_8 
ADDR_FMT_24_8_FLOAT 
ADDR_FMT_10_11_11 
ADDR_FMT_10_11_11_FLOAT 
ADDR_FMT_11_11_10 
ADDR_FMT_11_11_10_FLOAT 
ADDR_FMT_2_10_10_10 
ADDR_FMT_8_8_8_8 
ADDR_FMT_10_10_10_2 
ADDR_FMT_X24_8_32_FLOAT 
ADDR_FMT_32_32 
ADDR_FMT_32_32_FLOAT 
ADDR_FMT_16_16_16_16 
ADDR_FMT_16_16_16_16_FLOAT 
ADDR_FMT_RESERVED_33 
ADDR_FMT_32_32_32_32 
ADDR_FMT_32_32_32_32_FLOAT 
ADDR_FMT_RESERVED_36 
ADDR_FMT_1 
ADDR_FMT_1_REVERSED 
ADDR_FMT_GB_GR 
ADDR_FMT_BG_RG 
ADDR_FMT_32_AS_8 
ADDR_FMT_32_AS_8_8 
ADDR_FMT_5_9_9_9_SHAREDEXP 
ADDR_FMT_8_8_8 
ADDR_FMT_16_16_16 
ADDR_FMT_16_16_16_FLOAT 
ADDR_FMT_32_32_32 
ADDR_FMT_32_32_32_FLOAT 
ADDR_FMT_BC1 
ADDR_FMT_BC2 
ADDR_FMT_BC3 
ADDR_FMT_BC4 
ADDR_FMT_BC5 
ADDR_FMT_BC6 
ADDR_FMT_BC7 
ADDR_FMT_32_AS_32_32_32_32 
ADDR_FMT_APC3 
ADDR_FMT_APC4 
ADDR_FMT_APC5 
ADDR_FMT_APC6 
ADDR_FMT_APC7 
ADDR_FMT_CTX1 
ADDR_FMT_RESERVED_63 

◆ AddrPipeCfg

Enumerator
ADDR_PIPECFG_INVALID 
ADDR_PIPECFG_P2 
ADDR_PIPECFG_P4_8x16 
ADDR_PIPECFG_P4_16x16 
ADDR_PIPECFG_P4_16x32 
ADDR_PIPECFG_P4_32x32 
ADDR_PIPECFG_P8_16x16_8x16 
ADDR_PIPECFG_P8_16x32_8x16 
ADDR_PIPECFG_P8_32x32_8x16 
ADDR_PIPECFG_P8_16x32_16x16 
ADDR_PIPECFG_P8_32x32_16x16 
ADDR_PIPECFG_P8_32x32_16x32 
ADDR_PIPECFG_P8_32x64_32x32 
ADDR_PIPECFG_MAX 

◆ AddrTileMode

Enumerator
ADDR_TM_LINEAR_GENERAL 
ADDR_TM_LINEAR_ALIGNED 
ADDR_TM_1D_TILED_THIN1 
ADDR_TM_1D_TILED_THICK 
ADDR_TM_2D_TILED_THIN1 
ADDR_TM_2D_TILED_THIN2 
ADDR_TM_2D_TILED_THIN4 
ADDR_TM_2D_TILED_THICK 
ADDR_TM_2B_TILED_THIN1 
ADDR_TM_2B_TILED_THIN2 
ADDR_TM_2B_TILED_THIN4 
ADDR_TM_2B_TILED_THICK 
ADDR_TM_3D_TILED_THIN1 
ADDR_TM_3D_TILED_THICK 
ADDR_TM_3B_TILED_THIN1 
ADDR_TM_3B_TILED_THICK 
ADDR_TM_2D_TILED_XTHICK 
ADDR_TM_3D_TILED_XTHICK 
ADDR_TM_POWER_SAVE 
ADDR_TM_COUNT 

◆ AddrTileType

Enumerator
ADDR_DISPLAYABLE 
ADDR_NON_DISPLAYABLE 
ADDR_DEPTH_SAMPLE_ORDER 
ADDR_THICK_TILING 

◆ GX2AAMode

Enumerator
GX2_AA_MODE_1X 
GX2_AA_MODE_2X 
GX2_AA_MODE_4X 
GX2_AA_MODE_8X 
GX2_AA_MODE_FIRST 
GX2_AA_MODE_LAST 

◆ GX2RResourceFlags

Enumerator
GX2R_RESOURCE_FLAGS_NONE 
GX2R_BIND_NONE 
GX2R_BIND_TEXTURE 
GX2R_BIND_COLOR_BUFFER 
GX2R_BIND_DEPTH_BUFFER 
GX2R_BIND_SCAN_BUFFER 
GX2R_BIND_VERTEX_BUFFER 
GX2R_BIND_INDEX_BUFFER 
GX2R_BIND_UNIFORM_BLOCK 
GX2R_BIND_SHADER_PROGRAM 
GX2R_BIND_STREAM_OUTPUT 
GX2R_BIND_DISPLAY_LIST 
GX2R_BIND_GS_RING 
GX2R_USAGE_NONE 
GX2R_USAGE_CPU_READ 
GX2R_USAGE_CPU_WRITE 
GX2R_USAGE_GPU_READ 
GX2R_USAGE_GPU_WRITE 
GX2R_USAGE_DMA_READ 
GX2R_USAGE_DMA_WRITE 
GX2R_USAGE_FORCE_MEM1 
GX2R_USAGE_FORCE_MEM2 
GX2R_USAGE_MEM_DEFAULT 
GX2R_USAGE_CPU_READWRITE 
GX2R_USAGE_GPU_READWRITE 
GX2R_USAGE_NON_CPU_WRITE 
GX2R_OPTION_NONE 
GX2R_OPTION_IGNORE_IN_USE 
GX2R_OPTION_FIRST 
GX2R_OPTION_NO_CPU_INVALIDATE 
GX2R_OPTION_NO_GPU_INVALIDATE 
GX2R_OPTION_LOCK_READONLY 
GX2R_OPTION_NO_TOUCH_DESTROY 
GX2R_OPTION_LAST 
GX2R_OPTION_NO_INVALIDATE 
GX2R_OPTION_MASK 
GX2R_RESOURCE_FLAG_RESERVED2 
GX2R_RESOURCE_FLAG_RESERVED1 
GX2R_RESOURCE_FLAG_RESERVED0 

◆ GX2SurfaceDimension

Enumerator
DIM_1D 
DIM_2D 
DIM_3D 
DIM_CUBE 
DIM_1D_ARRAY 
DIM_2D_ARRAY 
DIM_2D_MSAA 
DIM_2D_MSAA_ARRAY 
DIM_FIRST 
DIM_LAST 

◆ GX2SurfaceFormat

Enumerator
INVALID 
TC_R8_UNORM 
TC_R8_UINT 
TC_R8_SNORM 
TC_R8_SINT 
T_R4_G4_UNORM 
TCD_R16_UNORM 
TC_R16_UINT 
TC_R16_SNORM 
TC_R16_SINT 
TC_R16_FLOAT 
TC_R8_G8_UNORM 
TC_R8_G8_UINT 
TC_R8_G8_SNORM 
TC_R8_G8_SINT 
TCS_R5_G6_B5_UNORM 
TC_R5_G5_B5_A1_UNORM 
TC_R4_G4_B4_A4_UNORM 
TC_A1_B5_G5_R5_UNORM 
TC_R32_UINT 
TC_R32_SINT 
TCD_R32_FLOAT 
TC_R16_G16_UNORM 
TC_R16_G16_UINT 
TC_R16_G16_SNORM 
TC_R16_G16_SINT 
TC_R16_G16_FLOAT 
D_D24_S8_UNORM 
T_R24_UNORM_X8 
T_X24_G8_UINT 
D_D24_S8_FLOAT 
TC_R11_G11_B10_FLOAT 
TCS_R10_G10_B10_A2_UNORM 
TC_R10_G10_B10_A2_UINT 
T_R10_G10_B10_A2_SNORM 
TC_R10_G10_B10_A2_SNORM 
TC_R10_G10_B10_A2_SINT 
TCS_R8_G8_B8_A8_UNORM 
TC_R8_G8_B8_A8_UINT 
TC_R8_G8_B8_A8_SNORM 
TC_R8_G8_B8_A8_SINT 
TCS_R8_G8_B8_A8_SRGB 
TCS_A2_B10_G10_R10_UNORM 
TC_A2_B10_G10_R10_UINT 
D_D32_FLOAT_S8_UINT_X24 
T_R32_FLOAT_X8_X24 
T_X32_G8_UINT_X24 
TC_R32_G32_UINT 
TC_R32_G32_SINT 
TC_R32_G32_FLOAT 
TC_R16_G16_B16_A16_UNORM 
TC_R16_G16_B16_A16_UINT 
TC_R16_G16_B16_A16_SNORM 
TC_R16_G16_B16_A16_SINT 
TC_R16_G16_B16_A16_FLOAT 
TC_R32_G32_B32_A32_UINT 
TC_R32_G32_B32_A32_SINT 
TC_R32_G32_B32_A32_FLOAT 
T_BC1_UNORM 
T_BC1_SRGB 
T_BC2_UNORM 
T_BC2_SRGB 
T_BC3_UNORM 
T_BC3_SRGB 
T_BC4_UNORM 
T_BC4_SNORM 
T_BC5_UNORM 
T_BC5_SNORM 
T_NV12_UNORM 
FIRST 
LAST 

◆ GX2SurfaceUse

Enumerator
USE_TEXTURE 
USE_COLOR_BUFFER 
USE_DEPTH_BUFFER 
USE_SCAN_BUFFER 
USE_FTV 
USE_COLOR_BUFFER_TEXTURE 
USE_DEPTH_BUFFER_TEXTURE 
USE_COLOR_BUFFER_FTV 
USE_COLOR_BUFFER_TEXTURE_FTV 
USE_FIRST 
USE_LAST 

◆ GX2TileMode

Enumerator
MODE_DEFAULT 
MODE_LINEAR_SPECIAL 
MODE_LINEAR_ALIGNED 
MODE_1D_TILED_THIN1 
MODE_1D_TILED_THICK 
MODE_2D_TILED_THIN1 
MODE_2D_TILED_THIN2 
MODE_2D_TILED_THIN4 
MODE_2D_TILED_THICK 
MODE_2B_TILED_THIN1 
MODE_2B_TILED_THIN2 
MODE_2B_TILED_THIN4 
MODE_2B_TILED_THICK 
MODE_3D_TILED_THIN1 
MODE_3D_TILED_THICK 
MODE_3B_TILED_THIN1 
MODE_3B_TILED_THICK 
MODE_LAST 

◆ TEX_FORMAT

Enumerator
UNKNOWN 
R32G32B32A32_TYPELESS 
R32G32B32A32_FLOAT 
R32G32B32A32_UINT 
R32G32B32A32_SINT 
R32G32B32_TYPELESS 
R32G32B32_FLOAT 
R32G32B32_UINT 
R32G32B32_SINT 
R16G16B16A16_TYPELESS 
R16G16B16A16_FLOAT 
R16G16B16A16_UNORM 
R16G16B16A16_UINT 
R16G16B16A16_SNORM 
R16G16B16A16_SINT 
R32G32_TYPELESS 
R32G32_FLOAT 
R32G32_UINT 
R32G32_SINT 
R32G8X24_TYPELESS 
D32_FLOAT_S8X24_UINT 
R32_FLOAT_X8X24_TYPELESS 
X32_TYPELESS_G8X24_UINT 
R10G10B10A2_TYPELESS 
R10G10B10A2_UNORM 
R10G10B10A2_UINT 
R11G11B10_FLOAT 
R8G8B8A8_TYPELESS 
R8G8B8A8_UNORM 
R8G8B8A8_UNORM_SRGB 
R8G8B8A8_UINT 
R8G8B8A8_SNORM 
R8G8B8A8_SINT 
R16G16_TYPELESS 
R16G16_FLOAT 
R16G16_UNORM 
R16G16_UINT 
R16G16_SNORM 
R16G16_SINT 
R32_TYPELESS 
D32_FLOAT 
R32_FLOAT 
R32_UINT 
R32_SINT 
R24G8_TYPELESS 
D24_UNORM_S8_UINT 
R24_UNORM_X8_TYPELESS 
X24_TYPELESS_G8_UINT 
R8G8_TYPELESS 
R8G8_UNORM 
R8G8_UINT 
R8G8_SNORM 
R8G8_SINT 
R16_TYPELESS 
R16_FLOAT 
D16_UNORM 
R16_UNORM 
R16_UINT 
R16_SNORM 
R16_SINT 
R8_TYPELESS 
R8_UNORM 
R8_UINT 
R8_SNORM 
R8_SINT 
A8_UNORM 
R1_UNORM 
R9G9B9E5_SHAREDEXP 
R8G8_B8G8_UNORM 
G8R8_G8B8_UNORM 
BC1_TYPELESS 
BC1_UNORM 
BC1_UNORM_SRGB 
BC2_TYPELESS 
BC2_UNORM 
BC2_UNORM_SRGB 
BC3_TYPELESS 
BC3_UNORM 
BC3_UNORM_SRGB 
BC4_TYPELESS 
BC4_UNORM 
BC4_SNORM 
BC5_TYPELESS 
BC5_UNORM 
BC5_SNORM 
B5G6R5_UNORM 
B5G5R5A1_UNORM 
B8G8R8A8_UNORM 
B8G8R8X8_UNORM 
R10G10B10_XR_BIAS_A2_UNORM 
B8G8R8A8_TYPELESS 
B8G8R8A8_UNORM_SRGB 
B8G8R8X8_TYPELESS 
B8G8R8X8_UNORM_SRGB 
BC6H_TYPELESS 
BC6H_UF16 
BC6H_SF16 
BC7_TYPELESS 
BC7_UNORM 
BC7_UNORM_SRGB 
AYUV 
Y410 
Y416 
NV12 
P010 
P016 
Format_420_OPAQUE 
YUY2 
Y210 
Y216 
NV11 
AI44 
IA44 
P8 
A8P8 
B4G4R4A4_UNORM 
P208 
V208 
V408 
R32G8X24_FLOAT 
ASTC_4x4_UNORM 
ASTC_4x4_SRGB 
ASTC_5x4_UNORM 
ASTC_5x4_SRGB 
ASTC_5x5_UNORM 
ASTC_5x5_SRGB 
ASTC_6x5_UNORM 
ASTC_6x5_SRGB 
ASTC_6x6_UNORM 
ASTC_6x6_SRGB 
ASTC_8x5_UNORM 
ASTC_8x5_SRGB 
ASTC_8x6_UNORM 
ASTC_8x6_SRGB 
ASTC_8x8_UNORM 
ASTC_8x8_SRGB 
ASTC_10x5_UNORM 
ASTC_10x5_SRGB 
ASTC_10x6_UNORM 
ASTC_10x6_SRGB 
ASTC_10x8_UNORM 
ASTC_10x8_SRGB 
ASTC_10x10_UNORM 
ASTC_10x10_SRGB 
ASTC_12x10_UNORM 
ASTC_12x10_SRGB 
ASTC_12x12_UNORM 
ASTC_12x12_SRGB 
ETC1_SRGB 
ETC1_UNORM 
ETC1_A4 
L4 
LA4 
L8 
LA8 
HIL08 
A4 
R4G4_UNORM 
I4 
I8 
IA4 
IA8 
R5G5B5_UNORM 
R5G5B5A3_UNORM 
RGBA32 
C4 
C8 
C14X2 
CMPR 
RGB565 
RGB5A3 
R5G5B5A1_UNORM 

Member Function Documentation

◆ adjustPitchAlignment()

static uint Toolbox.Library.GX2.adjustPitchAlignment ( Flags flags,
uint pitchAlign )
staticprivate

◆ adjustSurfaceInfo()

static uint Toolbox.Library.GX2.adjustSurfaceInfo ( uint elemMode,
uint expandX,
uint expandY,
uint bpp,
uint width,
uint height )
staticprivate

◆ CombineByteArray()

static byte[] Toolbox.Library.GX2.CombineByteArray ( params byte arrays[][])
static

◆ computeBankFromCoordWoRotation()

static uint Toolbox.Library.GX2.computeBankFromCoordWoRotation ( uint x,
uint y )
staticprivate

◆ computeMacroTileAspectRatio()

static uint Toolbox.Library.GX2.computeMacroTileAspectRatio ( AddrTileMode tileMode)
staticprivate

◆ computeMipLevel()

static void Toolbox.Library.GX2.computeMipLevel ( )
staticprivate

◆ computePipeFromCoordWoRotation()

static uint Toolbox.Library.GX2.computePipeFromCoordWoRotation ( uint x,
uint y )
staticprivate

◆ computePixelIndexWithinMicroTile()

static uint Toolbox.Library.GX2.computePixelIndexWithinMicroTile ( uint x,
uint y,
uint z,
uint bpp,
AddrTileMode tileMode,
bool IsDepth )
staticprivate

◆ computeSurfaceAddrFromCoordLinear()

static ulong Toolbox.Library.GX2.computeSurfaceAddrFromCoordLinear ( uint x,
uint y,
uint slice,
uint sample,
uint bpp,
uint pitch,
uint height,
uint numSlices )
staticprivate

◆ computeSurfaceAddrFromCoordMacroTiled()

static ulong Toolbox.Library.GX2.computeSurfaceAddrFromCoordMacroTiled ( uint x,
uint y,
uint slice,
uint sample,
uint bpp,
uint pitch,
uint height,
uint numSamples,
AddrTileMode tileMode,
bool IsDepth,
uint pipeSwizzle,
uint bankSwizzle )
staticprivate

◆ computeSurfaceAddrFromCoordMicroTiled()

static ulong Toolbox.Library.GX2.computeSurfaceAddrFromCoordMicroTiled ( uint x,
uint y,
uint slice,
uint bpp,
uint pitch,
uint height,
AddrTileMode tileMode,
bool IsDepth )
staticprivate

◆ computeSurfaceAlignmentsLinear()

static Tuple< uint, uint, uint > Toolbox.Library.GX2.computeSurfaceAlignmentsLinear ( uint tileMode,
uint bpp,
Flags flags )
staticprivate

◆ computeSurfaceAlignmentsMacroTiled()

static Tuple< uint, uint, uint, uint, uint > Toolbox.Library.GX2.computeSurfaceAlignmentsMacroTiled ( uint tileMode,
uint bpp,
Flags flags,
uint numSamples )
staticprivate

◆ computeSurfaceAlignmentsMicroTiled()

static Tuple< uint, uint, uint > Toolbox.Library.GX2.computeSurfaceAlignmentsMicroTiled ( uint tileMode,
uint bpp,
Flags flags,
uint numSamples )
staticprivate

◆ computeSurfaceBankSwappedWidth()

static uint Toolbox.Library.GX2.computeSurfaceBankSwappedWidth ( AddrTileMode tileMode,
uint bpp,
uint numSamples,
uint pitch )
staticprivate

◆ computeSurfaceInfo()

static void Toolbox.Library.GX2.computeSurfaceInfo ( surfaceIn aSurfIn,
surfaceOut pSurfOut )
staticprivate

◆ ComputeSurfaceInfoEx()

static uint Toolbox.Library.GX2.ComputeSurfaceInfoEx ( )
staticprivate

◆ computeSurfaceInfoLinear()

static uint[] Toolbox.Library.GX2.computeSurfaceInfoLinear ( uint tileMode,
uint bpp,
uint numSamples,
uint pitch,
uint height,
uint numSlices,
uint mipLevel,
uint padDims,
Flags flags )
staticprivate

◆ computeSurfaceInfoMacroTiled()

static uint[] Toolbox.Library.GX2.computeSurfaceInfoMacroTiled ( uint tileMode,
uint baseTileMode,
uint bpp,
uint numSamples,
uint pitch,
uint height,
uint numSlices,
uint mipLevel,
uint padDims,
Flags flags )
staticprivate

◆ computeSurfaceInfoMicroTiled()

static uint[] Toolbox.Library.GX2.computeSurfaceInfoMicroTiled ( uint tileMode,
uint bpp,
uint numSamples,
uint pitch,
uint height,
uint numSlices,
uint mipLevel,
uint padDims,
Flags flags )
staticprivate

◆ computeSurfaceMipLevelTileMode()

static uint Toolbox.Library.GX2.computeSurfaceMipLevelTileMode ( uint baseTileMode,
uint bpp,
uint level,
uint width,
uint height,
uint numSlices,
uint numSamples,
uint isDepth,
uint noRecursive )
static

◆ computeSurfaceRotationFromTileMode()

static uint Toolbox.Library.GX2.computeSurfaceRotationFromTileMode ( AddrTileMode tileMode)
staticprivate

◆ computeSurfaceThickness()

static uint Toolbox.Library.GX2.computeSurfaceThickness ( AddrTileMode tileMode)
staticprivate

◆ computeSurfaceTileSlices()

static uint Toolbox.Library.GX2.computeSurfaceTileSlices ( uint tileMode,
uint bpp,
uint numSamples )
staticprivate

◆ ConvertToGx2Format()

static GX2SurfaceFormat Toolbox.Library.GX2.ConvertToGx2Format ( TEX_FORMAT texFormat)
static

◆ convertToNonBankSwappedMode()

static uint Toolbox.Library.GX2.convertToNonBankSwappedMode ( AddrTileMode tileMode)
staticprivate

◆ CreateGx2Texture()

static GX2Surface Toolbox.Library.GX2.CreateGx2Texture ( byte[] imageData,
string Name,
uint TileMode,
uint AAMode,
uint Width,
uint Height,
uint Depth,
uint Format,
uint swizzle,
uint SurfaceDim,
uint MipCount )
static

◆ CreateRegisters()

static uint[] Toolbox.Library.GX2.CreateRegisters ( GX2Surface surface)
static

◆ Debug()

static void Toolbox.Library.GX2.Debug ( surfaceOut surf)
static

◆ Decode() [1/2]

static byte[] Toolbox.Library.GX2.Decode ( GX2Surface tex,
int ArrayIndex = -1,
int MipIndex = -1,
string DebugTextureName = "" )
static

◆ Decode() [2/2]

static List< List< byte[]> > Toolbox.Library.GX2.Decode ( GX2Surface tex,
string DebugTextureName = "" )
static

◆ deswizzle()

static byte[] Toolbox.Library.GX2.deswizzle ( uint width,
uint height,
uint depth,
uint height_,
uint format_,
uint aa,
uint use,
uint tileMode,
uint swizzle_,
uint pitch,
uint bpp,
uint slice,
uint sample,
byte[] data )
static

◆ DIV_ROUND_UP()

static uint Toolbox.Library.GX2.DIV_ROUND_UP ( uint n,
uint d )
staticprivate

◆ GenerateMipOffsets()

static uint[] Toolbox.Library.GX2.GenerateMipOffsets ( GX2Surface tex)
static

◆ getDefaultGX2TileMode()

static uint Toolbox.Library.GX2.getDefaultGX2TileMode ( uint dim,
uint width,
uint height,
uint depth,
uint format_,
uint aa,
uint use )
static

◆ getSurfaceInfo()

static surfaceOut Toolbox.Library.GX2.getSurfaceInfo ( GX2SurfaceFormat surfaceFormat,
uint surfaceWidth,
uint surfaceHeight,
uint surfaceDepth,
uint surfaceDim,
uint surfaceTileMode,
uint surfaceAA,
int level )
static

Gets the surface info of a GX2 texture.

Parameters
surfaceFormatThe GX2SurfaceFormat of the surface.
surfaceWidthThe width of the surface.
surfaceHeightThe height of the surface.
surfaceDepthThe depth of the surface.
surfaceDimThe <see cref="GX2SurfaceDim"/ of the surface.
surfaceTileModeThe <see cref="GX2TileMode"/ of the surface.
surfaceAAThe <see cref="GX2AAMode"/ of the surface.
levelThe mip level of which the info will be calculated for (first mipmap corresponds to value 1

◆ GX2TileModeToAddrTileMode()

static uint Toolbox.Library.GX2.GX2TileModeToAddrTileMode ( uint tileMode)
staticprivate

◆ hwlComputeMipLevel()

static uint Toolbox.Library.GX2.hwlComputeMipLevel ( )
staticprivate

◆ isBankSwappedTileMode()

static uint Toolbox.Library.GX2.isBankSwappedTileMode ( AddrTileMode tileMode)
staticprivate

◆ IsFormatBCN()

static bool Toolbox.Library.GX2.IsFormatBCN ( GX2SurfaceFormat Format)
static

◆ isThickMacroTiled()

static uint Toolbox.Library.GX2.isThickMacroTiled ( AddrTileMode tileMode)
staticprivate

◆ nextPow2()

static uint Toolbox.Library.GX2.nextPow2 ( uint dim)
static

◆ padDimensions()

static Tuple< uint, uint, uint > Toolbox.Library.GX2.padDimensions ( uint tileMode,
uint padDims,
uint isCube,
uint pitchAlign,
uint heightAlign,
uint sliceAlign )
staticprivate

◆ powTwoAlign()

static uint Toolbox.Library.GX2.powTwoAlign ( uint x,
uint align )
staticprivate

◆ restoreSurfaceInfo()

static uint Toolbox.Library.GX2.restoreSurfaceInfo ( uint elemMode,
uint expandX,
uint expandY,
uint bpp )
staticprivate

◆ RoundUp() [1/2]

static int Toolbox.Library.GX2.RoundUp ( int X,
int Y )
staticprivate

◆ RoundUp() [2/2]

static uint Toolbox.Library.GX2.RoundUp ( uint X,
uint Y )
staticprivate

◆ SubArray()

static byte[] Toolbox.Library.GX2.SubArray ( byte[] data,
int offset,
int length )
staticprivate

◆ surfaceGetBitsPerPixel()

static uint Toolbox.Library.GX2.surfaceGetBitsPerPixel ( uint surfaceFormat)
static

◆ swizzle()

static byte[] Toolbox.Library.GX2.swizzle ( uint width,
uint height,
uint depth,
uint height_,
uint format_,
uint aa,
uint use,
uint tileMode,
uint swizzle_,
uint pitch,
uint bpp,
uint slice,
uint sample,
byte[] data )
static

◆ swizzleSurf()

static byte[] Toolbox.Library.GX2.swizzleSurf ( uint width,
uint height,
uint depth,
uint format,
uint aa,
uint use,
uint tileMode,
uint swizzle_,
uint pitch,
uint bitsPerPixel,
uint slice,
uint sample,
byte[] data,
int swizzle )
staticprivate

Member Data Documentation

◆ bankSwapOrder

byte [] Toolbox.Library.GX2.bankSwapOrder = { 0, 1, 3, 2, 6, 7, 5, 4, 0, 0 }
staticprivate

◆ DebugSurface

bool Toolbox.Library.GX2.DebugSurface = false
staticprivate

◆ expHeight

uint Toolbox.Library.GX2.expHeight = 0
static

◆ expNumSlices

uint Toolbox.Library.GX2.expNumSlices = 0
static

◆ expPitch

uint Toolbox.Library.GX2.expPitch = 0
static

◆ formatExInfo

byte [] Toolbox.Library.GX2.formatExInfo
staticprivate
Initial value:
= {
0x00, 0x01, 0x01, 0x03, 0x08, 0x01, 0x01, 0x03, 0x08, 0x01, 0x01, 0x03, 0x08, 0x01, 0x01, 0x03,
0x00, 0x01, 0x01, 0x03, 0x10, 0x01, 0x01, 0x03, 0x10, 0x01, 0x01, 0x03, 0x10, 0x01, 0x01, 0x03,
0x10, 0x01, 0x01, 0x03, 0x10, 0x01, 0x01, 0x03, 0x10, 0x01, 0x01, 0x03, 0x10, 0x01, 0x01, 0x03,
0x10, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03,
0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03,
0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03,
0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03,
0x40, 0x01, 0x01, 0x03, 0x40, 0x01, 0x01, 0x03, 0x40, 0x01, 0x01, 0x03, 0x40, 0x01, 0x01, 0x03,
0x40, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x03, 0x80, 0x01, 0x01, 0x03, 0x80, 0x01, 0x01, 0x03,
0x00, 0x01, 0x01, 0x03, 0x01, 0x08, 0x01, 0x05, 0x01, 0x08, 0x01, 0x06, 0x10, 0x01, 0x01, 0x07,
0x10, 0x01, 0x01, 0x08, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03, 0x20, 0x01, 0x01, 0x03,
0x18, 0x03, 0x01, 0x04, 0x30, 0x03, 0x01, 0x04, 0x30, 0x03, 0x01, 0x04, 0x60, 0x03, 0x01, 0x04,
0x60, 0x03, 0x01, 0x04, 0x40, 0x04, 0x04, 0x09, 0x80, 0x04, 0x04, 0x0A, 0x80, 0x04, 0x04, 0x0B,
0x40, 0x04, 0x04, 0x0C, 0x40, 0x04, 0x04, 0x0D, 0x40, 0x04, 0x04, 0x0D, 0x40, 0x04, 0x04, 0x0D,
0x00, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x03,
0x00, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x03, 0x40, 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x03,
}

◆ formatHwInfo

byte [] Toolbox.Library.GX2.formatHwInfo
staticprivate
Initial value:
= {
0x00, 0x00, 0x00, 0x01, 0x08, 0x03, 0x00, 0x01, 0x08, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00, 0x10, 0x03, 0x00, 0x01, 0x10, 0x03, 0x00, 0x01,
0x10, 0x0B, 0x00, 0x01, 0x10, 0x01, 0x00, 0x01, 0x10, 0x03, 0x00, 0x01, 0x10, 0x03, 0x00, 0x01,
0x10, 0x03, 0x00, 0x01, 0x20, 0x03, 0x00, 0x00, 0x20, 0x07, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00,
0x20, 0x03, 0x00, 0x01, 0x20, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x20, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x01, 0x20, 0x0B, 0x00, 0x01, 0x20, 0x0B, 0x00, 0x01, 0x20, 0x0B, 0x00, 0x01,
0x40, 0x05, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00,
0x40, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x10, 0x01, 0x00, 0x00,
0x10, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00,
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00,
0x60, 0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x01,
0x40, 0x01, 0x00, 0x01, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}

◆ pIn

surfaceIn Toolbox.Library.GX2.pIn = new surfaceIn()
staticprivate

◆ pOut

surfaceOut Toolbox.Library.GX2.pOut = new surfaceOut()
staticprivate

◆ SwizzleMask

const uint Toolbox.Library.GX2.SwizzleMask = 0xFF00FF
static

The documentation for this class was generated from the following file: