---
src/compiler/glsl/shader_cache.cpp | 4
1 file changed, 4 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index c26974c..002b8c3 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -1016,6
Remove incompatiable binaries of a program before attempting
to store a new one.
A previous commit already handles deleting an incompatiable
binary for shader variants this handles the case for an initial
shader compile. Without this a variant would delete the binary
then fallback to a full
---
src/mesa/drivers/dri/i965/brw_shader_cache.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c
b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index 3d06c2b..6b75303 100644
--- a/src/mesa/drivers/dri/i965/brw_shader_cache.c
+++
---
src/mesa/drivers/dri/i965/brw_link.cpp | 22 --
src/mesa/main/shaderobj.c | 2 +-
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
b/src/mesa/drivers/dri/i965/brw_link.cpp
index aa92321..9acbaa3 100644
Also remove cache item and fallback to full recompile if current Mesa
version differs.
---
src/mesa/drivers/dri/i965/brw_shader_cache.c | 16
1 file changed, 16 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c
---
src/mesa/drivers/dri/i965/brw_shader_cache.c | 43 ++--
1 file changed, 40 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c
b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index d003c71..12b3db2 100644
---
---
src/compiler/glsl/link_uniforms.cpp | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/compiler/glsl/link_uniforms.cpp
b/src/compiler/glsl/link_uniforms.cpp
index ad7e8b7..37cc8d4 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++
---
src/compiler/glsl/cache.c | 4
1 file changed, 4 insertions(+)
diff --git a/src/compiler/glsl/cache.c b/src/compiler/glsl/cache.c
index 88c1dbb..d4945b4 100644
--- a/src/compiler/glsl/cache.c
+++ b/src/compiler/glsl/cache.c
@@ -142,6 +142,10 @@ cache_create(void)
struct stat sb;
This will be used to remove cache items created with an old version
of Mesa from the cache.
---
src/compiler/glsl/cache.c | 22 ++
src/compiler/glsl/cache.h | 12
2 files changed, 34 insertions(+)
diff --git a/src/compiler/glsl/cache.c b/src/compiler/glsl/cache.c
Caching SSO requires us to be a little more careful so disable
it for now.
---
src/compiler/glsl/linker.cpp | 7 ++-
src/mesa/drivers/dri/i965/brw_shader_cache.c | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/compiler/glsl/linker.cpp
---
src/mesa/drivers/dri/i965/brw_shader_cache.c | 53 ++--
1 file changed, 51 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c
b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index 0452641..bd9306b 100644
---
---
src/compiler/glsl/shader_cache.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 1e49fbc..a8ca719 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -69,6 +69,7 @@
Here we skip the recreation of uniform storage if we are relinking
after a cache miss.
---
src/compiler/glsl/link_uniforms.cpp | 38
src/compiler/glsl/linker.cpp | 9 ---
src/compiler/glsl/linker.h | 3 ++-
Since we know how big the list will be we can allocate the storage
upfront.
---
src/compiler/glsl/shader_cache.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index fe553df..9b37155 100644
---
This allows up to skip certain linking tasks such as building the
resource list when we are falling back to a full compile after a
cache miss.
---
src/mesa/drivers/dri/i965/brw_link.cpp | 3 ++-
src/mesa/drivers/dri/i965/brw_shader.h | 4 +++-
src/mesa/main/dd.h |
We already pull these values from the metadata cache so no need to
recreate them.
---
src/compiler/glsl/linker.cpp | 29 +++--
src/mesa/main/shaderobj.c| 8 +---
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/src/compiler/glsl/linker.cpp
---
src/compiler/glsl/shader_cache.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 11ce512..ae3633e 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -1004,6 +1004,7
---
src/mesa/drivers/dri/i965/brw_shader_cache.c | 31 +++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c
b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index 8b31e71..a3dc2a3 100644
---
Also remove cache item and fallback to full recompile if current Mesa
version differs.
V2: don't leak buffer`
---
src/compiler/glsl/shader_cache.cpp | 13 +
1 file changed, 13 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index
---
src/compiler/glsl/link_uniforms.cpp | 2 +-
src/compiler/glsl/linker.h | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/link_uniforms.cpp
b/src/compiler/glsl/link_uniforms.cpp
index c9bb6ad..067db8d 100644
---
---
src/compiler/glsl/shader_cache.cpp | 7 +++
1 file changed, 7 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index db31788..774b904 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -80,6
---
src/compiler/glsl/shader_cache.cpp | 100 +
1 file changed, 100 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 774b904..793a909 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
These may be lowered constant arrays or uniform values that we set before
linking
so we need to cache the actual uniform values.
---
src/compiler/glsl/shader_cache.cpp | 31 +++
1 file changed, 31 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
---
src/compiler/glsl/shader_cache.cpp | 12
1 file changed, 12 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index ddf0c5d..3e2e2f1 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@
---
src/mesa/drivers/dri/i965/brw_shader_cache.c | 28 +++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c
b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index a3dc2a3..0452641 100644
---
---
src/compiler/glsl/shader_cache.cpp | 55 +-
1 file changed, 49 insertions(+), 6 deletions(-)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 793a909..cd18edc 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
---
src/compiler/glsl/shader_cache.cpp | 87 ++
1 file changed, 87 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 0937accd..6213d63 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
---
src/compiler/glsl/shader_cache.cpp | 154 +
1 file changed, 154 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index cd18edc..1c5c4f5 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
The scenario is a program has been linked for the first time and we
cache the program metadata, then glLinkProgram() is called for a second
time. Since we will now retrieve the program metadata from cache we need
to skip linking.
---
src/compiler/glsl/shader_cache.cpp | 1 +
1 file changed, 1
---
src/compiler/glsl/shader_cache.cpp | 4
1 file changed, 4 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 1d71068..ddf0c5d 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -988,6 +988,8
---
src/compiler/glsl/shader_cache.cpp | 15 +--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index a64f6e5..0937accd 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
---
src/compiler/glsl/shader_cache.cpp | 8
1 file changed, 8 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 1c5c4f5..a64f6e5 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -86,6
This initially adds support for simple uniforms and varyings.
---
src/compiler/glsl/shader_cache.cpp | 114 +
1 file changed, 114 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 854a21c..abbd696 100644
We may have seen the individual shaders before and skipped compiling
but they may not have been used together in this combination before.
We could probably only compile the shaders which were skipped here
but we need to be careful because the source may also have been
changed since the last
---
src/compiler/glsl/shader_cache.cpp | 14 ++
1 file changed, 14 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 6213d63..1d71068 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@
For now this disables the shader cache when transform feedback is enabled
via the GL API.
---
src/compiler/glsl/linker.cpp | 15 -
src/compiler/glsl/shader_cache.cpp | 89
src/mesa/drivers/dri/i965/brw_shader_cache.c | 7 +++
3 files
---
src/compiler/glsl/shader_cache.cpp | 34 +-
1 file changed, 25 insertions(+), 9 deletions(-)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 08927d9..529ec71 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
---
src/compiler/glsl/shader_cache.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index b4b7ee6..854a21c 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -149,6 +149,8
---
src/compiler/glsl/linker.cpp | 5 +++--
src/compiler/glsl/program.h | 3 ++-
src/compiler/glsl/standalone.cpp | 2 +-
src/mesa/main/ff_fragment_shader.cpp | 2 +-
src/mesa/main/shaderapi.c| 2 +-
src/mesa/program/ir_to_mesa.cpp | 5 +++--
This will be used to store all pointers in the cache as 64bit ints
allowing us to avoid issues when a 32bit program reads a cached
shader that was created by a 64bit application.
---
src/compiler/glsl/shader_cache.h | 10 ++
1 file changed, 10 insertions(+)
diff --git
---
src/compiler/glsl/shader_cache.cpp | 34 ++
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index abbd696..4903980 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
The hash key for glsl metadata is a hash of the hashes of each GLSL
source string.
This commit uses the put_key/get_key support in the cache put the SHA-1
hash of the source string for each successfully compiled shader into the
cache. This allows for early, optimistic returns from glCompileShader
Whoops these three patches where sent by mistake.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
This uses the recently-added cache.c to write out a serialization of
various state that's required in order to successfully load and use a
binary written out by a drivers backend, this state is referred to as
"metadata" throughout the implementation.
This patch is based on the initial work done
---
src/compiler/glsl/shader_cache.cpp | 14 ++
1 file changed, 14 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 529ec71..2fb8330 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@
---
src/compiler/glsl/shader_cache.cpp | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index 2fb8330..b0a7876 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++
---
src/compiler/glsl/shader_cache.cpp | 6 ++
1 file changed, 6 insertions(+)
diff --git a/src/compiler/glsl/shader_cache.cpp
b/src/compiler/glsl/shader_cache.cpp
index b0a7876..b4b7ee6 100644
--- a/src/compiler/glsl/shader_cache.cpp
+++ b/src/compiler/glsl/shader_cache.cpp
@@ -148,6
From: Carl Worth
Signed-off-by: Timothy Arceri
---
src/compiler/glsl/link_uniforms.cpp | 4
src/mesa/main/mtypes.h | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/compiler/glsl/link_uniforms.cpp
From: Carl Worth
The three additional tables are AttributeBindings, FragDataBindings,
and FragDataIndexBindings.
The first table (AttributeBindings) was identified as missing by
trying to test the shader cache with a program that called
glGetAttribLocation.
Many thanks to
---
docs/shading.html | 1 +
src/mesa/main/mtypes.h| 1 +
src/mesa/main/shaderapi.c | 2 ++
3 files changed, 4 insertions(+)
diff --git a/docs/shading.html b/docs/shading.html
index cf989ce..51d0986 100644
--- a/docs/shading.html
+++ b/docs/shading.html
@@ -49,6 +49,7 @@ execution.
This will be used to skip checking the cache and force a recompile.
---
src/compiler/glsl/glsl_parser_extras.cpp | 22 --
src/compiler/glsl/program.h | 2 +-
src/compiler/glsl/standalone.cpp | 3 ++-
src/mesa/main/shaderapi.c| 2 +-
4
The shader cache will start calling these from the compiler.
---
src/compiler/glsl/standalone_scaffolding.cpp | 8
src/compiler/glsl/standalone_scaffolding.h | 4
2 files changed, 12 insertions(+)
diff --git a/src/compiler/glsl/standalone_scaffolding.cpp
This uses the recently-added cache.c to write out the final linked
binary for vertex and fragment shader programs.
This is based off the initial implementation done by Carl.
---
src/mesa/drivers/dri/i965/Makefile.sources | 1 +
src/mesa/drivers/dri/i965/brw_shader_cache.c | 375
From: Carl Worth
This will be used by the on disk shader cache.
Signed-off-by: Timothy Arceri
---
src/mesa/drivers/dri/i965/brw_compiler.h | 4
src/mesa/drivers/dri/i965/brw_vs.c | 2 ++
src/mesa/drivers/dri/i965/brw_wm.c | 2
From: Carl Worth
V2: dont leak cache
Signed-off-by: Timothy Arceri
---
src/mesa/main/context.c | 6 ++
src/mesa/main/mtypes.h | 5 +
2 files changed, 11 insertions(+)
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
From: Carl Worth
The shader cache is expected to be developed incrementally over a
fairly long series of commits. For that period of instability, we
require users to opt into the shader cache by setting:
MESA_GLSL_CACHE_ENABLE=1
In the future, when the shader cache
This generates the program ids at cache upload time rather than at
program creation time.
Moving the id generation here will be useful for on-disk shader
cache support because it means we don't generate ids if there was
a cache miss and we had to fall back to compiling from source.
This increases
Reviewed-by: Eric Anholt
---
docs/envvars.html | 11 +++
1 file changed, 11 insertions(+)
diff --git a/docs/envvars.html b/docs/envvars.html
index cf57ca5..f0f18b3 100644
--- a/docs/envvars.html
+++ b/docs/envvars.html
@@ -112,6 +112,17 @@ glGetString(GL_VERSION) for
This code provides for an on-disk cache of objects. Objects are stored
and retrieved via names that are arbitrary 20-byte sequences,
(intended to be SHA-1 hashes of something identifying for the
content). The directory used for the cache can be specified by means
of environment variables in the
The last two patches are not needed but it seems safer to just store
separate shaders for different platform to avoid any future bugs which
we are unlikely to do regression testing for since there is no real
advantage in sharing the cached shaders.
V6:
- rewrote a bunch of the i965 shader cache
Reviewed-by: Kenneth Graunke
---
src/mesa/drivers/dri/i965/brw_link.cpp | 14 ++
src/mesa/main/shaderapi.c | 9 +++--
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp
From: Chad Versace
---
src/compiler/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/compiler/.gitignore b/src/compiler/.gitignore
index c0e6299..5d30b4e 100644
--- a/src/compiler/.gitignore
+++ b/src/compiler/.gitignore
@@ -1,4 +1,5 @@
glsl_compiler
101 - 162 of 162 matches
Mail list logo