summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glsl: don't reference shader prog data during cache fallbackTimothy Arceri2017-02-172-2/+4
| | | | | | We already have a reference. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/glsl: add cache_fallback flag to gl_shader_program_dataTimothy Arceri2017-02-172-1/+3
| | | | | | | | | | | 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 change we use it to avoid reading the program metadata from the cache and skipping linking during a fallback. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add api and glsl version to hash generation for shadersTimothy Arceri2017-02-171-0/+8
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: cache uniform valuesTimothy Arceri2017-02-171-0/+33
| | | | | | | These may be lowered constant arrays or uniform values that we set before linking so we need to cache the actual uniform values. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: make uniform values helper available for use elsewhereTimothy Arceri2017-02-172-1/+4
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: cache some more image metadataTimothy Arceri2017-02-171-0/+10
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add support for caching atomic buffersTimothy Arceri2017-02-171-0/+89
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add shader cache support for buffer blocksTimothy Arceri2017-02-171-0/+163
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: store subroutine remap table in shader cacheTimothy Arceri2017-02-171-6/+42
| | | | | | V2: use new helpers to store/restore table entries. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add support for caching subroutinesTimothy Arceri2017-02-171-0/+107
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add support for caching shaders with xfb qualifiersTimothy Arceri2017-02-172-1/+121
| | | | | | | | 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. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add shader cache support for samplersTimothy Arceri2017-02-171-0/+18
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add basic support for resource list to shader cacheTimothy Arceri2017-02-171-0/+121
| | | | | | This initially adds support for simple uniforms and varyings. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: fix uniform remap table cache when explicit locations usedTimothy Arceri2017-02-171-7/+49
| | | | | | | | V2: don't store pointers use an enum instead to flag what should be restored. Also do the work in a helper that we will later use for the subroutine remap table. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: Serialize three additional hash tables with program metadataCarl Worth2017-02-171-0/+74
| | | | | | | | | | | | | | | | 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 Tapani Pälli <[email protected]>, as it was review of related work that he had done previously that pointed me to the necessity to also save and restore FragDataBindings and FragDataIndexBindings. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: use correct shader source in case of cache fallbackTimothy Arceri2017-02-174-4/+25
| | | | | | | | | | | | | | | | | The scenario is: glShaderSource glCompileShader <-- deferred due to cache hit of shader glShaderSource <-- with new source code glAttachShader glLinkProgram <-- no cache hit for program At this point we need to compile the original source when we fallback. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: make use of on disk shader cacheTimothy Arceri2017-02-173-0/+29
| | | | | | | | | | | | | | | 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 (if the identical source string had been successfully compiled in the past), in the hope that the final, linked shader will be found in the cache. This is based on the intial patch by Carl. Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: add initial implementation of shader cacheTimothy Arceri2017-02-174-1/+633
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 all stages beside compute. This patch is based on the initial work done by Carl. V2: extend the file's doxygen comment to cover some of the design decisions. V3: - skip cache for fixed function shaders - add int64 support - fix glsl IR program parameter caching/restore and cache the parameter values which are used by gallium backends. - use new link status enum V4: - add compute program support Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: use shared emit_umsb helper.Dave Airlie2017-02-161-22/+2
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: use shared umsb helper.Dave Airlie2017-02-161-17/+1
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radeon/ac: add emit umsb shared code.Dave Airlie2017-02-162-0/+29
| | | | | | | | Since we shared imsb, makes sense to share umsb. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radeon/ac: use llvm.amdgcn.sffbh intrinsic instead of AMDGPU.flbit.i32Dave Airlie2017-02-161-1/+2
| | | | | | | | Use the newer intrinsic. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radeonsi: use shared emit imsb code.Dave Airlie2017-02-161-25/+3
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv/ac: use shader imsb emission code.Dave Airlie2017-02-161-17/+1
| | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radeon/ac: add ac_emit_imsb helper.Dave Airlie2017-02-162-0/+28
| | | | | | | | | We want to use a different intrinsic on newer llvm, so move this code to a shared area. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* egl: _eglFilterArray's filter is always non-nullEmil Velikov2017-02-161-18/+9
| | | | | | | Drop the extra handling and assert() if things change in the future. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* util/disk_cache: do not allow space in MESA_GLSL_CACHE_MAX_SIZEEmil Velikov2017-02-161-2/+0
| | | | | | | No other env var used in mesa allows for space in the variable contents. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Timothy Arceri <[email protected]>
* r100: use correct libdrm_radeon macroEmil Velikov2017-02-161-6/+2
| | | | | | | | | | Remove local definition of RADEON_INFO_TILE_CONFIG and use the correct macro provided by libdrm_radeon RADEON_INFO_TILING_CONFIG. Latter was present as of libdrm 2.4.22, sirca 2010. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* winsys/radeon: remove fall-back definesEmil Velikov2017-02-163-47/+0
| | | | | | | Provided by libdrm as of last commit. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* nir: handle some 64-bit integer conversionsDave Airlie2017-02-161-7/+19
| | | | | | | | These are enough for the spir-v generator to handle UConvert and SConvert operations, and fix the 4 tests in CTS. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* nir: handle 64-bit integer types in glsl->nir type conversion.Dave Airlie2017-02-161-0/+6
| | | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* spirv: handle SpvOpUConvert in proper place.Dave Airlie2017-02-161-1/+1
| | | | | | | | This was falling into the quantizetof16 path. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* spirv: add support for Int64 capabilityDave Airlie2017-02-162-1/+4
| | | | | | | | This just adds the support at the spirv->nir level for the Int64 cap. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* spirv/nir: add support for int64Dave Airlie2017-02-162-2/+32
| | | | | | | This adds the spirv->nir conversion for int64 types. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* nir/types: add C accessors for 64-bit integer types.Dave Airlie2017-02-162-0/+14
| | | | | Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* radv: add fast color clear for b10g11r11Dave Airlie2017-02-161-0/+5
| | | | | | | This is used in DOOM, so provide the fast clear path for it. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: retain gl_shader_programs after glDeleteProgram if they are in useTimothy Arceri2017-02-165-9/+17
| | | | | | | | | | | | | | Fixes regressions from c505d6d852220f4aaaee161465dd2c579647e672. Switching from using gl_shader_program to gl_program for the pipline objects CurrentProgram array meant we were freeing gl_shader_programs immediately after glDeleteProgram was called, but the spec states the program should only get deleted once it is no longer in use. To work around this we add a new ReferencedPrograms array to track gl_shader_programs in use. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove tabs in dri xmlconfig.cTimothy Arceri2017-02-161-362/+362
| | | | Acked-by: Nicolai Hähnle <[email protected]>
* mesa: style fixes for dri xmlconfig.cTimothy Arceri2017-02-161-37/+94
| | | | Acked-by: Nicolai Hähnle <[email protected]>
* i965: Do not use purged bo after calling glObjectUnpurgeableChris Wilson2017-02-151-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | If the buffer has been freed by the kernel under memory pressure, it is invalid to try and access the backing storage for that buffer in the future - the backing storage is not recreated automatically. As such we need to mark the GL object as being freed for unretained buffers and so recreate the object on next use. Futhermore from the GL_APPLE_object_purgeable: "In contrast, by calling ObjectUnpurgeableAPPLE with an <option> of UNDEFINED_APPLE, the application is indicating that it intends to recreate the contents of the storage from scratch. Further, the application is is stating that it would like the GL to do only the minimal amount of work set PURGEABLE_APPLE to FALSE. If ObjectUnpurgeableAPPLE is called with the <option> set to UNDEFINED_APPLE, then ObjectUnpurgeableAPPLE will return the value UNDEFINED_APPLE." we must always report GL_UNDEFINED_APPLE when called with glObjectUnpurgeable(GL_UNDEFINED_APPLE). Testcase: piglit/object_purgeable-api-* Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "i915: Always enable GL 2.0 support."Matt Turner2017-02-152-4/+25
| | | | | | | | | | This partially reverts commit 97217a40f97cdeae0304798b607f704deb0c3558. It leaves ES 2.0 support in place per Ian's suggestion, because ES 2.0 is designed to work on hardware like i915. Chrome only uses the GPU if you have GL >= 2.0, and using i915 (and prog_execute) actually hurt performance compared with the software paths.
* anv: Use build-id for pipeline cache UUID.Matt Turner2017-02-152-21/+8
| | | | | | | | The --build-id=... ld flag has been present since binutils-2.18, released 28 Aug 2007. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* util: Add utility build-id code.Matt Turner2017-02-153-0/+149
| | | | | | | | Provides the ability to read the .note.gnu.build-id section of ELF binaries, which is inserted by the --build-id=... flag to ld. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* radv: Add support for shaderStorageImageReadWithoutFormat.Bas Nieuwenhuizen2017-02-152-1/+2
| | | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* spirv: Add support for SpvCapabilityStorageImageReadWithoutFormat.Bas Nieuwenhuizen2017-02-152-1/+5
| | | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Add support for shaderStorageImageWriteWithoutFormat.Bas Nieuwenhuizen2017-02-152-2/+3
| | | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* getteximage: Return correct error value when texure object is not foundEduardo Lima Mitev2017-02-151-2/+4
| | | | | | | | | | | | | | | | | | | | | glGetTextureSubImage() and glGetCompressedTextureSubImage() are currently returning INVALID_OPERATION error when the passed texture argument does not correspond to an existing texture object. However, the error should be INVALID_VALUE instead. From OpenGL 4.5 spec PDF, section '8.11. Texture Queries', page 236: "An INVALID_VALUE error is generated if texture is not the name of an existing texture object." Same wording applies to the compressed version. The INVALID_OPERATION error is coming from the call to _mesa_lookup_texture_err(). This patch uses _mesa_lookup_texture() instead and emits the correct error in the caller. Fixes: GL45-CTS.get_texture_sub_image.errors_test Reviewed-by: Nicolai Hähnle <[email protected]>
* util: Fix a typo in Makefile.sourcesJason Ekstrand2017-02-151-1/+1
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* i965: define default allow_higher_compat_version valueLionel Landwerlin2017-02-151-0/+1
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Matt Turner <[email protected]> Fixes: 9d16f3903e2 ("driconf: add allow_higher_compat_version option")
* drirc: add allow_higher_compat_version for Tropico 5Samuel Pitoiset2017-02-151-0/+4
| | | | | | | | | v2: s/force_compat_profile/allow_higher_compat_version Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>