16#define WRITEBACK_ZONE_SIZE 0x20000
18#define RPTR_WRITEBACK 0x10000
19#define SCRATCH_WRITEBACK 0x10100
21#define RINGBUFFER_PRIMARY_SIZE (0x8000/4)
22#define RINGBUFFER_SECONDARY_SIZE (0x400000/4)
23#define RINGBUFFER_SECONDARY_GUARD (0x200000/4)
25#define RADEON_CP_PACKET0 0x00000000
26#define RADEON_ONE_REG_WR (1 << 15)
28#define CP_PACKET0( reg, n ) \
29 (RADEON_CP_PACKET0 | ((n) << 16) | ((reg) >> 2))
30#define CP_PACKET0_TABLE( reg, n ) \
31 (RADEON_CP_PACKET0 | RADEON_ONE_REG_WR | ((n) << 16) | ((reg) >> 2))
33#define VBPOOL_NUM_TRIANGLES 2000
41static inline u32 SurfaceInfo(
int surface_pitch,
int msaa_samples,
int hi_zpitch)
43 return surface_pitch | (msaa_samples << 16) | (hi_zpitch << 18);
46static inline u32 xy32(
int x,
int y)
68 r=memalign(align,
size);
73 *phys = (
u32) r &~ 0x80000000;
100 for (i=0; i<0x20; ++i)
136#define SEGMENT_SIZE 1024
154 return rb_primary_phys;
160 rput32(xy32(offset_x, offset_y));
161 rput32(xy32(sc_left, sc_top));
162 rput32(xy32(sc_right, sc_bottom));
187 rput32(0x00000080 | (num_points << 16) | primtype);
197 rput32(0x00000000 | (
type << 6) | primtype | (num_points << 16) | (indextype << 11));
199 rput32((indexbuffer_size | 0x40000000) << indextype);
210 w32(0x0704,
r32(0x0704) | 0x80000000);
213 w32(0x0704,
r32(0x0704) &~0x80000000);
219 w32(0x0704, size_in_l2qw | 0x8020000);
220 w32(0x0700, buffer_base);
231 for (i = 0; i < 0x120; ++i)
232 w32(0x1180, ucode0[i]);
236 for (i = 0; i < 0x120; ++i)
240 for (i = 0; i < 0x900; ++i)
241 w32(0x07e8, ucode1[i]);
244 for (i = 0; i < 0x900; ++i)
245 if (
r32(0x07e8) != ucode1[i])
247 printf(
"%04x: %08x %08x\n", i,
r32(0x07e8), ucode1[i]);
252 Xe_Fatal(xe,
"ucode1 microcode verify error\n");
258 while (
r32(0x1740) & 0x80000000)
261 Xe_Fatal(xe,
"timeout in init, likely the GPU was already hung before we started\n");
267 while (!(
r32(0x1740) & 0x00040000));
273 w32(0x0e6c, 0xC0F0000);
274 w32(0x3400, 0x40401);
276 w32(0x3400, 0x40400);
278 w32(0x340c, 0x1003F1F);
287 printf(
"waiting for reset.\n");
289 w32(0x00f0, 0x8064);
r32(0x00f0);
291 w32(0x00f0, 0x11800);
r32(0x00f0);
294 }
while (
r32(0x1740) & 0x80000000);
297 if (
r32(0x00e0) != 0x10)
298 Xe_Fatal(xe,
"value after reset not ok (%08x)\n",
r32(0xe0));
305 w32(0x07d8, 0x1000FFFF);
315 if (!(
r32(0x07d8) & 0x10000000))
316 Xe_Fatal(xe,
"something wrong (1)\n");
328 Xe_Fatal(xe,
"[WARN] something wrong (2)\n");
331 Xe_Fatal(xe,
"[WARN] something wrong (3)\n");
340 w32(0x07d8, 0x1000FFFF);
363 if ((
r32(0x0e6c) & 0xF00) != 0xF00)
364 printf(
"something wrong (3)\n");
378 while (
r32(0x3c4c) & 0x80000000);
382 while (
r32(0x3c4c) & 0x80000000);
394 w32(0x070c, addr | 2);
395 w32(0x0704, v | (blocksize << 8));
530 for (i = 0x10; i <= 0x70; ++i)
531 Xe_pGInit1(xe, 0x00000000 | (i << 12) | ((0x80 - i) << 4));
598 FILE *f = fopen(filename,
"rb");
600 Xe_Fatal(xe,
"FATAL: shader %s not found!\n", filename);
602 fseek(f, 0, SEEK_END);
604 fseek(f, 0, SEEK_SET);
606 void *
m = malloc(
size);
607 fread(
m,
size, 1, f);
617 if ((hdr->
magic >> 16) != 0x102a)
618 Xe_Fatal(xe,
"shader version: %08x, expected: something with 102a.\n", hdr->
magic);
621 memset(s, 0,
sizeof(*s));
651 u16 start = *(
u16*)constants; constants += 2;
652 u16 count = *(
u16*)constants; constants += 2;
671 u16 start = *(
u16*)constants; constants += 2;
672 u16 count = *(
u16*)constants; constants += 2;
684 constants += count * 4 + 4;
727 for (i=0; i<
fmt->num; ++i)
755 Xe_Fatal(xe,
"unlock without lock");
800 Xe_Fatal(xe,
"your vertex buffer format is not DWORD aligned.\n");
818 for (i=0; i<num_vfetch; ++i)
820 u32 vfetch_patch = *
c++;
821 int type = (vfetch_patch >> 12) & 0xF;
822 int stream = (vfetch_patch >> 16) & 0xF;
823 int insn = vfetch_patch & 0xFFF;
827 u32 *vfetch = shader_code + insn * 12;
831 int Offset = (vfetch[2] & 0x7fffff00) >> 8;
832 int DataFormat = (vfetch[1] & 0x003f0000) >> 16;
833 int Stride= (vfetch[2] & 0x000000ff);
834 int Signed= (vfetch[1] & 0x00001000) >> 12;
835 int NumFormat = (vfetch[1] & 0x00002000) >> 13;
836 int PrefetchCount= (vfetch[0] & 0x38000000) >> 27;
843 for (
j=0;
j <
fmt->num; ++
j)
845 if ((
fmt->e[
j].usage ==
type) && (
fmt->e[
j].index == stream))
853 Xe_Fatal(xe,
"shader requires input type %d_%d, which wasn't found in vertex format.\n",
type, stream);
856 DataFormat =
fmt->e[
j].fmt;
869 to_fetch = stride - fetched_to;
882 PrefetchCount = to_fetch - 1;
884 fetched_to += to_fetch;
887 vfetch[0] &= ~(0x00000000|0x00000000|0x00000000|0x00000000|0x00000000|0x38000000|0x00000000);
888 vfetch[1] &= ~(0x00000000|0x003f0000|0x00000000|0x00001000|0x00002000|0x00000000|0x40000000);
889 vfetch[2] &= ~(0x7fffff00|0x00000000|0x000000ff|0x00000000|0x00000000|0x00000000|0x00000000);
891 vfetch[2] |= Offset << 8;
892 vfetch[1] |= DataFormat << 16;
894 vfetch[1] |= Signed << 12;
895 vfetch[1] |= NumFormat << 13;
896 vfetch[0] |= PrefetchCount << 27;
897 vfetch[1] |= is_mini << 30;
903 for (comp = 0; comp < 4; comp++)
905 int shift = comp * 3;
906 int sw = (vfetch[1] >> shift) & 7;
908 if ((sw < 4) && (sw >= nrcomp))
916 vfetch[1] &= ~(7<<shift);
917 vfetch[1] |= sw << shift;
921 Offset = (vfetch[2] & 0x7fffff00) >> 8;
922 DataFormat = (vfetch[1] & 0x003f0000) >> 16;
923 Stride= (vfetch[2] & 0x000000ff);
924 Signed= (vfetch[1] & 0x00001000) >> 12;
925 NumFormat = (vfetch[1] & 0x00002000) >> 13;
926 PrefetchCount= (vfetch[0] & 0x38000000) >> 27;
944 memcpy(p, shader_code,
data->sh_size);
958 memset(xe, 0,
sizeof(*xe));
960 xe->
regs = (
void*)0xec800000;
986 Xe_pWriteReg(xe, 0x0770, 0x20033);
988 Xe_pWriteReg(xe, 0x15e0, 0x1234567);
1010 int tiles_per_line = (xe->
vp_xres + tile_size_x - 1) / tile_size_x;
1011 tiles_per_line += 1;
1012 tiles_per_line &= ~1;
1014 int tiles_height = (xe->
vp_yres + tile_size_y - 1) / tile_size_y;
1042 unsigned int clearv[2];
1055 clearv[0] |= (clearv[0] >> 8) & 0x00FF00FF;
1059 clearv[1] |= (clearv[1] >> 8) & 0x00FF00FF;
1062 clearv[0] = clearv[1] = 0;
1065 Xe_pWriteReg(xe, 0x8c78, clearv[0]);
1066 Xe_pWriteReg(xe, 0x8c7c, clearv[1]);
1077 surface->
width - .5,
1079 surface->
width - .5,
1083 Xe_VBPut(xe, vbdata,
sizeof(vbdata) / 4);
1096 int msaavals[] = {0,4,6};
1102 default:
Xe_Fatal(xe,
"unsupported resolve target format");
1184 dst[1] = 0x10000002 | (len << 2);
1187void TEXTURE_FETCH(
u32 *dst,
u32 base,
int width,
int height,
int pitch,
int tiled,
int format,
u32 base_mip,
int anisop,
int filter,
int uaddr,
int vaddr)
1199 dst[0] = 0x00000002 | (pitch << 22) | (
tiled << 31) | (uaddr << 10) | (vaddr << 13);
1202 dst[3] = 0x00a00c14 | (anisop << 25) | (filter <<19);
1204 dst[4] = 0x00000e03;
1207 dst[5] = 0x00000a00 | base_mip;
1225 Xe_pWriteReg(xe, 0x1720, 0x20000);
1230 Xe_pWriteReg(xe, 0x15e0, x);
1244 printf(
"[xe] Fatal error: ");
1260 Xe_Fatal(xe,
"new framebuffer surface should be tiled.\n");
1263 Xe_Fatal(xe,
"new framebuffer surface format should be 32bit (BGRA8888).\n");
1286 Xe_pWriteReg(xe, 0x15e0, xe->
frameidx);
1291 int timeout = 1<<24;
1295 Xe_Fatal(xe,
"damn, the GPU seems to hang. There is no (known) way to recover, you have to reboot.\n");
1315 for (start = 0; start < 32; ++start)
1318 for (end = start; end < 32; ++end)
1324 int base = start * 16;
1325 int num = (end - start) * 16 * 4;
1329 rput32(0x00004000 | (
base * 4) | ((num-1) << 16));
1339 for (start = 0; start < 32; ++start)
1342 for (end = start; end < 32; ++end)
1348 int base = start * 3;
1349 int num = (end - start) * 3 * 2;
1353 rput32(0x00004800 | (
base * 2) | ((num-1) << 16));
1380 u32 program_control = 0, context_misc = 0;
1453 xe->
controlpacket[1] = col_src | (col_op << 5) | (col_dst << 8) | (alpha_src << 16) | (alpha_op << 21) | (alpha_dst << 24);
1475 assert(blendop < 8);
1499 assert(blendop < 8);
1507 assert(cullmode < 8);
1552 assert(enable <= 1);
1652 assert(idx>=0 && idx<6);
1653 memcpy(&xe->
clipplane[idx*4],plane,4*4);
1679 if ((*s != sh) || (i && *i != index))
1738 int vals[] = {0, 2 | (4 << 13), 4 | (6 << 13)};
1751 TEXTURE_FETCH(xe->
fetch_constants + index * 6, tex->
ptr, tex->
width - 1, tex->
height - 1, tex->
wpitch, tex->
tiled, tex->
format, tex->
ptr_mip, 2, tex->
use_filtering, tex->
u_addressing, tex->
v_addressing);
1767 printf(
"--- alloc new vb, at %p, size %d\n", vb,
size);
1809 vbp = &(*vbp)->
next;
1818 vbp = &(*vbp)->
next;
1834 Xe_Fatal(xe,
"FATAL: VertexPut with non-even len\n");
1844 if (remaining > len)
1858 data += remaining * 4;
1885 Xe_Fatal(xe,
"cannot draw locked VB");
1887 Xe_Fatal(xe,
"cannot draw locked IB");
1922 Xe_Fatal(xe,
"unknown primitive type");
1930 assert(xe->
ps); assert(xe->
vs);
1947 assert(xe->
ps); assert(xe->
vs);
1962 Xe_Fatal(xe,
"cannot use locked VB");
1994 return vb->
base + offset;
2005 return ib->
base + offset;
2040 int bit=1<<(index&0x1f);
2055 u32 bit=1<<(index&0x1f);
2111 if (surface == xe->
rt)
2122 int offset = y * surface->
wpitch + x * surface->
bypp;
2132 return surface->
base + offset;
2144 return r32(0x6534) & 0x1000;
void lock(unsigned int *lock)
void memdcbf(void *addr, int len)
void memdcbst(void *addr, int len)
__asm__(".global _mcount \n" "_mcount: \n" "stwu %sp, -0x70(%sp) \n" "mflr %r0 \n" "stw %r0, 0x60(%sp) \n" "std %r3, 0x10(%sp) \n" "std %r4, 0x18(%sp) \n" "std %r5, 0x20(%sp) \n" "std %r6, 0x28(%sp) \n" "std %r7, 0x30(%sp) \n" "std %r8, 0x38(%sp) \n" "std %r9, 0x40(%sp) \n" "std %r10, 0x48(%sp) \n" "mflr %r3 \n" "lwz %r4,0x74(%sp) \n" "bl internal_mcount \n" "ld %r3, 0x10(%sp) \n" "ld %r4, 0x18(%sp) \n" "ld %r5, 0x20(%sp) \n" "ld %r6, 0x28(%sp) \n" "ld %r7, 0x30(%sp) \n" "ld %r8, 0x38(%sp) \n" "ld %r9, 0x40(%sp) \n" "ld %r10, 0x48(%sp) \n" "lwz %r11, 0x60(%sp) \n" "addi %sp, %sp, 0x70 \n" "mtlr %r0 \n" "lwz %r0,4(%sp) \n" "mtctr %r11 \n" "mtlr %r0 \n" "bctr \n")
struct XenosSurface default_fb
struct XenosSurface tex_fb
struct XenosVertexBuffer * current_vb
struct XenosVertexBuffer * vb_pool_after_frame
volatile void * rb_secondary
struct XenosVertexBuffer * vb_current
u32 fetch_constants[96 *2]
struct XenosIndexBuffer * current_ib
float alu_constants[256 *4 *2]
struct XenosVertexBuffer * vb_head
volatile unsigned int * regs
volatile void * rb_primary
struct XenosVertexBuffer * vb_pool
u32 integer_constants[10 *4]
u32 shader_phys[XE_SHADER_MAX_INSTANCES]
void * shader_instance[XE_SHADER_MAX_INSTANCES]
struct XenosVertexBuffer * next
void Xe_pSetBin(struct XenosDevice *xe, u32 mask_low, u32 select_low, u32 mask_hi, u32 select_hi)
void Xe_pResetRingbuffer(struct XenosDevice *xe)
void Xe_SetRenderTarget(struct XenosDevice *xe, struct XenosSurface *rt)
void Xe_pDebugSync(struct XenosDevice *xe)
void Xe_SetStencilFunc(struct XenosDevice *xe, int bfff, unsigned int func)
void * Xe_IB_Lock(struct XenosDevice *xe, struct XenosIndexBuffer *ib, int offset, int size, int flags)
void Xe_pUploadShader(struct XenosDevice *xe)
void Xe_pInit1(struct XenosDevice *xe)
void * Xe_pAlloc(struct XenosDevice *xe, u32 *phys, int size, int align)
void Xe_pSetState(struct XenosDevice *xe)
void Xe_InstantiateShader(struct XenosDevice *xe, struct XenosShader *sh, unsigned int index)
void Xe_Draw(struct XenosDevice *xe, struct XenosVertexBuffer *vb, struct XenosIndexBuffer *ib)
void Xe_pUploadClipPlane(struct XenosDevice *xe)
#define RINGBUFFER_SECONDARY_SIZE
void Xe_VBPut(struct XenosDevice *xe, void *data, int len)
void VERTEX_FETCH(u32 *dst, u32 base, int len)
void Xe_pGInit7(struct XenosDevice *xe)
void Xe_SetZWrite(struct XenosDevice *xe, int zw)
void Xe_SetZEnable(struct XenosDevice *xe, int ze)
#define RINGBUFFER_PRIMARY_SIZE
#define CP_PACKET0(reg, n)
void Xe_pSetupRingbuffer(struct XenosDevice *xe, u32 buffer_base, u32 size_in_l2qw)
void Xe_Surface_Unlock(struct XenosDevice *xe, struct XenosSurface *surface)
void Xe_DirtyAluConstant(struct XenosDevice *xe, int base, int len)
int Xe_GetShaderLength(struct XenosDevice *xe, void *sh)
int Xe_VBFCalcStride(struct XenosDevice *xe, const struct XenosVBFFormat *fmt)
void Xe_InvalidateState(struct XenosDevice *xe)
void Xe_DirtyFetch(struct XenosDevice *xe, int base, int len)
void Xe_DrawIndexedPrimitive(struct XenosDevice *xe, int type, int base_index, int min_index, int num_vertices, int start_index, int primitive_count)
void Xe_pUploadShaderConstants(struct XenosDevice *xe, struct XenosShader *s)
void Xe_SetStencilEnable(struct XenosDevice *xe, unsigned int enable)
#define SCRATCH_WRITEBACK
void Xe_SetVertexShaderConstantB(struct XenosDevice *xe, int index, int value)
struct XenosIndexBuffer * Xe_CreateIndexBuffer(struct XenosDevice *xe, int length, int format)
void * Xe_VB_Lock(struct XenosDevice *xe, struct XenosVertexBuffer *vb, int offset, int size, int flags)
void Xe_pInvalidateGpuCache_Primary(struct XenosDevice *xe, int base, int size)
void Xe_pLoadShader(struct XenosDevice *xe, int base, int type, int size)
void Xe_pGInit9(struct XenosDevice *xe)
void Xe_SetCullMode(struct XenosDevice *xe, unsigned int cullmode)
void Xe_pGInit4(struct XenosDevice *xe)
void Xe_ResolveInto(struct XenosDevice *xe, struct XenosSurface *surface, int source, int clear)
void Xe_SetSrcBlend(struct XenosDevice *xe, unsigned int blend)
void Xe_pUnlock(struct XenosDevice *xe, struct XenosLock *lock)
#define WRITEBACK_ZONE_SIZE
void Xe_DestroyTexture(struct XenosDevice *xe, struct XenosSurface *surface)
void Xe_pRBKick(struct XenosDevice *xe)
void Xe_pGInit10(struct XenosDevice *xe)
void Xe_SetStencilOp(struct XenosDevice *xe, int bfff, int fail, int zfail, int pass)
void Xe_SetPixelShaderConstantB(struct XenosDevice *xe, int index, int value)
void Xe_pUploadIntegerConstants(struct XenosDevice *xe)
void Xe_Sync(struct XenosDevice *xe)
void Xe_SetBlendControl(struct XenosDevice *xe, int col_src, int col_op, int col_dst, int alpha_src, int alpha_op, int alpha_dst)
struct XenosShader * Xe_LoadShader(struct XenosDevice *xe, const char *filename)
void Xe_pGInit5(struct XenosDevice *xe)
struct XenosSurface * Xe_GetFramebufferSurface(struct XenosDevice *xe)
void Xe_DestroyVertexBuffer(struct XenosDevice *xe, struct XenosVertexBuffer *vb)
void Xe_DrawPrimitive(struct XenosDevice *xe, int type, int start, int primitive_count)
void Xe_VBReclaim(struct XenosDevice *xe)
void Xe_SetDestBlend(struct XenosDevice *xe, unsigned int blend)
#define VBPOOL_NUM_TRIANGLES
void Xe_SetSrcBlendAlpha(struct XenosDevice *xe, unsigned int blend)
struct XenosVertexBuffer * Xe_VBPoolAlloc(struct XenosDevice *xe, int size)
void Xe_SetClearColor(struct XenosDevice *xe, u32 clearcolor)
void Xe_pGInit0(struct XenosDevice *xe)
void Xe_pStep(struct XenosDevice *xe, int x)
void Xe_SetAlphaTestEnable(struct XenosDevice *xe, int enable)
void Xe_pUploadFetchConstants(struct XenosDevice *xe)
void Xe_pWaitUntilIdle(struct XenosDevice *xe, u32 what)
void Xe_Init(struct XenosDevice *xe)
void Xe_pLock(struct XenosDevice *xe, struct XenosLock *lock, void *addr, u32 phys, int size, int flags)
void Xe_SetScissor(struct XenosDevice *xe, int enable, int left, int top, int right, int bottom)
void Xe_Execute(struct XenosDevice *xe)
void Xe_pSyncToDevice(struct XenosDevice *xe, volatile void *data, int len)
void Xe_pUploadControl(struct XenosDevice *xe)
void Xe_pSyncFromDevice(struct XenosDevice *xe, volatile void *data, int len)
int Xe_pVBFNrComponents(struct XenosDevice *xe, const struct XenosVBFElement *fmt)
void Xe_SetClipPlane(struct XenosDevice *xe, int idx, float *plane)
void Xe_SetBlendOp(struct XenosDevice *xe, unsigned int blendop)
void Xe_SetStreamSource(struct XenosDevice *xe, int index, struct XenosVertexBuffer *vb, int offset, int stride)
void Xe_DestroyIndexBuffer(struct XenosDevice *xe, struct XenosIndexBuffer *ib)
struct XenosVertexBuffer * Xe_VBEnd(struct XenosDevice *xe)
void Xe_SetStencilMask(struct XenosDevice *xe, int bfff, int mask)
void Xe_IB_Unlock(struct XenosDevice *xe, struct XenosIndexBuffer *ib)
void Xe_ShaderApplyVFetchPatches(struct XenosDevice *xe, struct XenosShader *sh, unsigned int index, const struct XenosVBFFormat *fmt)
void Xe_pGInit8(struct XenosDevice *xe)
void Xe_pSetClearValues(struct XenosDevice *xe)
void Xe_pRBKickSegment(struct XenosDevice *xe, int base, int len)
void Xe_pGInit2(struct XenosDevice *xe)
void Xe_SetFrameBufferSurface(struct XenosDevice *xe, struct XenosSurface *fb)
void Xe_pAlign(struct XenosDevice *xe)
void * Xe_Surface_LockRect(struct XenosDevice *xe, struct XenosSurface *surface, int x, int y, int w, int h, int flags)
void Xe_SetFillMode(struct XenosDevice *xe, int front, int back)
void Xe_SetDestBlendAlpha(struct XenosDevice *xe, unsigned int blend)
void Xe_pSetup(struct XenosDevice *xe, u32 buffer_base, u32 buffer_size, const u32 *ucode0, const u32 *ucode1)
void Xe_Resolve(struct XenosDevice *xe)
void Xe_SetVertexShaderConstantF(struct XenosDevice *xe, int start, const float *data, int count)
void Xe_pRBMayKick(struct XenosDevice *xe)
void Xe_SetClipPlaneEnables(struct XenosDevice *xe, int enables)
void Xe_pEnableWriteback(struct XenosDevice *xe, u32 addr, int blocksize)
void Xe_SetIndices(struct XenosDevice *xe, struct XenosIndexBuffer *ib)
void Xe_pUploadALUConstants(struct XenosDevice *xe)
int Xe_VBFCalcSize(struct XenosDevice *xe, const struct XenosVBFElement *fmt)
void Xe_pReset(struct XenosDevice *xe)
void TEXTURE_FETCH(u32 *dst, u32 base, int width, int height, int pitch, int tiled, int format, u32 base_mip, int anisop, int filter, int uaddr, int vaddr)
int Xe_IsVBlank(struct XenosDevice *xe)
void Xe_pBlockUntilIdle(struct XenosDevice *xe)
void Xe_VBBegin(struct XenosDevice *xe, int pitch)
void Xe_pGInit6(struct XenosDevice *xe)
void Xe_pResetCP(struct XenosDevice *xe, u32 buffer_base, u32 size_in_l2qw)
void Xe_SetStencilRef(struct XenosDevice *xe, int bfff, int ref)
void Xe_pDrawIndexedPrimitive(struct XenosDevice *xe, int primtype, int num_points, u32 indexbuffer, u32 indexbuffer_size, int indextype)
void Xe_SetBlendOpAlpha(struct XenosDevice *xe, unsigned int blendop)
void Xe_Fatal(struct XenosDevice *xe, const char *fmt,...)
int Xe_pCalcVtxCount(struct XenosDevice *xe, int primtype, int primcnt)
void Xe_pGInit3(struct XenosDevice *xe)
void Xe_SetPixelShaderConstantF(struct XenosDevice *xe, int start, const float *data, int count)
struct XenosShader * Xe_LoadShaderFromMemory(struct XenosDevice *xe, void *m)
void Xe_pFree(struct XenosDevice *xe, void *ptr)
void Xe_pSetEDRAMLayout(struct XenosDevice *xe)
struct XenosVertexBuffer * Xe_CreateVertexBuffer(struct XenosDevice *xe, int size)
void Xe_pMasterInit(struct XenosDevice *xe, u32 buffer_base)
void Xe_SetAlphaFunc(struct XenosDevice *xe, unsigned int func)
void Xe_VBPoolAdd(struct XenosDevice *xe, struct XenosVertexBuffer *vb)
void Xe_pSetSurfaceClip(struct XenosDevice *xe, int offset_x, int offset_y, int sc_left, int sc_top, int sc_right, int sc_bottom)
void Xe_VB_Unlock(struct XenosDevice *xe, struct XenosVertexBuffer *vb)
void Xe_pStuff(struct XenosDevice *xe)
void Xe_SetZFunc(struct XenosDevice *xe, int z_func)
void Xe_pSetIndexOffset(struct XenosDevice *xe, int offset)
void Xe_pInvalidateGpuCache(struct XenosDevice *xe, int base, int size)
void Xe_pWaitReady2(struct XenosDevice *xe)
void Xe_SetAlphaRef(struct XenosDevice *xe, float alpharef)
void Xe_SetStencilWriteMask(struct XenosDevice *xe, int bfff, int writemask)
void Xe_pRBCommitPrimary(struct XenosDevice *xe)
void Xe_Clear(struct XenosDevice *xe, int flags)
void Xe_pWaitReady(struct XenosDevice *xe)
void Xe_SetTexture(struct XenosDevice *xe, int index, struct XenosSurface *tex)
u32 Xe_pRBAlloc(struct XenosDevice *xe)
#define RINGBUFFER_SECONDARY_GUARD
void Xe_SetShader(struct XenosDevice *xe, int type, struct XenosShader *sh, int index)
void Xe_pGInit1(struct XenosDevice *xe, int arg)
void Xe_pInitControl(struct XenosDevice *xe)
void Xe_pLoadUcodes(struct XenosDevice *xe, const u32 *ucode0, const u32 *ucode1)
void Xe_pGInit(struct XenosDevice *xe)
struct XenosSurface * Xe_CreateTexture(struct XenosDevice *xe, unsigned int width, unsigned int height, unsigned int levels, int format, int tiled)
void Xe_pInvalidateGpuCacheAll(struct XenosDevice *xe, int base, int size)
void Xe_pDrawNonIndexed(struct XenosDevice *xe, int num_points, int primtype)
#define XE_PRIMTYPE_LINELIST
#define SHADER_TYPE_PIXEL
#define XE_PRIMTYPE_TRIANGLESTRIP
#define XE_PRIMTYPE_TRIANGLEFAN
#define XE_PRIMTYPE_POINTLIST
#define XE_PRIMTYPE_TRIANGLELIST
#define XE_PRIMTYPE_LINESTRIP
#define XE_PRIMTYPE_QUADLIST
#define XE_PRIMTYPE_RECTLIST
#define XE_MAX_INDICES_PER_DRAW
#define SHADER_TYPE_VERTEX
#define XE_SHADER_MAX_INSTANCES
uint16_t u16
16bit unsigned integer
uint32_t u32
32bit unsigned integer