Skip to content

Commit

Permalink
Fix texture coord upload size
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaivel committed Jul 6, 2024
1 parent 94c6d24 commit f5f1043
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/client/glimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,10 +604,11 @@ static inline void glimpl_push_client_pointers(int mode, int max_index)

for (int t = 0; t < GLIMPL_MAX_TEXTURES; t++) {
if (glimpl_tex_coord_ptr[t].in_use) {
pb_push(SGL_CMD_VP_UPLOAD);
pb_push(max_index * glimpl_tex_coord_ptr[t].size);
switch (glimpl_tex_coord_ptr[t].type) {
case GL_SHORT: {
pb_push(SGL_CMD_VP_UPLOAD);
pb_push(max_index * glimpl_tex_coord_ptr[t].size / 2);

const short *svertices = glimpl_tex_coord_ptr[t].pointer;

// assuming size = 2
Expand All @@ -623,6 +624,9 @@ static inline void glimpl_push_client_pointers(int mode, int max_index)
}
}
default: {
pb_push(SGL_CMD_VP_UPLOAD);
pb_push(max_index * glimpl_tex_coord_ptr[t].size);

const float *fvertices = glimpl_tex_coord_ptr[t].pointer;

for (int i = 0; i < max_index; i++) {
Expand Down

0 comments on commit f5f1043

Please sign in to comment.