summaryrefslogtreecommitdiff
path: root/src/compiler/Makefile.glsl.am
AgeCommit message (Collapse)AuthorFilesLines
2019-01-29automake: Add float64.glsl to dist tarballDylan Baker1-0/+1
Fixes: b63a1f8e40b6705d6a1d806fbd38dcd197d4229b ("glsl: Create file to contain software fp64 functions") Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2019-01-09glsl: Create file to contain software fp64 functionsMatt Turner1-0/+6
The following patches will add implementations of various double-precision operations to this file. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2019-01-09glsl: Add utility to convert text files to C stringsIan Romanick1-0/+1
Will be used to convert the .glsl source file containing software fp64 routines to a .h file that can be included while building the compiler. This commit contains two squashed together: the first from Ian adding the utility (with the existing title), and the second from Dylan making the code both python2 and python3 compatible. This is somewhat modeled after the xxd utility that comes with Vim. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> xxd.py: Make python2 and 3 compatible This makes use of unicode_literals, so that undecorated strings are considered text (python2 unicode, python3 str) and not bytes in python2 and text in python3. It makes use of io.open, which provides python2 with python3's open behavior (it's an alias in python3), in particular support for the 't' and 'b' option. Finally, it decorates all of the string literals with the 'b' prefix, so that python interprets them as bytes. I've removed the stdin and stdout options, as python2 always requires these to be bytes, but python3 always treats them as text (there is a way to get at the underlying bytes buffer, but that's even more complexity), and makes the input files required arguments. In the meson we use the '@INPUT@' shorthand instead of listing each input, as meson will expand that to [prog_python, '@INPUT0@', @INPUT1@, ..., @OUTPUT@, ...]
2018-10-31configure: allow building with python3Emil Velikov1-1/+1
Pretty much all of the scripts are python2+3 compatible. Check and allow using python3, while adjusting the PYTHON2 refs. Note: - python3.4 is used as it's the earliest supported version - python2 chosen prior to python3 v2: use python2 by default Cc: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-08-24Revert "configure: allow building with python3"Emil Velikov1-1/+1
This reverts commit ae7898dfdbe5c8dab7d11c71862353f1ae43feb0. Turns out the python scripts are _not_ fully python 3 compatible. As Ilia reported using get_xmlpool.py with LANG=C produces some weird output - see the link for details. Even though the issue was spotted with the autoconf build, it exposes a genuine problem with the script (and lack of lang handling of the meson build.) https://lists.freedesktop.org/archives/mesa-dev/2018-August/203508.html
2018-08-23configure: allow building with python3Emil Velikov1-1/+1
Pretty much all of the scripts are python2+3 compatible. Check and allow using python3, while adjusting the PYTHON2 refs. Note: - python3.4 is used as it's the earliest supported version - python3 chosen prior to python2 Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-06-21glsl: fold glcpp-test-cr-lf.sh into glcpp-test.shEmil Velikov1-1/+0
As of recently both of these have been reworked so they invoke a python script. At the same time the latter can be executed with the combined arguments of both scripts. AKA we no longer need to have them separate. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-03-29compiler: All leaf Makefile.am should use +=Ian Romanick1-1/+1
This slightly simplifies later changes that add more Makefile.*.am files. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2017-03-28glsl: automake: export abs_builddir for the testsEmil Velikov1-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 <emil.velikov@collabora.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-28glsl/tests: automake: cleanup all artefacts during clean-localEmil Velikov1-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 <mattst88@gmail.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1) Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-25glsl: Link tests with CLOCK_LIB.Vinson Lee1-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 <vlee@freedesktop.org>
2017-03-22glsl: Link glsl_compiler with CLOCK_LIB.Vinson Lee1-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 <vlee@freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-03-10glsl/tests: suffix .sh/.py files as applicableEmil Velikov1-4/+4
This makes it easier/clearer as to: - if the file should have the execute bit set (.py should not) - do we need the shebang in the first place and if so what it should be Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-02-17glsl: add initial implementation of shader cacheTimothy Arceri1-1/+2
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 <nicolai.haehnle@amd.com>
2017-01-20glsl: Add a lowering pass for 64-bit integer multiplicationIan Romanick1-0/+1
v2: Rename lower_64bit.cpp and lower_64bit_test.cpp to lower_int64. Suggested by Matt. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-12-19glsl: Add tracking for elements of an array-of-arrays that have been accessedIan Romanick1-0/+1
If there's a better way to provide access to ir_array_refcount_entry private members to the test functions, I am very interested to know about it. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Cc: Francisco Jerez <currojerez@riseup.net> Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-11-15util: import cache.c/h from glslMarek Olšák1-4/+0
It's not dependent on GLSL and it can be useful for shader caches that don't deal with GLSL. v2: address review comments v3: keep the other 3 lines in configure.ac Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-10glsl/standalone: Optimize add-of-neg to subtractIan Romanick1-0/+1
This just makes the output of the standalone compiler a little more compact. v2: Fix indexing typo noticed by Iago. Move the add_neg_to_sub_visitor to it's own header file. Add a unit test that exercises the visitor. Both the neg_a_plus_b and neg_a_plus_neg_b tests reproduced the bug that Iago discovered. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-27glsl: Add pthread libs to cache_testRhys Kidd1-1/+4
Fixes the following compile error, present when the SHA1 library is libgcrypt: CCLD glsl/tests/cache-test glsl/.libs/libglsl.a(libmesautil_la-mesa-sha1.o): In function `call_once': /mesa/src/util/../../include/c11/threads_posix.h:96: undefined reference to `pthread_once' Signed-off-by: Rhys Kidd <rhyskidd@gmail.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-26compiler: avoid warning about redefinition of PYTHON_GENErik Faye-Lund1-1/+0
PYTHON_GEN is defined to the exact same thing in both Makefile.glsl.am and Makefile.nir.am. This makes automake complain, so let's lift the definition up to Makefile.am, the same way as MKDIR_GEN. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Tested-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-09-28glsl: Add initial functions to implement an on-disk cacheTimothy Arceri1-0/+10
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 following priority order: $MESA_GLSL_CACHE_DIR $XDG_CACHE_HOME/mesa <user-home-directory>/.cache/mesa By default the cache will be limited to a maximum size of 1GB. The environment variable: $MESA_GLSL_CACHE_MAX_SIZE can be set (at the time of GL context creation) to choose some other size. This variable is a number that can optionally be followed by 'K', 'M', or 'G' to select a size in kilobytes, megabytes, or gigabytes. By default, an unadorned value will be interpreted as gigabytes. The cache will be entirely disabled at runtime if the variable MESA_GLSL_CACHE_DISABLE is set at the time of GL context creation. Many thanks to Kristian Høgsberg <krh@bitplanet.net> for the initial implementation of code that led to this patch. In particular, the idea of using an mmapped file, (indexed by a portion of the SHA-1), for the efficent implementation of cache_has_key was entirely his idea. Kristian also provided some very helpful advice in discussions regarding various race conditions to be avoided in this code. Signed-off-by: Timothy Arceri <timothy.arceri@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-30glsl: Use the generated constant expression codeIan Romanick1-0/+6
Immediately previous to this patch, diff -wud src/glsl/ir_constant_expression.cpp \ src/glsl/ir_expression_operation_constant.h should be "minimal." v3: With much help from José Fonseca, fix the SCons build. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-08-30glsl: Generate ir_expression_operation_strings.h from PythonIan Romanick1-1/+7
'diff -ud' is clean. v2: Massive rebase. v3: With much help from José Fonseca, fix the SCons build. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Acked-by: Dylan Baker <dylan@pnwbakers.com>
2016-08-30glsl: Generate ir_expression_operation.h from PythonIan Romanick1-0/+8
There are differences in where end-of-line comments are placed, but 'diff -wud' is clean. v2: Massive rebase. v3: With much help from José Fonseca, fix SCons build. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Acked-by: Dylan Baker <dylan@pnwbakers.com>
2016-08-17glsl: Make the generated sources build rules more like NIRIan Romanick1-3/+1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-26glsl: add warning-testAlejandro Piñeiro1-1/+2
It executes compiler-glsl on all the available shaders, and it checks that the outcome is the expected. Bash code based on the already existing optimization-test v2: rebasing: use --version option Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-05-25glsl: split out libstandaloneRob Clark1-5/+11
Split standalone glsl_compiler into a libstandalone.la and a thin main.cpp. This way drivers can re-use the glsl standalone frontend in their own standalone compilers. Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-04-11compiler: automake: split out glsl into separate makefileEmil Velikov1-0/+217
Preserve the functionality while keeping the files smaller and more readable. v2: Do not include Makefile.sources from the GLSL makefile (silences automake warnings) Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net> (v1)