[Mesa-dev] [PATCH 2/2] ac/nir: Fix accessing an unitialized value.

2016-11-28 Thread Bas Nieuwenhuizen
Signed-off-by: Bas Nieuwenhuizen --- src/amd/common/ac_nir_to_llvm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index c9b0106..d9eef57 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++

[Mesa-dev] [PATCH 1/2] radv: Initialize the shader_stats_dump flag.

2016-11-28 Thread Bas Nieuwenhuizen
Meta was using it before it was set. I suspect we typically don't want to dump meta shaders, so just set it to false in the beginning. Signed-off-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_device.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [Mesa-dev] [PATCH] EGL/android: Enhance pbuffer implementation

2016-11-28 Thread Liu, Zhiquan
> >>> if (dri2_surf->dri_image_front) { > >>> - _eglLog(_EGL_DEBUG, "%s : %d : destroy dri_image_front", __func__, > __LINE__); > >>> + _eglLog(_EGL_DEBUG, "destroy dri_image_front"); > >>>dri2_dpy->image->destroyImage(dri2_surf->dri_image_front); > >>>

Re: [Mesa-dev] [PATCH] i965/fs: Refactor handling of constant tg4 offsets

2016-11-28 Thread Kenneth Graunke
On Monday, November 28, 2016 7:28:12 PM PST Jason Ekstrand wrote: > Previously, we had an OFFSET_VALUE source for logical texture instructions > that was intended to mean exactly what it says, "offset". In reality, we > only fully used it for tg4 offsets. We used offset_value.file == IMM to >

Re: [Mesa-dev] [PATCH 02/58] mesa: optimise interleaved sso validation

2016-11-28 Thread Timothy Arceri
On Mon, 2016-11-28 at 18:59 -0800, Ian Romanick wrote: > On 11/20/2016 05:28 AM, Timothy Arceri wrote: > > > > Now that we have a linked_stages bitfield we can use this > > to check if the program is used at a later stage. > > > > This change is also required to be able to use gl_program > >

Re: [Mesa-dev] [PATCH] mesa: fix active subroutine uniforms properly

2016-11-28 Thread Timothy Arceri
On Mon, 2016-11-28 at 08:38 -0200, Alejandro Piñeiro wrote: > On 26/11/16 21:31, Timothy Arceri wrote: > > > > 07fe2d565b introduced a big hack in order to return > > NumSubroutineUniforms when querying ACTIVE_RESOURCES for > > _SUBROUTINE_UNIFORM interfaces.  > > I wouldn't call that a big

[Mesa-dev] [PATCH 44/56] i965: track mesa version shader cache items were created with

2016-11-28 Thread Timothy Arceri
Also remove cache item and fallback to full recompile if current Mesa version differs. --- src/mesa/drivers/dri/i965/brw_shader_cache.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c

[Mesa-dev] [PATCH 31/56] glsl/i965: make a copy of the shader source for use with cache fallback

2016-11-28 Thread Timothy Arceri
A number of things can happen that change the shader source after it is compiled or linked. For example: - Source changed after it is first compiled - Source changed after linking - Shader detached after linking In order to be able to fallback to a full rebuild on a cache miss we make a copy of

[Mesa-dev] [PATCH 28/56] i965: add image param shader cache support

2016-11-28 Thread Timothy Arceri
--- 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 4798809..cf90b0e 100644 ---

[Mesa-dev] [PATCH 56/56] i965: create separate 32bit and 64bit versions of shader cache objects

2016-11-28 Thread Timothy Arceri
Pointers will have different lengths so we simply create a different sha1 for each platform. In theory we should be able to share cached shaders as we cache all pointer as uint64_t however if a pointer is ever added to one of the structs we write to file with blob_write_bytes() we run the risk of

[Mesa-dev] [PATCH 23/56] glsl: add support for caching atomic buffers

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 89 ++ 1 file changed, 89 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index d865c0c..3ecdced 100644 --- a/src/compiler/glsl/shader_cache.cpp +++

[Mesa-dev] [PATCH 45/56] glsl: disable on disk shader cache when running as another user

2016-11-28 Thread Timothy Arceri
--- src/util/disk_cache.c | 4 1 file changed, 4 insertions(+) diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c index ce35e9a..1be5376 100644 --- a/src/util/disk_cache.c +++ b/src/util/disk_cache.c @@ -142,6 +142,10 @@ disk_cache_create(void) struct stat sb; size_t size;

[Mesa-dev] [PATCH 54/56] i965: pad out brw_stage_prog_data pointers to 64bits

2016-11-28 Thread Timothy Arceri
In order for this struct to have the same size on 64bit and 32bit platforms we uses unions to make sure the pointers always take up at least 64bits. This is useful for making sure we always write the same size data to disk in the shader cache. --- src/mesa/drivers/dri/i965/brw_compiler.h | 6

[Mesa-dev] [PATCH 27/56] glsl: track mesa version shader cache items were created with

2016-11-28 Thread Timothy Arceri
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

[Mesa-dev] [PATCH 21/56] glsl: store subroutine remap table in shader cache

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 57 ++ 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 6ae8f7e..37afbc0 100644 --- a/src/compiler/glsl/shader_cache.cpp +++

[Mesa-dev] [PATCH 37/56] glsl/mesa: make a copy of attribute bindings in case of cache fallback

2016-11-28 Thread Timothy Arceri
If the shader cache falls back to doing a compile and link we need the original attribute bindings as they could have changed after the program was first linked. --- src/compiler/glsl/shader_cache.cpp | 15 +++ src/mesa/main/mtypes.h | 7 +++ src/mesa/main/shaderobj.c

[Mesa-dev] [PATCH 46/56] glsl: don't try to load/store buffer object values in the cache

2016-11-28 Thread Timothy Arceri
Also add an assert to catch buffer overflows. --- src/compiler/glsl/shader_cache.cpp | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index cdb3665..168652d 100644 ---

[Mesa-dev] [PATCH 51/56] i965: add shader cache support for geometry shaders

2016-11-28 Thread Timothy Arceri
--- src/mesa/drivers/dri/i965/brw_gs.c | 15 --- src/mesa/drivers/dri/i965/brw_shader_cache.c | 25 + 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index

[Mesa-dev] [PATCH 48/56] glsl: reserve parameter storage on cache restore

2016-11-28 Thread Timothy Arceri
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 168652d..4d84842 100644 ---

[Mesa-dev] [PATCH 43/56] i965: add an env var to force cache fallback

2016-11-28 Thread Timothy Arceri
There are a number of reasons we can get to the program upload stage and have neither IR nor a valid cached binary. For example the binary may have been randomly evicted from the cache to make room or the binary may have been created with an old version of Mesa. This environment variable enables

[Mesa-dev] [PATCH 15/56] glsl: add basic support for resource list to shader cache

2016-11-28 Thread Timothy Arceri
This initially adds support for simple uniforms and varyings. --- src/compiler/glsl/shader_cache.cpp | 121 + 1 file changed, 121 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 30884c7..e255c88 100644

[Mesa-dev] [PATCH 47/56] i965: add support for caching clip planes

2016-11-28 Thread Timothy Arceri
--- 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 1c6a75b..bb57e9a 100644 ---

[Mesa-dev] [PATCH 53/56] i965: add shader cache support for tess stages

2016-11-28 Thread Timothy Arceri
--- src/mesa/drivers/dri/i965/brw_shader_cache.c | 48 src/mesa/drivers/dri/i965/brw_tcs.c | 16 -- src/mesa/drivers/dri/i965/brw_tes.c | 15 +++-- 3 files changed, 73 insertions(+), 6 deletions(-) diff --git

[Mesa-dev] [PATCH 26/56] glsl: cache uniform values

2016-11-28 Thread Timothy Arceri
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 | 33 + 1 file changed, 33 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp

[Mesa-dev] [PATCH 40/56] i965: don't rebuild param list after cache miss

2016-11-28 Thread Timothy Arceri
Previously we ended up with the same param list but in a different location, which will mess up the pointers stored in the new cache object if all stages were not fully rebuilt e.g. after a fragment program cache miss. This also stops the list from being leaked on fallback. ---

[Mesa-dev] [PATCH 20/56] glsl: add support for caching subroutines

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 107 + 1 file changed, 107 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 44f5946..6ae8f7e 100644 --- a/src/compiler/glsl/shader_cache.cpp +++

[Mesa-dev] [PATCH 39/56] i965: don't precompile or rebuild resource list on cache fallback

2016-11-28 Thread Timothy Arceri
--- 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 fb8500d..93e38d5 100644

[Mesa-dev] [PATCH 50/56] glsl: enable shader cache support for geometry shaders

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 4d84842..c244c53 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp

[Mesa-dev] [PATCH 41/56] i965: don't recreate program struct on cache fallback

2016-11-28 Thread Timothy Arceri
We already have the struct and paramlist we don't want to recreate them as this is unnecessary and would mean we would need to remap anything using the old paramlist to the addresses of the new one. --- src/compiler/glsl/linker.cpp | 14 +++-

[Mesa-dev] [PATCH 30/56] mesa/glsl: add cache_fallback flag to gl_shader_program_data

2016-11-28 Thread Timothy Arceri
This will allow us to skip certain things when falling back to a full recompile on a cache miss such as avoiding reinitialising uniforms. In this chage we use it to avoid reading the program metadata from the cache and skipping linking during a fallback. --- src/compiler/glsl/shader_cache.cpp |

[Mesa-dev] [PATCH 52/56] glsl: enable shader cache for tess stages

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index c244c53..fe976b0 100644 --- a/src/compiler/glsl/shader_cache.cpp +++

[Mesa-dev] [PATCH 34/56] glsl: skip more uniform initialisation when doing fallback linking

2016-11-28 Thread Timothy Arceri
We already pull these values from the metadata cache so no need to recreate them. --- src/compiler/glsl/linker.cpp | 20 src/mesa/main/shaderobj.c| 8 +--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/compiler/glsl/linker.cpp

[Mesa-dev] [PATCH 33/56] glsl: don't lose uniform values when falling back to full compile

2016-11-28 Thread Timothy Arceri
Here we skip the recreation of uniform storage if we are relinking after a cache miss. This is improtant because uniform values may have already been set by the application and we don't want to reset them. --- src/compiler/glsl/link_uniforms.cpp | 31 +++

[Mesa-dev] [PATCH 36/56] util: make string_to_uint_map hash table public

2016-11-28 Thread Timothy Arceri
This will allow us to make use of the hash_table_call_foreach() function from outside the object. --- src/util/string_to_uint_map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/string_to_uint_map.h b/src/util/string_to_uint_map.h index e0533ec..18f5166 100644

[Mesa-dev] [PATCH 55/56] glsl: create separate 32bit and 64bit versions of shader cache objects

2016-11-28 Thread Timothy Arceri
Pointers will have different lengths so we simply create a different sha1 for each platform. In theory we should be able to share cached shaders as we cache all pointer as uint64_t however if a pointer is ever added to one of the structs we write to file with blob_write_bytes() we run the risk of

[Mesa-dev] [PATCH 38/56] glsl/mesa: make a copy of FragData bindings in case of cache fallback

2016-11-28 Thread Timothy Arceri
If the shader cache falls back to doing a compile and link we need the original FragData bindings as they could have changed after the program was first linked. --- src/compiler/glsl/shader_cache.cpp | 8 src/mesa/main/mtypes.h | 2 ++ src/mesa/main/shaderobj.c |

[Mesa-dev] [PATCH 49/56] i965: handle incompatiable binaries in shader-cache

2016-11-28 Thread Timothy Arceri
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

[Mesa-dev] [PATCH 42/56] i965: add cache fallback support

2016-11-28 Thread Timothy Arceri
This is fairly simple, if we have no IR we compile the fallback shaders then copy the other fallback data such as attibute bindings to a temp shader program struct, then we link the program and clean up the mess. The IR will be attached to the existing gl_program. ---

[Mesa-dev] [PATCH 32/56] glsl: don't reference shader prog data during cache fallback

2016-11-28 Thread Timothy Arceri
We already have a reference. --- src/compiler/glsl/linker.cpp | 3 ++- src/mesa/main/shaderobj.c| 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index b67a7e9..0dcf00d 100644 --- a/src/compiler/glsl/linker.cpp

[Mesa-dev] [PATCH 29/56] i965: add shader cache support for pull param pointers

2016-11-28 Thread Timothy Arceri
--- src/mesa/drivers/dri/i965/brw_shader_cache.c | 29 +++- 1 file changed, 28 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 cf90b0e..7345242 100644 ---

[Mesa-dev] [PATCH 24/56] glsl: cache some more image metadata

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 10 ++ 1 file changed, 10 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 3ecdced..7ab9280 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@

[Mesa-dev] [PATCH 35/56] glsl: don't reprocess or clear UBOs on cache fallback

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/linker.cpp | 62 +++- src/mesa/main/shaderobj.c| 16 +++- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index b609c86..b73bb6c 100644 ---

[Mesa-dev] [PATCH 18/56] mesa/glsl: add api_enabled flag to gl_transform_feedback_info

2016-11-28 Thread Timothy Arceri
This will be used to disable the shader cache when xfb is enabled via the api as we don't currently allow for it when generating the sha for the shader. --- src/compiler/glsl/link_varyings.cpp | 5 - src/mesa/main/mtypes.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-)

[Mesa-dev] [PATCH 22/56] glsl: add shader cache support for buffer blocks

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 163 + 1 file changed, 163 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 37afbc0..d865c0c 100644 --- a/src/compiler/glsl/shader_cache.cpp +++

[Mesa-dev] [PATCH 17/56] glsl: skip linking when current program has been retrieved from cache

2016-11-28 Thread Timothy Arceri
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

[Mesa-dev] [PATCH 25/56] glsl: make uniform values helper available for use elsewhere

2016-11-28 Thread Timothy Arceri
--- 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 9c0387c..770fc3f 100644 ---

[Mesa-dev] [PATCH 11/56] i965: add initial implementation of on disk shader cache

2016-11-28 Thread Timothy Arceri
This uses the recently-added disk_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 | 369

[Mesa-dev] [PATCH 10/56] glsl: add helper to convert pointers to uint64_t

2016-11-28 Thread Timothy Arceri
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

[Mesa-dev] [PATCH 12/56] glsl, i965: make use of on disk shader cache

2016-11-28 Thread Timothy Arceri
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

[Mesa-dev] [PATCH 16/56] glsl: add shader cache support for samplers

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index e255c88..85ced0c 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp

[Mesa-dev] [PATCH 05/56] glsl: add cache to ctx and add sha1 string fields

2016-11-28 Thread Timothy Arceri
From: Carl Worth We also add a flag for detecting shaders written to shader cache. V2: dont leak cache Signed-off-by: Timothy Arceri --- src/mesa/main/context.c | 6 ++ src/mesa/main/mtypes.h | 9 + 2 files changed, 15

[Mesa-dev] [PATCH 19/56] glsl, i965: add support for caching shaders with xfb qualifiers

2016-11-28 Thread Timothy Arceri
For now this disables the shader cache when transform feedback is enabled via the GL API as we don't currently allow for it when generating the sha for the shader. --- src/compiler/glsl/linker.cpp | 14 +++- src/compiler/glsl/shader_cache.cpp | 108

[Mesa-dev] [PATCH 08/56] glsl: add param to force shader recompile

2016-11-28 Thread Timothy Arceri
This will be used to skip checking the cache and force a recompile. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/program.h | 2 +- src/compiler/glsl/standalone.cpp | 3 ++- src/mesa/main/shaderapi.c| 2 +- 4 files changed, 5

[Mesa-dev] [PATCH 09/56] glsl: add initial implementation of shader cache

2016-11-28 Thread Timothy Arceri
This uses disk_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 initial version is intended to work with vertex and

[Mesa-dev] [PATCH 14/56] glsl: fix uniform remap table cache when explicit locations used

2016-11-28 Thread Timothy Arceri
--- src/compiler/glsl/shader_cache.cpp | 36 ++-- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index 98fec27..30884c7 100644 --- a/src/compiler/glsl/shader_cache.cpp +++

[Mesa-dev] [PATCH 13/56] glsl: Serialize three additional hash tables with program metadata

2016-11-28 Thread Timothy Arceri
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

[Mesa-dev] [PATCH 06/56] mesa: add new MESA_GLSL flag for printing shader cache debug info

2016-11-28 Thread Timothy Arceri
--- 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.

[Mesa-dev] [PATCH 03/56] glsl: add new uniform fields to be used to restore state from cache

2016-11-28 Thread Timothy Arceri
From: Carl Worth Signed-off-by: Timothy Arceri --- src/compiler/glsl/link_uniforms.cpp | 4 src/mesa/main/mtypes.h | 4 2 files changed, 8 insertions(+) diff --git a/src/compiler/glsl/link_uniforms.cpp

[Mesa-dev] [PATCH 07/56] util: add a disk_cache_remove() function

2016-11-28 Thread Timothy Arceri
This will be used to remove cache items created with old versions of Mesa or other invalid cache items from the cache. --- src/util/disk_cache.c | 22 ++ src/util/disk_cache.h | 12 2 files changed, 34 insertions(+) diff --git a/src/util/disk_cache.c

[Mesa-dev] V7 On disk shader cache GLSL/i965

2016-11-28 Thread Timothy Arceri
This series applies on top of these to clean-up series [1] and [2] please reviews those patches first. [1] https://patchwork.freedesktop.org/series/15613/ [2] https://patchwork.freedesktop.org/series/15775/ V7: - support for SSO added. - rebased/reworked on top of my work to rework the gl

[Mesa-dev] [PATCH 01/56] docs: add shader cache environment variables

2016-11-28 Thread Timothy Arceri
Reviewed-by: Eric Anholt --- docs/envvars.html | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/envvars.html b/docs/envvars.html index 5dd7bab..2f013bf 100644 --- a/docs/envvars.html +++ b/docs/envvars.html @@ -114,6 +114,17 @@ glGetString(GL_VERSION) for

[Mesa-dev] [PATCH 02/56] glsl: Switch to disable-by-default for the GLSL shader cache

2016-11-28 Thread Timothy Arceri
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

[Mesa-dev] [PATCH 04/56] i965: add new field for storing program size

2016-11-28 Thread Timothy Arceri
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 | 8 src/mesa/drivers/dri/i965/brw_gs.c | 2 ++ src/mesa/drivers/dri/i965/brw_tcs.c |

Re: [Mesa-dev] [PATCH 40/50] nir: In split_var_copies_block, uint, int, and bool types cannot be matrices

2016-11-28 Thread Jason Ekstrand
Seems reasonable, Reviewed-by: Jason Ekstrand On Mon, Nov 28, 2016 at 7:25 PM, Ian Romanick wrote: > From: Ian Romanick > > Noticed while adding support for 64-bit integer types. > > Signed-off-by: Ian Romanick

[Mesa-dev] [PATCH] i965/fs: Refactor handling of constant tg4 offsets

2016-11-28 Thread Jason Ekstrand
Previously, we had an OFFSET_VALUE source for logical texture instructions that was intended to mean exactly what it says, "offset". In reality, we only fully used it for tg4 offsets. We used offset_value.file == IMM to mean, "you have a constant offset, go look in instr->offset" and didn't

[Mesa-dev] [PATCH 33/50] glsl: Optimize redundant pack(unpack()) and unpack(pack()) combinations

2016-11-28 Thread Ian Romanick
From: Ian Romanick The lowering passes 64-bit integer operations will generate a lot of these. v2: Modify the HANDLE_PACK_UNPACK_INVERSE so that the breaks apply to the switch instead of the 'do { } while(true)' loop. Signed-off-by: Ian Romanick

[Mesa-dev] [PATCH 46/50 v2] i965: Add 64-bit integer support for conversions and bitcasts

2016-11-28 Thread Ian Romanick
From: Ian Romanick v2 (idr): Make the "from" type in a cast unsized. This reduces the number of required cast operations at the expensive slightly more complex code. However, this will be a dramatic improvement when other sized integer types are added. Suggested by

[Mesa-dev] [PATCH 28/50] glsl: Add a lowering pass for 64-bit integer sign()

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick --- src/compiler/glsl/ir_optimization.h | 1 + src/compiler/glsl/lower_64bit.cpp | 7 +++ 2 files changed, 8 insertions(+) diff --git a/src/compiler/glsl/ir_optimization.h

[Mesa-dev] [PATCH 32/50] glsl: Add a lowering pass for 64-bit integer modulus

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick --- src/compiler/glsl/ir_optimization.h | 1 + src/compiler/glsl/lower_64bit.cpp | 11 +++ 2 files changed, 12 insertions(+) diff --git a/src/compiler/glsl/ir_optimization.h

[Mesa-dev] [PATCH 16/50] glsl: Add 64-bit integer functions

2016-11-28 Thread Ian Romanick
From: Dave Airlie These are all the allowed 64-bit functions from ARB_gpu_shader_int64 spec. v2: restrict int64/double functions better. v3 (idr): Delete spurious blank lines. Suggested by Matt. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick

[Mesa-dev] [PATCH 43/50] i965: Return Q and UQ types for int64 and uint64

2016-11-28 Thread Ian Romanick
From: Ian Romanick It seems like maybe this should return a different type based on Gen. Q and UQ only exist on Gen8+, but, based on the old comment, I believe previous Gens can generate 64-bit moves. Signed-off-by: Ian Romanick ---

[Mesa-dev] [PATCH 25/50] glsl: Add "built-in" functions to do 64x64 => 64 multiplication

2016-11-28 Thread Ian Romanick
From: Ian Romanick These functions are directly available in shaders. A #define is added to detect the presence. This allows these functions to be tested using piglit regardless of whether the driver uses them for lowering. The GLSL spec says that functions and

[Mesa-dev] [PATCH 41/50] nir: Add support for 64-bit integer types to split_var_copies_block

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick Reviewed-by: Connor Abbott --- src/compiler/nir/nir_split_var_copies.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir/nir_split_var_copies.c

[Mesa-dev] [PATCH 42/50] i965: Really don't emit Q or UQ moves on Gen < 8

2016-11-28 Thread Ian Romanick
From: Ian Romanick It's much easier to do this in the generator rather than while coming out of NIR. brw_type_for_nir_type doesn't know the Gen, so we'd have to add a bunch of plumbing. The alternate fix is to not emit int64 moves for doubles in the first place... but

[Mesa-dev] [PATCH 26/50] glsl: Add a lowering pass for 64-bit integer multiplication

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick --- src/compiler/Makefile.glsl.am| 1 + src/compiler/Makefile.sources| 1 + src/compiler/glsl/ir_optimization.h | 6 +

[Mesa-dev] [PATCH 29/50] glsl: Add "built-in" functions to do 64/64 => 64 division

2016-11-28 Thread Ian Romanick
From: Ian Romanick These functions are directly available in shaders. A #define is added to detect the presence. This allows these functions to be tested using piglit regardless of whether the driver uses them for lowering. The GLSL spec says that functions and

[Mesa-dev] [PATCH 49/50] i965: Split SIMD16 CMP of Q and UQ instructions

2016-11-28 Thread Ian Romanick
From: Ian Romanick This is basically the same as happens for doubles. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 43 +--- 1 file changed, 29 insertions(+), 14 deletions(-) diff

[Mesa-dev] [PATCH 17/50] glsl: Add interaction between ARB_gpu_shader_int64 and ARB_shader_clock

2016-11-28 Thread Ian Romanick
From: Ian Romanick If ARB_gpu_shader_int64 is supported, ARB_shader_clock also adds clockARB() that returns a uint64_t. Rather than add new opcodes and intrinsics for this, just wrap the existing intrinsic with a packUint2x32. Signed-off-by: Ian Romanick

[Mesa-dev] [PATCH 31/50] glsl: Add "built-in" functions to do 64%64 => 64 modulus

2016-11-28 Thread Ian Romanick
From: Ian Romanick These functions are directly available in shaders. A #define is added to detect the presence. This allows these functions to be tested using piglit regardless of whether the driver uses them for lowering. The GLSL spec says that functions and

[Mesa-dev] [PATCH 24/50] glsl: Move builtin_function related prototypes to a separate file

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick --- src/compiler/Makefile.sources | 1 + src/compiler/glsl/ast_function.cpp | 1 + src/compiler/glsl/ast_to_hir.cpp | 1 +

[Mesa-dev] [PATCH 34/50] nir: Add GLSL_TYPE_INT64 and GLSL_TYPE_UINT64 to glsl_get_bit_size

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick Reviewed-by: Connor Abbott --- src/compiler/nir_types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h index

[Mesa-dev] [PATCH 48/50] i965: Enable 64-bit integer support for almost all unary and binary operations

2016-11-28 Thread Ian Romanick
From: Ian Romanick Integer comparison functions (e.g., nir_op_ilt) are handled in the next commit. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 10 -- 1 file changed, 10 deletions(-) diff --git

[Mesa-dev] [PATCH 02/50] mesa: Add ARB_gpu_shader_int64 extension bits

2016-11-28 Thread Ian Romanick
From: Dave Airlie This just adds the usual boilerplate in mesa core. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick Reviewed-by: Matt Turner --- src/mesa/main/extensions_table.h | 1 +

[Mesa-dev] [PATCH 06/50 v4] glsl/ast/ir: Add 64-bit integer constant support

2016-11-28 Thread Ian Romanick
From: Dave Airlie This adds support for 64-bit integer constants to the parser, ast and ir. v2: fix a few issues found in testing. v3: Add missing ir_constant copy contructor support. v4: Use PRIu64 and PRId64 in printfs in glsl_parser_extras.cpp. Suggested by Nicolai.

[Mesa-dev] [PATCH 21/50] i965: Avoid int64 induced warnings

2016-11-28 Thread Ian Romanick
From: Dave Airlie Just add types into unsupported or double equivalent spots. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick Reviewed-by: Iago Toral Quiroga Reviewed-by: Matt Turner

[Mesa-dev] [PATCH 23/50] glsl/standalone: Enable ARB_gpu_shader_int64

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick --- src/compiler/glsl/ir_builder_print_visitor.cpp | 16 +--- src/compiler/glsl/standalone_scaffolding.cpp | 1 + 2 files changed, 14 insertions(+), 3 deletions(-) diff --git

[Mesa-dev] [PATCH 14/50] glsl/ast: Add 64-bit integer support in some places.

2016-11-28 Thread Ian Romanick
From: Dave Airlie Just add support in two more places in ast parsing. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick Reviewed-by: Matt Turner --- src/compiler/glsl/ast_to_hir.cpp | 5 + 1 file

[Mesa-dev] [PATCH 27/50] glsl: Add "built-in" function for 64-bit integer sign()

2016-11-28 Thread Ian Romanick
From: Ian Romanick These functions are directly available in shaders. A #define is added to detect the presence. This allows these functions to be tested using piglit regardless of whether the driver uses them for lowering. The GLSL spec says that functions and

[Mesa-dev] [PATCH 37/50] nir: Lower packing and unpacking of 64-bit integer types

2016-11-28 Thread Ian Romanick
From: Ian Romanick This change makes me wonder whether double packing should be reimplemented as int64BitsToDouble(packInt2x32(v)). I'm a little on the fence since not all platforms that support fp64 natively support int64. Signed-off-by: Ian Romanick

[Mesa-dev] [PATCH 09/50 v4] glsl/ir: Add support for 64-bit integer conversions.

2016-11-28 Thread Ian Romanick
From: Dave Airlie This adds all the conversions in the world, I'm not 100% sure of all of these are needed, but add all of them and we can cut them down later. v2: fix issue with packing output types. v3 (idr): Rebase on top of idr's series to generate

[Mesa-dev] [PATCH 45/50] i965: Enable emitting Q and UQ instructions in the fs backend

2016-11-28 Thread Ian Romanick
From: Ian Romanick v2: Fixup assertion in brw_reg_type_to_hw_type to allow BRW_REGISTER_TYPE_{UQ,Q} on Gen8+. Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_eu_emit.c | 5 - src/mesa/drivers/dri/i965/brw_inst.h| 8

[Mesa-dev] [PATCH 44/50] i965: Add support for constant evaluation on Q and UQ types

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_reg.h | 1 + src/mesa/drivers/dri/i965/brw_shader.cpp | 26 +++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git

[Mesa-dev] [PATCH 39/50] nir: Enable 64-bit integer support for almost all unary and binary operations

2016-11-28 Thread Ian Romanick
From: Ian Romanick v2: Don't up-convert the shift count parameter if shift instructions. Suggested by Connor. Add type_is_singed() function. This will make adding 8- and 16-bit types easier. Signed-off-by: Ian Romanick Reviewed-by: Connor

[Mesa-dev] [PATCH 35/50] nir: Add 64-bit integer constant support

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick Reviewed-by: Connor Abbott --- src/compiler/glsl/glsl_to_nir.cpp | 10 ++ src/compiler/nir/nir.c| 4 src/compiler/nir/nir.h| 2 ++

[Mesa-dev] [PATCH 10/50 v4] glsl: Add 64-bit integer support for constant expressions

2016-11-28 Thread Ian Romanick
From: Dave Airlie This just adds the new operations and add 64-bit integer support to all the existing cases where it is needed. v2: fix some issues found in testing. v2.1: add unreachable (Ian), add missing int/uint pack/unpack (Dave). v3 (idr): Rebase on top of idr's

[Mesa-dev] [PATCH 13/50] glsl: Add 64-bit integer support to some operations.

2016-11-28 Thread Ian Romanick
From: Dave Airlie This adds 64-bit integer support to some AST and IR operations where it is needed. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick --- src/compiler/glsl/ast_to_hir.cpp | 12 ++--

[Mesa-dev] [PATCH 40/50] nir: In split_var_copies_block, uint, int, and bool types cannot be matrices

2016-11-28 Thread Ian Romanick
From: Ian Romanick Noticed while adding support for 64-bit integer types. Signed-off-by: Ian Romanick Reviewed-by: Connor Abbott Cc: Jason Ekstrand --- src/compiler/nir/nir_split_var_copies.c

[Mesa-dev] [PATCH 12/50] glsl/ir_builder: Add support for some 64-bit bitcasts.

2016-11-28 Thread Ian Romanick
From: Dave Airlie We need builder support to implement some of the builtins. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick Reviewed-by: Matt Turner --- src/compiler/glsl/ir_builder.cpp | 24

[Mesa-dev] [PATCH 07/50] glsl/varyings: Add 64-bit integer support.

2016-11-28 Thread Ian Romanick
From: Dave Airlie This adds 64-bit ints to the link_varyings 64-bit support. Signed-off-by: Dave Airlie Reviewed-by: Ian Romanick Reviewed-by: Matt Turner --- src/compiler/glsl/link_varyings.h | 8

[Mesa-dev] [PATCH 18/50] glsl: Print GLSL_TYPE_UINT64 and GLSL_TYPE_INT64 values

2016-11-28 Thread Ian Romanick
From: Ian Romanick Signed-off-by: Ian Romanick Reviewed-by: Matt Turner --- src/compiler/glsl/ir_print_visitor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/glsl/ir_print_visitor.cpp

  1   2   >