CPU optimisations
This commit is contained in:
@@ -71,6 +71,9 @@ void OpenGLRenderer::SetDecodeShaderProgram(GLuint program, GLuint vertexShader,
|
||||
mDecodeProgram = program;
|
||||
mDecodeVertexShader = vertexShader;
|
||||
mDecodeFragmentShader = fragmentShader;
|
||||
mDecodePackedResolutionLocation = program != 0 ? glGetUniformLocation(program, "uPackedVideoResolution") : -1;
|
||||
mDecodeDecodedResolutionLocation = program != 0 ? glGetUniformLocation(program, "uDecodedVideoResolution") : -1;
|
||||
mDecodeInputPixelFormatLocation = program != 0 ? glGetUniformLocation(program, "uInputPixelFormat") : -1;
|
||||
}
|
||||
|
||||
void OpenGLRenderer::SetOutputPackShaderProgram(GLuint program, GLuint vertexShader, GLuint fragmentShader)
|
||||
@@ -78,6 +81,9 @@ void OpenGLRenderer::SetOutputPackShaderProgram(GLuint program, GLuint vertexSha
|
||||
mOutputPackProgram = program;
|
||||
mOutputPackVertexShader = vertexShader;
|
||||
mOutputPackFragmentShader = fragmentShader;
|
||||
mOutputPackResolutionLocation = program != 0 ? glGetUniformLocation(program, "uOutputVideoResolution") : -1;
|
||||
mOutputPackActiveWordsLocation = program != 0 ? glGetUniformLocation(program, "uActiveV210Words") : -1;
|
||||
mOutputPackFormatLocation = program != 0 ? glGetUniformLocation(program, "uOutputPackFormat") : -1;
|
||||
}
|
||||
|
||||
bool OpenGLRenderer::ReserveTemporaryRenderTargets(std::size_t count, unsigned width, unsigned height, std::string& error)
|
||||
@@ -217,6 +223,9 @@ void OpenGLRenderer::DestroyDecodeShaderProgram()
|
||||
glDeleteProgram(mDecodeProgram);
|
||||
mDecodeProgram = 0;
|
||||
}
|
||||
mDecodePackedResolutionLocation = -1;
|
||||
mDecodeDecodedResolutionLocation = -1;
|
||||
mDecodeInputPixelFormatLocation = -1;
|
||||
|
||||
if (mDecodeFragmentShader != 0)
|
||||
{
|
||||
@@ -238,6 +247,9 @@ void OpenGLRenderer::DestroyOutputPackShaderProgram()
|
||||
glDeleteProgram(mOutputPackProgram);
|
||||
mOutputPackProgram = 0;
|
||||
}
|
||||
mOutputPackResolutionLocation = -1;
|
||||
mOutputPackActiveWordsLocation = -1;
|
||||
mOutputPackFormatLocation = -1;
|
||||
|
||||
if (mOutputPackFragmentShader != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user