Commit 895a1e72 by Alexis Hetu Committed by Alexis Hétu

glProgramParameteri API implementation

This function is simply used to notify the program that the binary may be queried later on by the application. For now, this hint is stored in the program, but otherwise ignored, as querying the binary is still unimplemented. Change-Id: Ie59f21d7b803111ce6091718b84ecfbe78c03bdd Reviewed-on: https://swiftshader-review.googlesource.com/3545Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 5bf8c17f
...@@ -118,6 +118,7 @@ namespace es2 ...@@ -118,6 +118,7 @@ namespace es2
unlink(); unlink();
orphaned = false; orphaned = false;
retrievableBinary = false;
referenceCount = 0; referenceCount = 0;
} }
......
...@@ -216,6 +216,8 @@ namespace es2 ...@@ -216,6 +216,8 @@ namespace es2
unsigned int getSerial() const; unsigned int getSerial() const;
void setBinaryRetrievable(bool retrievable) { retrievableBinary = retrievable; }
private: private:
void unlink(); void unlink();
void resetUniformBlockBindings(); void resetUniformBlockBindings();
...@@ -303,6 +305,7 @@ namespace es2 ...@@ -303,6 +305,7 @@ namespace es2
bool orphaned; // Flag to indicate that the program can be deleted when no longer in use bool orphaned; // Flag to indicate that the program can be deleted when no longer in use
char *infoLog; char *infoLog;
bool validated; bool validated;
bool retrievableBinary;
unsigned int referenceCount; unsigned int referenceCount;
const unsigned int serial; const unsigned int serial;
......
...@@ -3865,7 +3865,26 @@ GL_APICALL void GL_APIENTRY glProgramParameteri(GLuint program, GLenum pname, GL ...@@ -3865,7 +3865,26 @@ GL_APICALL void GL_APIENTRY glProgramParameteri(GLuint program, GLenum pname, GL
TRACE("(GLuint program = %d, GLenum pname = 0x%X, GLint value = %d)", TRACE("(GLuint program = %d, GLenum pname = 0x%X, GLint value = %d)",
program, pname, value); program, pname, value);
UNIMPLEMENTED(); es2::Context *context = es2::getContext();
if(context)
{
es2::Program *programObject = context->getProgram(program);
if(!programObject)
{
return error(GL_INVALID_OPERATION);
}
switch(pname)
{
case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
programObject->setBinaryRetrievable(value != GL_FALSE);
break;
default:
return error(GL_INVALID_ENUM);
}
}
} }
GL_APICALL void GL_APIENTRY glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments) GL_APICALL void GL_APIENTRY glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment