Skip to content

Commit

Permalink
Xbox: Don't pointlessly create unused index buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed May 12, 2024
1 parent 4a96f65 commit 8a3f02d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/Graphics_D3D11.c
Expand Up @@ -1046,7 +1046,6 @@ static void SetColorWrite(cc_bool r, cc_bool g, cc_bool b, cc_bool a) {
gfx_channels[2] = b;
gfx_channels[3] = a;
OM_UpdateBlendState();
// TODO all channels
}

void Gfx_DepthOnlyRendering(cc_bool depthOnly) {
Expand Down
12 changes: 3 additions & 9 deletions src/Graphics_Xbox.c
Expand Up @@ -396,7 +396,6 @@ void Gfx_EndFrame(void) {
*----------------------------------------------------------Buffers--------------------------------------------------------*
*#########################################################################################################################*/
static cc_uint8* gfx_vertices;
static cc_uint16* gfx_indices;

static void* AllocBuffer(int count, int elemSize) {
return MmAllocateContiguousMemoryEx(count * elemSize, 0, MAX_RAM_ADDR, 16, PAGE_WRITECOMBINE | PAGE_READWRITE);
Expand All @@ -410,16 +409,12 @@ static void FreeBuffer(GfxResourceID* buffer) {


GfxResourceID Gfx_CreateIb2(int count, Gfx_FillIBFunc fillFunc, void* obj) {
void* ib = AllocBuffer(count, sizeof(cc_uint16));
if (!ib) Logger_Abort("Failed to allocate memory for index buffer");

fillFunc(ib, count, obj);
return ib;
return (void*)1;
}

void Gfx_BindIb(GfxResourceID ib) { gfx_indices = ib; }
void Gfx_BindIb(GfxResourceID ib) { }

void Gfx_DeleteIb(GfxResourceID* ib) { FreeBuffer(ib); }
void Gfx_DeleteIb(GfxResourceID* ib) { }


static GfxResourceID Gfx_AllocStaticVb(VertexFormat fmt, int count) {
Expand Down Expand Up @@ -689,7 +684,6 @@ void Gfx_DrawVb_Lines(int verticesCount) {
}

static void DrawIndexedVertices(int verticesCount, int startVertex) {
// TODO switch to indexed rendering
DrawArrays(NV097_SET_BEGIN_END_OP_QUADS, startVertex, verticesCount);
}

Expand Down

0 comments on commit 8a3f02d

Please sign in to comment.