Skip to content

Commit 7243fdc

Browse files
wiiu/render: Discard empty draw calls for points and lines
This is for the same reason as 2a6c2ca, but the last commit didn't add the check for points and lines
1 parent 9e38012 commit 7243fdc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/render/wiiu/SDL_rqueue_wiiu.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ int WIIU_SDL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand * cmd, c
6060
SDL_VertexSolid *vertices;
6161
GX2RBuffer *vertexBuffer;
6262
SDL_Color color;
63+
64+
// discard empty draws or GX2 will crash
65+
if (count < 1) {
66+
return -1;
67+
}
68+
6369
color.r = cmd->data.draw.r;
6470
color.g = cmd->data.draw.g;
6571
color.b = cmd->data.draw.b;
@@ -99,6 +105,12 @@ int WIIU_SDL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand * cmd, co
99105
SDL_VertexSolid *vertices;
100106
GX2RBuffer *vertexBuffer;
101107
SDL_Color color;
108+
109+
// discard empty draws or GX2 will crash
110+
if (count < 2) {
111+
return -1;
112+
}
113+
102114
color.r = cmd->data.draw.r;
103115
color.g = cmd->data.draw.g;
104116
color.b = cmd->data.draw.b;

0 commit comments

Comments
 (0)