summaryrefslogtreecommitdiffstats
path: root/src/compiler/Makefile.sources
Commit message (Collapse)AuthorAgeFilesLines
* util: import cache.c/h from glslMarek Olšák2016-11-151-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 <[email protected]>
* glsl: automake: add opt_add_neg_to_sub.h to the sources listEmil Velikov2016-11-111-0/+1
| | | | | | Otherwise it'll be missing in the release tarball. Signed-off-by: Emil Velikov <[email protected]>
* glsl: Add a C++ code generator that uses ir_builder to rebuild a programIan Romanick2016-11-101-0/+2
| | | | | | | | | | | | | This is only in libstandalone currently because it will only be used in the stand-alone compiler. v2: Change the signature of the generated function. The ir_factory is created in the generator, and an availability predicate is taken as a parameter. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* nir: add conditional discard optimisation (v4)Dave Airlie2016-11-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This is ported from GLSL and converts if (cond) discard; into discard_if(cond); This removes a block, but also is needed by radv to workaround a bug in the LLVM backend. v2: handle if (a) discard_if(b) (nha) cleanup and drop pointless loop (Matt) make sure there are no dependent phis (Eric) v3: make sure only one instruction in the then block. v4: remove sneaky tabs, add cursor init (Eric) Reviewed-by: Eric Anholt <[email protected]> Cc: "13.0" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* compiler: automake: add shader_info.h to the sources listEmil Velikov2016-10-261-1/+2
| | | | | | | Otherwise it'll be missing from the tarball. Fixes: 094fe3a9591 ("nir: move nir_shader_info to a common compiler header") Signed-off-by: Emil Velikov <[email protected]>
* compiler: remove copy_shader_info()Timothy Arceri2016-10-261-3/+1
| | | | | | | This temporary helper is no longer needed now that we have finished refactoring common shader metadata. Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: add temporary copy_shader_info() functionTimothy Arceri2016-10-261-1/+3
| | | | | | | | | | | | | This function is added here to ease refactoring towards using the new shared shader_info. Once refactoring is complete and values are set directly it will be removed. We call it from _mesa_copy_linked_program_data() rather than glsl_to_nir() so that the values will be set for all drivers. In order to do this some calls need to be moved around so that we make sure to call do_set_program_inouts() before _mesa_copy_linked_program_data() Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: Remove unused function import_prototypesIan Romanick2016-10-171-1/+0
| | | | | | | | | | Once upon a time, this was used to extract prototypes from the shader containing GLSL built-in functions. This was removed by f5692f45 in November 2010 for Mesa 7.10. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* glsl: Add initial functions to implement an on-disk cacheTimothy Arceri2016-09-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> 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 <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glsl: Use the generated constant expression codeIan Romanick2016-08-301-0/+1
| | | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Generate ir_expression_operation_strings.h from PythonIan Romanick2016-08-301-1/+1
| | | | | | | | | | | | 'diff -ud' is clean. v2: Massive rebase. v3: With much help from José Fonseca, fix the SCons build. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Pull operator_strs out to its own fileIan Romanick2016-08-301-0/+1
| | | | | | | | | | No change except to the copyright symbol. The next patch will generate this file with Python, and Unicode + Python = pure rage. v2: Massive rebase. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Generate ir_expression_operation.h from PythonIan Romanick2016-08-301-1/+1
| | | | | | | | | | | | | 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 <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Add a lowering pass to handle advanced blending modes.Kenneth Graunke2016-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many GPUs cannot handle GL_KHR_blend_equation_advanced natively, and need to emulate it in the pixel shader. This lowering pass implements all the necessary math for advanced blending. It fetches the existing framebuffer value using the MESA_shader_framebuffer_fetch built-in variables, and the previous commit's state var uniform to select which equation to use. This is done at the GLSL IR level to make it easy for all drivers to implement the GL_KHR_blend_equation_advanced extension and share code. Drivers need to hook up MESA_shader_framebuffer_fetch functionality: 1. Hook up the fb_fetch_output variable 2. Implement BlendBarrier() Then to get KHR_blend_equation_advanced, they simply need to: 3. Disable hardware blending based on ctx->Color._AdvancedBlendEnabled 4. Call this lowering pass. Very little driver specific code should be required. v2: Handle multiple output variables per render target (which may exist due to ARB_enhanced_layouts), and array variables (even with one render target, we might have out vec4 color[1]), and non-vec4 variables (it's easier than finding spec text to justify not handling it). Thanks to Francisco Jerez for the feedback. v3: Lower main returns so that we have a single exit point where we can add our blending epilogue (caught by Francisco Jerez). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* nir: Add an IO scalarizing pass using the intrinsic's first_component.Eric Anholt2016-08-191-0/+1
| | | | | | | | | | vc4 wants to have per-scalar IO load/stores so that dead code elimination can happen on a more granular basis, which it has been doing in the backend using a multiplication by 4 of the intrinsic's driver_location. We can represent it properly in the NIR using the first_component field, though. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Pull enum ir_expression_operation out to its own fileIan Romanick2016-08-171-0/+1
| | | | | | | | | | No change except to the copyright symbol. The next patch will generate this file with Python, and Unicode + Python = pure rage. v2: Massive rebase... I guess a lot can change in a year. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Make the generated sources build rules more like NIRIan Romanick2016-08-171-2/+3
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* nir: Add a pass for propagating invariant decorationsJason Ekstrand2016-06-201-0/+1
| | | | | | | | | | This pass is similar to propagate_invariance in the GLSL compiler. The real "output" of this pass is that any algebraic operations which are eventually consumed by an invariant variable get marked as "exact". Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Add string lookup tables for a couple of SPIR-V enumsJason Ekstrand2016-06-031-0/+2
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir: automake: add nir_search_helpers.h to the sources list(s)Emil Velikov2016-06-041-0/+1
| | | | | | Fixes: dfbae7d64f4 ("nir/algebraic: support for power-of-two optimizations") Signed-off-by: Emil Velikov <[email protected]>
* compiler: Move glsl_to_nir to libglsl.laJason Ekstrand2016-05-261-2/+2
| | | | | | | | Right now libglsl.la depends on libnir.la so putting it in libnir.la adds a dependency on libglsl.la that goes the wrong direction. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* glsl: split out libstandaloneRob Clark2016-05-251-1/+2
| | | | | | | | | 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 <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nir: Add a simple nir_lower_wpos_center() pass for Vulkan drivers.Kenneth Graunke2016-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | nir_lower_wpos_ytransform() is great for OpenGL, which allows applications to choose whether their coordinate system's origin is upper left/lower left, and whether the pixel center should be on integer/half-integer boundaries. Vulkan, however, has much simpler requirements: the pixel center is always half-integer, and the origin is always upper left. No coordinate transform is needed - we just need to add <0.5, 0.5>. This means that we can avoid using (and setting up) a uniform. I thought about adding more options to nir_lower_wpos_ytransform(), but making a new pass that never even touched uniforms seemed simpler. v2: Use normal iterator rather than _safe variant (noticed by Matt). Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Rob Clark <[email protected]>
* glsl: rename lower_clip_distance to lower_distance.Dave Airlie2016-05-141-1/+1
| | | | | | | | | | This just renames the file in anticipation of adding cull lowering, and renames the internals. Signed-off-by: Tobias Klausmann <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* nir: rename lower_outputs_to_temporaries -> lower_io_to_temporariesRob Clark2016-05-111-1/+1
| | | | | | Since it will gain support to lower inputs, give it a more generic name. Signed-off-by: Rob Clark <[email protected]>
* nir: lower-io-types passRob Clark2016-05-111-0/+1
| | | | | | | | | | | | | | | | | A pass to lower complex (struct/array/mat) inputs/outputs to primitive types. This allows, for example, linking that removes unused components of a larger type which is not indirectly accessed. In the near term, it is needed for gallium (mesa/st) support for NIR, since only used components of a type are assigned VBO slots, and we otherwise have no way to represent that to the driver backend. But it should be useful for doing shader linking in NIR. v2: use glsl_count_attribute_slots() rather than passing a type_size fxn pointer Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir: passthrough-edgeflags supportRob Clark2016-05-111-0/+1
| | | | | | | | Handled by tgsi_emulate for glsl->tgsi case. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nir: add lowering pass for glBitmapRob Clark2016-05-111-0/+1
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nir: add lowering pass for glDrawPixelsRob Clark2016-05-111-0/+1
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nir: add lowering pass for y-transformRob Clark2016-05-111-0/+1
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* spirv: automake: add missing headers to the tarball.Emil Velikov2016-05-011-0/+2
| | | | Signed-off-by: Emil Velikov <[email protected]>
* nir: clamp-color-output supportRob Clark2016-04-301-0/+1
| | | | | | | Handled by tgsi_emulate for glsl->tgsi case. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* nir: add a pass to lower some double operationsConnor Abbott2016-04-281-0/+1
| | | | | | | | | | | | v2: Move to compiler/nir (Iago) v3: Use nir_imm_int() to load the constants (Sam) v4 (Sam): - Undo line-wrap (Jason). - Fix comment (Jason). - Improve generated code for get_signed_inf() function (Connor). Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* spirv: Move to compiler/Jason Ekstrand2016-04-141-7/+7
| | | | | | While it does rely on NIR, it's not really part of the NIR core. At the moment, it still builds as part of libnir but that can be changed later if desired.
* Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-04-131-0/+1
|\
| * nir: add a pass for lowering (un)pack_double_2x32Connor Abbott2016-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: Undo unintended change to the signature of nir_normalize_cubemap_coords (Iago). v3: Move to compiler/nir (Iago) v4: Remove Authors from copyright header (Michael Schellenberger) v5 (Sam): - Use nir_channel() and nir_ssa_for_alu_src() helpers (Jason) - Inline lower_double_pack_instr() code into lower_double_pack_block() (Jason). - Initialize nir_builder at lower_double_pack_impl() (Jason). Signed-off-by: Iago Toral Quiroga <[email protected]> Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: Add a pass for gathering various bits of shader infoJason Ekstrand2016-04-101-0/+1
| | | | | | | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* | Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-04-011-2/+2
|\|
| * nir/Makefile: Fix alphabetizationJason Ekstrand2016-03-281-3/+3
| | | | | | | | Reviewed-by: Rob Clark <[email protected]>
* | Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-03-241-0/+1
|\|
| * nir: Add a pass to inline functionsJason Ekstrand2016-03-241-0/+1
| | | | | | | | | | | | | | This commit adds a new NIR pass that lowers all function calls away by inlining the functions. Reviewed-by: Jordan Justen <[email protected]>
| * nir: Add return lowering passJason Ekstrand2016-03-241-0/+1
| | | | | | | | | | | | | | | | This commit adds a NIR pass for lowering away returns in functions. If the return is in a loop, it is lowered to a break. If it is not in a loop, it's lowered away by moving/deleting code as needed. Reviewed-by: Jordan Justen <[email protected]>
| * nir: Add a pass to repair SSA formJason Ekstrand2016-03-241-0/+1
| | | | | | | | Reviewed-by: Jordan Justen <[email protected]>
| * nir: Add a phi node placement helperJason Ekstrand2016-03-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | Right now, we have phi placement code in two places and there are other places where it would be nice to be able to do this analysis. Instead of repeating it all over the place, this commit adds a helper for placing all of the needed phi nodes for a value. v2: Add better documentation Reviewed-by: Jordan Justen <[email protected]>
| * glsl: Add a pass to propagate the "invariant" and "precise" qualifiersJason Ekstrand2016-03-231-0/+1
| | | | | | | | Reviewed-by: Francisco Jerez <[email protected]>
* | Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-03-151-1/+1
|\|
| * nir: Add a pass for lower indirect variable dereferencesJason Ekstrand2016-03-081-0/+1
| | | | | | | | | | | | | | | | This new pass lowers load/store_var intrinsics that act on indirect derefs to if-ladder of direct load/store_var intrinsics. The if-ladders perform a simple binary search on the indirect. Reviewed-by: Connor Abbott <[email protected]>
* | Merge commit mesa-public/master into vulkanJason Ekstrand2016-02-051-0/+16
|/ | | | This pulls in the patches that move all of the compiler stuff around
* glsl: move to compiler/Emil Velikov2016-01-261-0/+147
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>
* nir: move to compiler/Emil Velikov2016-01-261-0/+71
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>