WUT  0.1
Wii U Toolchain
surface.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef enum
15 {
25 
26 typedef enum
27 {
49 
63 
73 
84 
89 
100 
101 typedef enum GX2AAMode
102 {
104 } GX2AAMode;
105 
106 typedef enum GX2SurfaceUse
107 {
112 } GX2SurfaceUse;
113 
114 typedef enum GX2RResourceFlags
115 {
138 
139 typedef enum GX2TileMode
140 {
158 } GX2TileMode;
159 
161 {
163  uint32_t width;
164  uint32_t height;
165  uint32_t depth;
166  uint32_t mipLevels;
169  union
170  {
173  };
174  uint32_t imageSize;
175  void *image;
176  uint32_t mipmapSize;
177  void *mipmaps;
179  uint32_t swizzle;
180  uint32_t alignment;
181  uint32_t pitch;
182  uint32_t mipLevelOffset[13];
183 };
184 CHECK_OFFSET(GX2Surface, 0x0, dim);
185 CHECK_OFFSET(GX2Surface, 0x4, width);
186 CHECK_OFFSET(GX2Surface, 0x8, height);
187 CHECK_OFFSET(GX2Surface, 0xc, depth);
188 CHECK_OFFSET(GX2Surface, 0x10, mipLevels);
189 CHECK_OFFSET(GX2Surface, 0x14, format);
190 CHECK_OFFSET(GX2Surface, 0x18, aa);
191 CHECK_OFFSET(GX2Surface, 0x1c, use);
192 CHECK_OFFSET(GX2Surface, 0x1c, resourceFlags);
193 CHECK_OFFSET(GX2Surface, 0x20, imageSize);
194 CHECK_OFFSET(GX2Surface, 0x24, image);
195 CHECK_OFFSET(GX2Surface, 0x28, mipmapSize);
196 CHECK_OFFSET(GX2Surface, 0x2c, mipmaps);
197 CHECK_OFFSET(GX2Surface, 0x30, tileMode);
198 CHECK_OFFSET(GX2Surface, 0x34, swizzle);
199 CHECK_OFFSET(GX2Surface, 0x38, alignment);
200 CHECK_OFFSET(GX2Surface, 0x3C, pitch);
201 CHECK_OFFSET(GX2Surface, 0x40, mipLevelOffset);
202 CHECK_SIZE(GX2Surface, 0x74);
203 
205 {
207 
208  uint32_t viewMip;
209  uint32_t viewFirstSlice;
210  uint32_t viewNumSlices;
211  void *hiZPtr;
212  uint32_t hiZSize;
213  float depthClear;
214  uint32_t stencilClear;
215 
216  uint32_t regs[7];
217 };
218 CHECK_OFFSET(GX2DepthBuffer, 0x74, viewMip);
219 CHECK_OFFSET(GX2DepthBuffer, 0x78, viewFirstSlice);
220 CHECK_OFFSET(GX2DepthBuffer, 0x7C, viewNumSlices);
221 CHECK_OFFSET(GX2DepthBuffer, 0x80, hiZPtr);
222 CHECK_OFFSET(GX2DepthBuffer, 0x84, hiZSize);
223 CHECK_OFFSET(GX2DepthBuffer, 0x88, depthClear);
224 CHECK_OFFSET(GX2DepthBuffer, 0x8C, stencilClear);
225 CHECK_OFFSET(GX2DepthBuffer, 0x90, regs);
226 CHECK_SIZE(GX2DepthBuffer, 0xAC);
227 
229 {
231 
232  uint32_t viewMip;
233  uint32_t viewFirstSlice;
234  uint32_t viewNumSlices;
235  void *aaBuffer;
236  uint32_t aaSize;
237 
238  uint32_t regs[5];
239 };
240 CHECK_OFFSET(GX2ColorBuffer, 0x74, viewMip);
241 CHECK_OFFSET(GX2ColorBuffer, 0x78, viewFirstSlice);
242 CHECK_OFFSET(GX2ColorBuffer, 0x7C, viewNumSlices);
243 CHECK_OFFSET(GX2ColorBuffer, 0x80, aaBuffer);
244 CHECK_OFFSET(GX2ColorBuffer, 0x84, aaSize);
245 CHECK_OFFSET(GX2ColorBuffer, 0x88, regs);
246 CHECK_SIZE(GX2ColorBuffer, 0x9C);
247 
248 void
250 
251 void
253  uint32_t *outSize,
254  uint32_t *outAlignment);
255 
256 void
257 GX2SetColorBuffer(GX2ColorBuffer *colorBuffer,
258  GX2RenderTarget target);
259 
260 void
261 GX2SetDepthBuffer(GX2DepthBuffer *depthBuffer);
262 
263 void
265 
266 void
268 
269 void
271  BOOL enable);
272 
273 uint32_t
275 
276 void
278  uint32_t swizzle);
279 
280 void
282  uint32_t srcLevel,
283  uint32_t srcDepth,
284  GX2Surface *dst,
285  uint32_t dstLevel,
286  uint32_t dstDepth);
287 
288 #ifdef __cplusplus
289 }
290 #endif
291 
uint32_t viewMip
Definition: surface.h:232
GX2SurfaceUse
Definition: surface.h:106
uint32_t pitch
Definition: surface.h:181
GX2TileMode tileMode
Definition: surface.h:178
GX2Surface surface
Definition: surface.h:230
GX2SurfaceDim
Definition: surface.h:14
uint32_t stencilClear
Definition: surface.h:214
void GX2SetDepthBuffer(GX2DepthBuffer *depthBuffer)
GX2Surface surface
Definition: surface.h:206
uint32_t aaSize
Definition: surface.h:236
uint32_t viewFirstSlice
Definition: surface.h:233
void GX2SetColorBuffer(GX2ColorBuffer *colorBuffer, GX2RenderTarget target)
uint32_t viewMip
Definition: surface.h:208
uint32_t viewNumSlices
Definition: surface.h:234
uint32_t alignment
Definition: surface.h:180
GX2SurfaceFormat format
Definition: surface.h:167
void GX2SetSurfaceSwizzle(GX2Surface *surface, uint32_t swizzle)
void * mipmaps
Definition: surface.h:177
GX2TileMode
Definition: surface.h:139
void GX2InitDepthBufferRegs(GX2DepthBuffer *depthBuffer)
void * aaBuffer
Definition: surface.h:235
uint32_t height
Definition: surface.h:164
uint32_t GX2GetSurfaceSwizzle(GX2Surface *surface)
uint32_t hiZSize
Definition: surface.h:212
void GX2InitColorBufferRegs(GX2ColorBuffer *colorBuffer)
void * image
Definition: surface.h:175
GX2AAMode
Definition: surface.h:101
uint32_t viewFirstSlice
Definition: surface.h:209
uint32_t mipmapSize
Definition: surface.h:176
uint32_t regs[5]
Definition: surface.h:238
uint32_t viewNumSlices
Definition: surface.h:210
uint32_t imageSize
Definition: surface.h:174
GX2RResourceFlags resourceFlags
Definition: surface.h:172
float depthClear
Definition: surface.h:213
int BOOL
Definition: wut_types.h:4
uint32_t swizzle
Definition: surface.h:179
void GX2InitDepthBufferHiZEnable(GX2DepthBuffer *depthBuffer, BOOL enable)
void GX2CalcSurfaceSizeAndAlignment(GX2Surface *surface)
void GX2CalcDepthBufferHiZInfo(GX2DepthBuffer *depthBuffer, uint32_t *outSize, uint32_t *outAlignment)
uint32_t mipLevels
Definition: surface.h:166
GX2SurfaceDim dim
Definition: surface.h:162
void GX2CopySurface(GX2Surface *src, uint32_t srcLevel, uint32_t srcDepth, GX2Surface *dst, uint32_t dstLevel, uint32_t dstDepth)
void * hiZPtr
Definition: surface.h:211
GX2AAMode aa
Definition: surface.h:168
uint32_t depth
Definition: surface.h:165
GX2SurfaceUse use
Definition: surface.h:171
GX2RResourceFlags
Definition: surface.h:114
uint32_t width
Definition: surface.h:163
uint32_t mipLevelOffset[13]
Definition: surface.h:182
uint32_t regs[7]
Definition: surface.h:216
GX2SurfaceFormat
Definition: surface.h:26