summaryrefslogtreecommitdiffstats
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* glsl/tests/warnings-test: print only the test basenameEmil Velikov2017-03-281-1/+1
| | | | | | | | | Spamming the log with the (in some cases extremely long) test location is of limited use. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* glsl/tests/warnings-test: error if zero tests were executedEmil Velikov2017-03-281-0/+5
| | | | | | | | | We don't want to lie ourselves that 'everything is fine' when no tests were found/ran. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* glsl/tests/warnings-test: correctly manage srcdir/builddirEmil Velikov2017-03-281-4/+8
| | | | | | | | | Before this commit, we would effectively fail to run any of the test in a OOT builds. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* glsl/tests/warnings-test: add fallback srcdir/abs_builddir definesEmil Velikov2017-03-281-1/+14
| | | | | | | | | There is no robust way to detect either one, so simply hope for the best and warn just in case. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* glsl/tests/warnings-test: error out if glsl_compiler is missingEmil Velikov2017-03-281-0/+5
| | | | | | | | | | ... or non-executable, in particular. v2: use test -x (Eric) Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Eric Engestrom <[email protected]>
* glsl: automake: export abs_builddir for the testsEmil Velikov2017-03-281-0/+1
| | | | | | | | | We're going to use them with the next commits to determine where to put the generated tests and/or built binaries. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* glsl/tests: automake: cleanup all artefacts during clean-localEmil Velikov2017-03-281-0/+6
| | | | | | | | | | | | | With later commits we'll fix the generators to produce the files in the correct location. That in itself will cause an issue since the files will be left dangling and make distcheck will fail. v2: Use -r only as needed (Eric) Cc: Matt Turner <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Acked-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Eric Engestrom <[email protected]>
* glsl: fix spelling of embedded in commentTimothy Arceri2017-03-281-1/+1
|
* glsl: fix lower jumps for returns when loop is inside an ifTimothy Arceri2017-03-281-5/+12
| | | | | | | | | | | | | | | | | Previously we would just escape the loop and move everything following the loop inside the if to the else branch of a new if with a return flag conditional. However everything outside the if the loop was nested in would still get executed. Adding a new return to the then branch of the new if fixes this and we just let a follow pass clean it up if needed. Fixes: tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test Cc: "13.0 17.0" <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* glsl: Interface Block instances don't need linking validationAndres Gomez2017-03-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From page 45 (page 52 of the PDF) of the GLSL ES 3.00 v.6 spec: " When instance names are present on matched block names, it is allowed for the instance names to differ; they need not match for the blocks to match. From page 51 (page 57 of the PDF) of the GLSL 4.30 v.8 spec: " When instance names are present on matched block names, it is allowed for the instance names to differ; they need not match for the blocks to match." Therefore, no cross linking validation is needed for the instance name of an Interface Block. This patch will make that no link error will be reported on a program like this: "# VS layout(binding = 1) Block1 { vec4 color; } uni_block; ... # FS layout(binding = 2) Block2 { vec4 color; } uni_block; ..." Fixes GL45-CTS.enhanced_layouts.ssb_layout_qualifier_conflict Signed-off-by: Andres Gomez <[email protected]> Cc: Timothy Arceri <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: UBOs and SSBOs must match the binding qualifier tooAndres Gomez2017-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From page 140 (page 147 of the PDF) of the GLSL ES 3.10 v.4 spec: " 9.2 Matching of Qualifiers The following tables summarize the requirements for matching of qualifiers. It applies whenever there are two or more matching variables in a shader interface. Notes: 1. Yes means the qualifiers must match. ... 9.2.1 Linked Shaders | Qualifier | Qualifier | in/out | Default | uniform | buffer| | Class | | | Uniforms | Block | Block | ... | Layout | binding | N/A | Yes | Yes | Yes |" From page 93 (page 110 of the PDF) of the GL 4.2 (Core Profile) spec: " 2.11.7 Uniform Variables ... Uniform Blocks ... When a named uniform block is declared by multiple shaders in a program, it must be declared identically in each shader. The uniforms within the block must be declared with the same names and types, and in the same order. If a program contains multiple shaders with different declarations for the same named uniform block differs between shader, the program will fail to link." From page 129 (page 150 of the PDF) of the GL 4.3 (Core Profile) spec: " 7.8 Shader Buffer Variables and Shader Storage Blocks ... When a named shader storage block is declared by multiple shaders in a program, it must be declared identically in each shader. The buffer variables within the block must be declared with the same names, types, qualification, and declaration order. If a program contains multiple shaders with different declarations for the same named shader storage block, the program will fail to link." Therefore, if the binding qualifier differs between two linked Uniform or Shader Storage Blocks of the same name, a link error should happen. This patch will make that a link error will be reported on a program like this: "# VS layout(binding = 1) Block { vec4 color; } uni_block1; ... # FS layout(binding = 2) Block { vec4 color; } uni_block2; ..." Signed-off-by: Andres Gomez <[email protected]> Cc: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: on UBO/SSBOs link error reset the number of active blocks to 0Andres Gomez2017-03-271-0/+6
| | | | | | | | | | | | | While it's legal to have an active blocks count > 0 on link failure. Unless we actually assign memory for the blocks array we can end up segfaulting in calls such as glUniformBlockBinding(). To avoid having to NULL check these api calls we simply reset the block count to 0 if the array was not created. Signed-off-by: Andres Gomez <[email protected]> Cc: Timothy Arceri <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl, st/shader_cache: check the whole sha1 for zeroGrazvydas Ignotas2017-03-271-1/+2
| | | | | | | | | | | | The checks were only looking at the first byte, while the intention seems to be to check if the whole sha1 is zero. This prevented all shaders with first byte zero in their sha1 from being saved. This shaves around a second from Deus Ex load time on a hot cache. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl/shader_cache: restore evicted shader keysGrazvydas Ignotas2017-03-271-0/+17
| | | | | | | | | | | | | | | | | Even though the programs themselves stay in cache and are loaded, the shader keys can be evicted separately. If that happens, unnecessary compiles are caused that waste time, and no matter how many times the program is re-run, performance never recovers to the levels of first hot cache run. To deal with this, we need to refresh the shader keys of shaders that were recompiled. An easy way to currently observe this is running Deux Ex, then piglit and Deux Ex again, or deleting just the cache index. The later is causing over a minute of lost time on all later Deux Ex runs, with this patch it returns to normal after 1 run. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: Link tests with CLOCK_LIB.Vinson Lee2017-03-251-3/+6
| | | | | | | | | | Fix 'make check' linking errors with glibc < 2.17. CXXLD glsl/glsl_test glsl/.libs/libglsl.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano': src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime' Signed-off-by: Vinson Lee <[email protected]>
* tests/cache_test: mark arguments constGrazvydas Ignotas2017-03-251-4/+4
| | | | | | | | While at it, also fix up a failure message to not reference timestamp and gpu dirs as those are no longer being made. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* nir/lower_wpos_center: support adding sample position to fragment coordinateIago Toral Quiroga2017-03-242-8/+25
| | | | | | | | | | | | | According to section 14.6 of the Vulkan specification: "When sample shading is enabled, the x and y components of FragCoord reflect the location of the sample corresponding to the shader invocation." So add a boolean parameter to the lowering pass to select this behavior when we need it. Reviewed-by: Jason Ekstrand <[email protected]>
* util/disk_cache: hash pointer size and gpu name into cache keysGrazvydas Ignotas2017-03-241-11/+2
| | | | | | | | | | | | | | | | This allows to get rid of the arch and gpu name directories. v2: (Timothy Arceri) don't use an opaque data type to store pointer size and gpu name. v3: (Timothy Arceri) use blob to store driver keys just make sure to store null terminator for strings, and make sure blob is defined by disk_cache and not it's users. v4: (Timothy Arceri) fix typo, and make ptr_size a uint8_t. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* util/disk_cache: hash timestamps into the cache keysGrazvydas Ignotas2017-03-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | Instead of using a directory, hash the timestamps into the cache keys themselves. Since there is no more timestamp directory, there is no more need for deleting the cache of other mesa versions and we rely on eviction to clean up the old cache entries. This solves the problem of using several incarnations of disk_cache at the same time, where one deletes a directory belonging to the other, like when both OpenGL and gallium nine are used simultaneously (or several different mesa installations). v2: using additional blob instead of trying to clone sha1 state v3: (Timothy Arceri) don't use an opaque data type to store timestamp. V4: (Timothy Arceri) use blob to store driver keys just make sure to store null terminator for strings, and make sure blob is defined by disk_cache and not it's users. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100091
* nir: Return progress from nir_convert_from_ssa().Matt Turner2017-03-232-8/+15
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_io().Matt Turner2017-03-232-6/+15
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_regs_to_ssa().Matt Turner2017-03-232-6/+10
| | | | | | And from nir_lower_regs_to_ssa_impl() as well. Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_samplers().Matt Turner2017-03-232-12/+19
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_atomics().Matt Turner2017-03-232-7/+13
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_clamp_color_outputs().Matt Turner2017-03-232-10/+22
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_clip_fs().Matt Turner2017-03-232-3/+7
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_clip_vs().Matt Turner2017-03-232-5/+7
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_move_vec_src_uses_to_dest().Matt Turner2017-03-232-6/+18
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_to_source_mods().Matt Turner2017-03-232-6/+29
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_clip_cull_distance_arrays().Matt Turner2017-03-232-5/+21
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_var_copies().Matt Turner2017-03-232-4/+16
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_load_const_to_scalar().Matt Turner2017-03-232-7/+21
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_64bit_pack().Matt Turner2017-03-232-4/+14
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_doubles().Matt Turner2017-03-232-22/+42
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Return progress from nir_lower_vars_to_ssa().Matt Turner2017-03-232-3/+7
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Fix syntax.Matt Turner2017-03-232-6/+6
| | | | | | | et is not an abbreviation. Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Fix misspellings.Matt Turner2017-03-234-7/+7
| | | | | Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Stop using apostrophes to pluralize.Matt Turner2017-03-2321-43/+43
| | | | | Reviewed-by: Dylan Baker <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: Link glsl_compiler with CLOCK_LIB.Vinson Lee2017-03-221-1/+2
| | | | | | | | | | | Fix linking error on CentOS 6. CXXLD glsl_compiler glsl/.libs/libstandalone.a(lt16-libmesautil_la-u_queue.o): In function `u_thread_get_time_nano': src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime' Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* glsl: lower sqrt(abs()) and inversesqrt(abs()) if requestedSamuel Pitoiset2017-03-222-0/+15
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Android: clean-up trailing '\' in make variablesRob Herring2017-03-222-3/+3
| | | | | | | | | Fixed with the following command: perl -pe 'BEGIN{undef $/;} s/ \\\n\n/\n\n/smg' $(find . -name 'Android.*') Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* spirv: consistently use ifndef guards over pragma onceEmil Velikov2017-03-223-2/+10
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* nir: consistently use ifndef guards over pragma onceEmil Velikov2017-03-2210-11/+38
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl: consistently use ifndef guards over pragma onceEmil Velikov2017-03-2231-23/+48
| | | | | | | | | | | | | | | | | Through the glsl headers we had an odd mix of guards be that "ifndef", "pragma once" neither or both. Simplify things by using the more common ones (ifndef) and annotating all the sources, barring the generated builting header - builtin_int64.h. The final header - udivmod64.h - is [seemingly] unused and on its way out (patch purge it is on the mailing list). Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* compiler: consistently use ifndef guards over pragma onceEmil Velikov2017-03-222-2/+4
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* nir: Add positional argument specifiers.Vinson Lee2017-03-212-2/+2
| | | | | | | | | | | | | Fix build with Python < 2.7. File "src/compiler/nir/nir_builder_opcodes_h.py", line 46, in <module> from nir_opcodes import opcodes File "src/compiler/nir/nir_opcodes.py", line 178, in <module> unop_convert("{}2{}{}".format(src_t[0], dst_t[0], bit_size), ValueError: zero length field name in format Fixes: 762a6333f21f ("nir: Rework conversion opcodes") Signed-off-by: Vinson Lee <[email protected]>
* tests/cache_test: use the blob key's actual first byteGrazvydas Ignotas2017-03-211-6/+2
| | | | | | | | | There is no need to hardcode it, we can just use blob_key[0]. This is needed because the next patches are going to change how cache keys are computed. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* util/disk_cache: use a helper to compute cache keysGrazvydas Ignotas2017-03-213-17/+20
| | | | | | | | | | This will allow to hash additional data into the cache keys or even change the hashing algorithm easily, should we decide to do so. v2: don't try to compute key (and crash) if cache is disabled Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* spirv: Implement IsInf using an integer comparisonJason Ekstrand2017-03-201-1/+1
| | | | | | | | | | | Since we already do fabs on the one source, we're guaranteed to get positive infinity if we get any infinity at all. Since +inf only has one IEEE 754 representation, we can use an integer comparison and avoid all of the ordered/unordered issues. Cc: Dave Airlie <[email protected]> Reviewed-by: Elie Tournier <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* glsl: use set for copy propagation killsTimothy Arceri2017-03-181-37/+28
| | | | | | | | | | | | | | | | | Previously each time we saw a variable we just created a duplicate entry in the list. This is particularly bad for loops were we add everything twice, and then throw nested loops into the mix and the list was growing expoentially. This stops the glsl-vs-unroll-explosion test which has 16 nested loops from reaching the tests mem usage limit in this pass. The test now hits the mem limit in opt_copy_propagation_elements() instead. I suspect this was also part of the reason this pass can be so slow with some shaders. Reviewed-by: Thomas Helland <[email protected]>