Commit 65a0be92 by Geoff Lang Committed by Commit Bot

Implement program binary in ProgramGL.

BUG=angleproject:882 Change-Id: I8d57c185066e9fc0c1b8def09bc48d80ad97d328 Reviewed-on: https://chromium-review.googlesource.com/303901Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent aab7e868
...@@ -961,6 +961,11 @@ void FunctionsGL::initializeProcsDesktopGL() ...@@ -961,6 +961,11 @@ void FunctionsGL::initializeProcsDesktopGL()
AssignGLExtensionEntryPoint(extensions, "GL_ARB_transform_feedback3", loadProcAddress("glEndQueryIndexed"), &endQueryIndexed); AssignGLExtensionEntryPoint(extensions, "GL_ARB_transform_feedback3", loadProcAddress("glEndQueryIndexed"), &endQueryIndexed);
AssignGLExtensionEntryPoint(extensions, "GL_ARB_transform_feedback3", loadProcAddress("glGetQueryIndexediv"), &getQueryIndexediv); AssignGLExtensionEntryPoint(extensions, "GL_ARB_transform_feedback3", loadProcAddress("glGetQueryIndexediv"), &getQueryIndexediv);
// GL_ARB_get_program_binary
AssignGLExtensionEntryPoint(extensions, "GL_ARB_get_program_binary", loadProcAddress("glGetProgramBinary"), &getProgramBinary);
AssignGLExtensionEntryPoint(extensions, "GL_ARB_get_program_binary", loadProcAddress("glProgramBinary"), &programBinary);
AssignGLExtensionEntryPoint(extensions, "GL_ARB_get_program_binary", loadProcAddress("glProgramParameteri"), &programParameteri);
// 1.0 // 1.0
if (isAtLeastGL(gl::Version(1, 0))) if (isAtLeastGL(gl::Version(1, 0)))
{ {
...@@ -1791,6 +1796,10 @@ void FunctionsGL::initializeProcsGLES() ...@@ -1791,6 +1796,10 @@ void FunctionsGL::initializeProcsGLES()
AssignGLExtensionEntryPoint(extensions, "GL_OES_EGL_image", loadProcAddress("glEGLImageTargetRenderbufferStorageOES"), &eglImageTargetRenderbufferStorageOES); AssignGLExtensionEntryPoint(extensions, "GL_OES_EGL_image", loadProcAddress("glEGLImageTargetRenderbufferStorageOES"), &eglImageTargetRenderbufferStorageOES);
AssignGLExtensionEntryPoint(extensions, "GL_OES_EGL_image", loadProcAddress("glEGLImageTargetTexture2DOES"), &eglImageTargetTexture2DOES); AssignGLExtensionEntryPoint(extensions, "GL_OES_EGL_image", loadProcAddress("glEGLImageTargetTexture2DOES"), &eglImageTargetTexture2DOES);
// GL_OES_get_program_binary
AssignGLExtensionEntryPoint(extensions, "GL_OES_get_program_binary", loadProcAddress("glGetProgramBinaryOES"), &getProgramBinary);
AssignGLExtensionEntryPoint(extensions, "GL_OES_get_program_binary", loadProcAddress("glProgramBinaryOES"), &programBinary);
// 2.0 // 2.0
if (isAtLeastGLES(gl::Version(2, 0))) if (isAtLeastGLES(gl::Version(2, 0)))
{ {
......
...@@ -72,7 +72,9 @@ class ProgramGL : public ProgramImpl ...@@ -72,7 +72,9 @@ class ProgramGL : public ProgramImpl
const std::vector<SamplerBindingGL> &getAppliedSamplerUniforms() const; const std::vector<SamplerBindingGL> &getAppliedSamplerUniforms() const;
private: private:
void reset(); void preLink();
bool checkLinkStatus(gl::InfoLog &infoLog);
void postLink();
// Helper function, makes it simpler to type. // Helper function, makes it simpler to type.
GLint uniLoc(GLint glLocation) const { return mUniformRealLocationMap[glLocation]; } GLint uniLoc(GLint glLocation) const { return mUniformRealLocationMap[glLocation]; }
......
...@@ -289,6 +289,24 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM ...@@ -289,6 +289,24 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM
// Doesn't impact supported version // Doesn't impact supported version
} }
if (functions->isAtLeastGL(gl::Version(4, 1)) ||
functions->hasGLExtension("GL_ARB_get_program_binary") ||
functions->isAtLeastGLES(gl::Version(3, 0)) ||
functions->hasGLExtension("GL_OES_get_program_binary"))
{
// Able to support the GL_PROGRAM_BINARY_ANGLE format as long as another program binary
// format is available.
GLint numBinaryFormats = QuerySingleGLInt(functions, GL_NUM_PROGRAM_BINARY_FORMATS_OES);
if (numBinaryFormats > 0)
{
caps->programBinaryFormats.push_back(GL_PROGRAM_BINARY_ANGLE);
}
}
else
{
// Doesn't impact supported version
}
// glGetShaderPrecisionFormat is not available until desktop GL version 4.1 or GL_ARB_ES2_compatibility exists // glGetShaderPrecisionFormat is not available until desktop GL version 4.1 or GL_ARB_ES2_compatibility exists
if (functions->isAtLeastGL(gl::Version(4, 1)) || functions->hasGLExtension("GL_ARB_ES2_compatibility") || if (functions->isAtLeastGL(gl::Version(4, 1)) || functions->hasGLExtension("GL_ARB_ES2_compatibility") ||
functions->isAtLeastGLES(gl::Version(2, 0))) functions->isAtLeastGLES(gl::Version(2, 0)))
...@@ -581,6 +599,7 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM ...@@ -581,6 +599,7 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM
extensions->setTextureExtensionSupport(*textureCapsMap); extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->elementIndexUint = functions->standard == STANDARD_GL_DESKTOP || extensions->elementIndexUint = functions->standard == STANDARD_GL_DESKTOP ||
functions->isAtLeastGLES(gl::Version(3, 0)) || functions->hasGLESExtension("GL_OES_element_index_uint"); functions->isAtLeastGLES(gl::Version(3, 0)) || functions->hasGLESExtension("GL_OES_element_index_uint");
extensions->getProgramBinary = caps->programBinaryFormats.size() > 0;
extensions->readFormatBGRA = functions->isAtLeastGL(gl::Version(1, 2)) || functions->hasGLExtension("GL_EXT_bgra") || extensions->readFormatBGRA = functions->isAtLeastGL(gl::Version(1, 2)) || functions->hasGLExtension("GL_EXT_bgra") ||
functions->hasGLESExtension("GL_EXT_read_format_bgra"); functions->hasGLESExtension("GL_EXT_read_format_bgra");
extensions->mapBuffer = functions->isAtLeastGL(gl::Version(1, 5)) || extensions->mapBuffer = functions->isAtLeastGL(gl::Version(1, 5)) ||
......
...@@ -405,7 +405,6 @@ ...@@ -405,7 +405,6 @@
1323 LINUX : dEQP-GLES3.functional.fbo.depth.depth_write_clamp.depth32f_stencil8 = FAIL 1323 LINUX : dEQP-GLES3.functional.fbo.depth.depth_write_clamp.depth32f_stencil8 = FAIL
1323 LINUX : dEQP-GLES3.functional.implementation_limits.max_fragment_uniform_components = FAIL 1323 LINUX : dEQP-GLES3.functional.implementation_limits.max_fragment_uniform_components = FAIL
1323 LINUX : dEQP-GLES3.functional.implementation_limits.max_vertex_uniform_components = FAIL 1323 LINUX : dEQP-GLES3.functional.implementation_limits.max_vertex_uniform_components = FAIL
1323 LINUX : dEQP-GLES3.functional.negative_api.shader.program_binary = FAIL
1323 LINUX : dEQP-GLES3.functional.negative_api.state.get_integeri_v = FAIL 1323 LINUX : dEQP-GLES3.functional.negative_api.state.get_integeri_v = FAIL
1323 LINUX : dEQP-GLES3.functional.rasterization.fbo.rbo_multisample_max.primitives.points = FAIL 1323 LINUX : dEQP-GLES3.functional.rasterization.fbo.rbo_multisample_max.primitives.points = FAIL
1323 LINUX : dEQP-GLES3.functional.shaders.builtin_functions.precision.refract.highp_fragment.scalar = FAIL 1323 LINUX : dEQP-GLES3.functional.shaders.builtin_functions.precision.refract.highp_fragment.scalar = FAIL
......
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