Skip to content

Commit

Permalink
Implement glGetInternalformativ
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaivel committed Jul 7, 2024
1 parent f5f1043 commit f6884f4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/client/glimpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -8933,7 +8933,14 @@ void glDrawElementsInstancedBaseVertexBaseInstance(GLenum mode, GLsizei count, G

void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
{
fprintf(stderr, "glGetInternalformativ: stub\n");
pb_push(SGL_CMD_GETINTERNALFORMATIV);
pb_push(target);
pb_push(internalformat);
pb_push(pname);
pb_push(bufSize);

glimpl_submit();
memcpy(params, pb_ptr(SGL_OFFSET_REGISTER_RETVAL_V), bufSize * sizeof(int));
}

void glGetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex, GLenum pname, GLint* params)
Expand Down Expand Up @@ -8994,7 +9001,14 @@ void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params)

void glGetInternalformati64v(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params)
{
fprintf(stderr, "glGetInternalformati64v: stub\n");
pb_push(SGL_CMD_GETINTERNALFORMATI64V);
pb_push(target);
pb_push(internalformat);
pb_push(pname);
pb_push(bufSize);

glimpl_submit();
memcpy(params, pb_ptr(SGL_OFFSET_REGISTER_RETVAL_V), bufSize * sizeof(GLint64));
}

void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
Expand Down
10 changes: 10 additions & 0 deletions src/server/processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -5196,6 +5196,11 @@ void sgl_cmd_processor_start(struct sgl_cmd_processor_args args)
break;
}
case SGL_CMD_GETINTERNALFORMATIV: {
int target = *pb++;
int internalformat = *pb++;
int pname = *pb++;
int bufSize = *pb++;
glGetInternalformativ(target, internalformat, pname, bufSize, p + SGL_OFFSET_REGISTER_RETVAL_V);
break;
}
case SGL_CMD_GETACTIVEATOMICCOUNTERBUFFERIV: {
Expand Down Expand Up @@ -5239,6 +5244,11 @@ void sgl_cmd_processor_start(struct sgl_cmd_processor_args args)
break;
}
case SGL_CMD_GETINTERNALFORMATI64V: {
int target = *pb++;
int internalformat = *pb++;
int pname = *pb++;
int bufSize = *pb++;
glGetInternalformati64v(target, internalformat, pname, bufSize, p + SGL_OFFSET_REGISTER_RETVAL_V);
break;
}
case SGL_CMD_INVALIDATEFRAMEBUFFER: {
Expand Down

0 comments on commit f6884f4

Please sign in to comment.