summaryrefslogtreecommitdiffstats
path: root/ui/gl
diff options
context:
space:
mode:
authordmurph@chromium.org <dmurph@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-23 20:39:39 +0000
committerdmurph@chromium.org <dmurph@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-23 20:39:39 +0000
commit65dfc60d7035875767bcddf62b9201f16126222a (patch)
tree8de0b9f97b48112b08b544d142ca7a46ca016768 /ui/gl
parent51383d802b69967b462bf2eabd1d7b1ee879d7f7 (diff)
downloadchromium_src-65dfc60d7035875767bcddf62b9201f16126222a.zip
chromium_src-65dfc60d7035875767bcddf62b9201f16126222a.tar.gz
chromium_src-65dfc60d7035875767bcddf62b9201f16126222a.tar.bz2
gpu in-memory program cache implementation with a memory limit + lru eviction.
Wiring: - Added bindings for glProgramBinary, glGetProgramBinary, glProgramParameteri - Plumbed the shader cache from gl_channel_manager to program_manager - Program cache creation after first context is created Refactoring: - moved DoCompile to ProgramManager New: - added functionality to ShaderInfo to store if we have a possible pending cache compile - exposed attrib_map and uniform_map in ShaderInfo for the cache - program_cache base class with in-memory status storage - Simple memory_program_cache implementation, stores programs with lru eviction - Added caching logic to DoCompileShader and Link in ProgramMAnager - MemoryProgramCache, the in-memory cache implementation - ProgramCacheLruHelper, an O(1) lru implementation Misc: - A couple style fixes in modified files Design doc: https://docs.google.com/document/d/1Vceem-nF4TCICoeGSh7OMXxfGuJEJYblGXRgN9V9hcE/edit BUG=88572 Review URL: https://chromiumcodereview.appspot.com/10797055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147932 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl')
-rwxr-xr-xui/gl/generate_bindings.py16
-rw-r--r--ui/gl/gl_interface.h13
2 files changed, 29 insertions, 0 deletions
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py
index 5e7eccd..11ccff2 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -296,6 +296,12 @@ GL_FUNCTIONS = [
'names': ['glGetIntegerv'],
'arguments': 'GLenum pname, GLint* params', },
{ 'return_type': 'void',
+ 'names': ['glGetProgramBinary', 'glGetProgramBinaryOES'],
+ 'arguments': 'GLuint program, GLsizei bufSize, GLsizei* length, '
+ 'GLenum* binaryFormat, GLvoid* binary',
+ 'other_extensions': ['ARB_get_program_binary',
+ 'OES_get_program_binary'] },
+{ 'return_type': 'void',
'names': ['glGetProgramiv'],
'arguments': 'GLuint program, GLenum pname, GLint* params', },
{ 'return_type': 'void',
@@ -424,6 +430,16 @@ GL_FUNCTIONS = [
'names': ['glPolygonOffset'],
'arguments': 'GLfloat factor, GLfloat units', },
{ 'return_type': 'void',
+ 'names': ['glProgramBinary', 'glProgramBinaryOES'],
+ 'arguments': 'GLuint program, GLenum binaryFormat, '
+ 'const GLvoid* binary, GLsizei length',
+ 'other_extensions': ['ARB_get_program_binary',
+ 'OES_get_program_binary'] },
+{ 'return_type': 'void',
+ 'names': ['glProgramParameteri'],
+ 'arguments': 'GLuint program, GLenum pname, GLint value',
+ 'other_extensions': ['ARB_get_program_binary'] },
+{ 'return_type': 'void',
'names': ['glQueryCounter'],
'arguments': 'GLuint id, GLenum target', },
{ 'return_type': 'void',
diff --git a/ui/gl/gl_interface.h b/ui/gl/gl_interface.h
index af150de..6c6df36 100644
--- a/ui/gl/gl_interface.h
+++ b/ui/gl/gl_interface.h
@@ -272,6 +272,12 @@ class GL_EXPORT GLInterface {
virtual void GetIntegerv(GLenum pname, GLint* params) = 0;
+ virtual void GetProgramBinary(GLuint program,
+ GLsizei bufSize,
+ GLsizei* length,
+ GLenum* binaryFormat,
+ GLvoid* binary) = 0;
+
virtual void GetProgramiv(GLuint program, GLenum pname, GLint* params) = 0;
// TODO(gman): Implement this
@@ -398,6 +404,13 @@ class GL_EXPORT GLInterface {
virtual void PolygonOffset(GLfloat factor, GLfloat units) = 0;
+ virtual void ProgramBinary(GLuint program,
+ GLenum binaryFormat,
+ const GLvoid* binary,
+ GLsizei length) = 0;
+
+ virtual void ProgramParameteri(GLuint program, GLenum pname, GLint value) = 0;
+
virtual void QueryCounter(GLuint id, GLenum target) = 0;
virtual void ReadBuffer(GLenum src) = 0;