summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
Commit message (Collapse)AuthorAgeFilesLines
* nir/spirv: Add support for multisampled texturesJason Ekstrand2016-02-211-12/+19
|
* nir/gather_info: Count textures and imagesJason Ekstrand2016-02-181-0/+17
|
* nir/spirv: Add some more capabilitiesJason Ekstrand2016-02-171-2/+9
|
* nir: Add a helper for getting the one function from a shaderJason Ekstrand2016-02-171-0/+9
|
* nir: Add a nir_foreach_variable_safe helperJason Ekstrand2016-02-171-0/+3
|
* spirv: Fix SpvOpFwidth, SpvOpFwidthFine and SpvOpFwidthCoarseKristian Høgsberg Kristensen2016-02-171-3/+3
| | | | | | | "Result is the same as computing the sum of the absolute values of OpDPdx and OpDPdy on P." We were doing sum of absolute values of OpDPdx of P and OpDPdx of NULL.
* nir: Get rid of the C++ NIR_SRC/DEST_INIT macrosJason Ekstrand2016-02-121-10/+2
| | | | | | These were originally added to reduce compiler warnings but aren't really needed. Getting rid of them reduces the diff between the Vulkan branch and master, so we might as well.
* nir/spirv/glsl: Clean up the row-skipping swizzle logic a bitJason Ekstrand2016-02-121-10/+4
|
* nir/spirv: Allow the clip distance capability.Jason Ekstrand2016-02-111-0/+1
|
* Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2016-02-107-46/+10
|\ | | | | | | | | This also reverts commit 1d65abfa582a371558113f699ffbf16d60b64c90 because now NIR handles texture offsets in a much more sane way.
| * nir: Remove the const_offset from nir_tex_instrJason Ekstrand2016-02-105-32/+5
| | | | | | | | | | | | | | | | | | | | | | When NIR was originally drafted, there was no easy way to determine if something was constant or not. The result was that we had lots of special-casing for constant values such as this. Now that load_const instructions are SSA-only, it's really easy to find constants and this isn't really needed anymore. Reviewed-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
| * nir/lower_vec_to_movs: Better report channels handled by insert_movJason Ekstrand2016-02-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes two issues. First, we had a use-after-free in the case where the instruction got deleted and we tried to return mov->dest.write_mask. Second, in the case where we are doing a self-mov of a register, we delete those channels that are moved to themselves from the write-mask. This means that those channels aren't reported as being handled even though they are. We now stash off the write-mask before remove unneeded channels so that they still get reported as handled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94073 Reviewed-by: Matt Turner <[email protected]> Cc: "11.0 11.1" <[email protected]>
* | nir/spirv: Fix handling of OpGroupMemberDecorateJason Ekstrand2016-02-101-1/+1
| | | | | | | | We were pulling the member index from the wrong dword
* | nir/spirv: Assert that struct member ids are in-boundsJason Ekstrand2016-02-101-0/+4
| |
* | nir/spirv: fix build_mat_subdet stack smasherMark Janes2016-02-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | The sub-determinate implementation pattern fixed by 6a7e2904e0a2a6f8efbf739a1b3cad7e1e4ab42d has a second instance in the same file. With the previous algorithm, when row and j are both 3, the index overruns the array. This only impacts the stack on 32 bit builds. Reviewed-by: Jason Ekstrand <[email protected]>
* | anv: Fix up spirv for new texture/sampler split stuffJason Ekstrand2016-02-091-2/+22
| |
* | Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2016-02-0911-38/+68
|\| | | | | | | This pulls in the separate texture/sampler stuff from upstream
| * nir: Separate texture from sampler in nir_tex_instrJason Ekstrand2016-02-0910-18/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the capability to NIR to support separate textures and samplers. As it currently stands, glsl_to_nir only sets the texture deref and leaves the sampler deref alone as it did before and nir_lower_samplers assumes this. Backends can still assume that they are combined and only look at only at the texture index. Or, if they wish, they can assume that they are separate because nir_lower_samplers, tgsi_to_nir, and prog_to_nir all set both texture and sampler index whenever a sampler is required (the two indices are the same in this case). Reviewed-by: Kenneth Graunke <[email protected]>
| * nir/tex_instr: Rename sampler to textureJason Ekstrand2016-02-0911-58/+58
| | | | | | | | | | | | | | | | | | We're about to separate the two concepts. When we do, the sampler will become optional. Doing a rename first makes the separation a bit more safe because drivers that depend on GLSL or TGSI behaviour will be fine to just use the texture index all the time. Reviewed-by: Kenneth Graunke <[email protected]>
| * nir: Add some braces around loops and ifsJason Ekstrand2016-02-091-5/+10
| |
* | vtn: Use const_index helpersJason Ekstrand2016-02-092-5/+5
| |
* | Merge commit '8b0fb1c152fe191768953aa8c77b89034a377f83' into vulkanJason Ekstrand2016-02-0918-175/+285
|\| | | | | | | This pulls in Rob Clark's const_index changes for NIR
| * nir: use const_index helpersRob Clark2016-02-0911-24/+23
| | | | | | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * gtn: use const_index helpersRob Clark2016-02-091-8/+9
| | | | | | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: const_index helpersRob Clark2016-02-094-100/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Direct access to intr->const_index[n], where different slots have different meanings, is somewhat confusing. Instead, let's put some extra info in nir_intrinsic_infos[] about which slots map to what, and add some get/set helpers. The helpers validate that the field being accessed (base/writemask/etc) is applicable for the intrinsic opc, for some extra safety. And nir_print can use this to dump out decoded const_index fields. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: remove unused nir_variable fieldsTimothy Arceri2016-02-092-20/+0
| | | | | | | | | | | | | | These are used in GLSL IR to removed unused varyings and match transform feedback variables. There is no need to use these in NIR. Reviewed-by: Kenneth Graunke <[email protected]>
| * nir: Recognize open-coded bitfield_reverse.Matt Turner2016-02-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Helps 11 shaders in UnrealEngine4 demos. I seriously hope they would have given us bitfieldReverse() if we exposed GL 4.0 (but we do expose ARB_gpu_shader5, so why not use that anyway?). instructions in affected programs: 4875 -> 4633 (-4.96%) cycles in affected programs: 270516 -> 244516 (-9.61%) I suspect there's a *lot* of room to improve nir_search/opt_algebraic's handling of this. We'd actually like to match, e.g., step2 by matching step1 once and then doing a pointer comparison for the second instance of step1, but unfortunately we generate an enormous tuple for instead. The .text size increases by 6.5% and the .data by 17.5%. text data bss dec hex filename 22957 45224 0 68181 10a55 nir_libnir_la-nir_opt_algebraic.o 24461 53160 0 77621 12f35 nir_libnir_la-nir_opt_algebraic.o I'd be happy to remove this if Unreal4 uses bitfieldReverse() if it is in a GL 4.0 context once we expose GL 4.0. Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: Handle large unsigned values in opt_algebraic.Matt Turner2016-02-081-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The next patch adds an algebraic rule that uses the constant 0xff00ff00. Without this change, the build fails with return hex(struct.unpack('I', struct.pack('i', self.value))[0]) struct.error: 'i' format requires -2147483648 <= number <= 2147483647 The hex() function handles integers of any size, and assigning a negative value to an unsigned does what we want in C. The pack/unpack is unnecessary (and as we see, buggy). Reviewed-by: Dylan Baker <[email protected]>
| * nir: Do opt_algebraic in reverse order.Matt Turner2016-02-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Walking the SSA definitions in order means that we consider the smallest algebraic optimizations before larger optimizations. So if a smaller rule is part of a larger rule, the smaller one will happen first, preventing the larger one from happening. instructions in affected programs: 32721 -> 32611 (-0.34%) helped: 106 In programs whose nir_optimize loop count changes (129 of them): before: 1164 optimization loops after: 1071 optimization loops Of the 129 affected, 16 programs' optimization loop counts increased. Prevents regressions and annoyances in the next commits. Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: Recognize product of open-coded pow()s.Matt Turner2016-02-081-0/+2
| | | | | | | | | | | | Prevents regressions in the next commit. Reviewed-by: Jason Ekstrand <[email protected]>
| * nir: Add opt_algebraic rules for xor with zero.Matt Turner2016-02-081-0/+2
| | | | | | | | | | | | | | | | instructions in affected programs: 668 -> 664 (-0.60%) helped: 4 Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* | nir/spirv: Better handle constant offsets in texture lookupsJason Ekstrand2016-02-091-2/+13
| |
* | nir/spirv: Set the vtn_mode and interface type for sampler parametersJason Ekstrand2016-02-091-2/+19
| |
* | nir/inline_functions: Don't shadown variables when it isn't neededJason Ekstrand2016-02-091-23/+131
| | | | | | | | | | | | | | Previously, in order to get things working, we just always shadowed variables. Now, we rewrite derefs whenever it's safe to do so and only shadow if we have an in or out variable that we write or read to respectively.
* | nir: Rework function parametersJason Ekstrand2016-02-098-21/+67
| |
* | vtn: Clean up acos implementation.Francisco Jerez2016-02-081-28/+16
| | | | | | | | | | | | | | | | Parameterize build_asin() on the fit coefficients so the implementation can be shared while still using different polynomials for asin and acos. Also switch back to implementing acos in terms of asin -- The improvement obtained from cancelling out the pi/2 terms was negligible compared to the approximation error.
* | nir/spirv: Create integer types of correct signedness.Francisco Jerez2016-02-081-2/+4
| | | | | | | | | | | | | | | | | | | | vtn_handle_type() creates a signed type regardless of the value of the signedness flag, which usually doesn't make much of a difference except when the type is used as base sampled type of an image type, what will cause the base type of the NIR image variable to be inconsistent with its format and cause an assertion failure in the back-end (most likely only reproducible on Gen7), and may change the semantics of the image intrinsic subtly (e.g. UMIN may become IMIN).
* | Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2016-02-053-30/+30
|\|
| * nir: Add lowering support for unpacking opcodes.Matt Turner2016-02-012-0/+32
| | | | | | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
| * nir: Add lowering support for packing opcodes.Matt Turner2016-02-014-0/+66
| | | | | | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
| * nir: Add opcodes to extract bytes or words.Matt Turner2016-02-013-0/+28
| | | | | | | | | | | | The uint versions zero extend while the int versions sign extend. Reviewed-by: Iago Toral Quiroga <[email protected]>
| * glsl: Remove 2x16 half-precision pack/unpack opcodes.Matt Turner2016-02-011-9/+0
| | | | | | | | | | | | i965/fs was the only consumer, and we're now doing the lowering in NIR. Reviewed-by: Iago Toral Quiroga <[email protected]>
| * nir: Add lowering of nir_op_unpack_half_2x16.Matt Turner2016-02-012-4/+29
| | | | | | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
| * nir: Make argument order of unop_convert match binop_convert.Matt Turner2016-02-011-10/+10
| | | | | | | | | | | | Strangely the return and parameter types were reversed. Reviewed-by: Iago Toral Quiroga <[email protected]>
* | Merge commit mesa-public/master into vulkanJason Ekstrand2016-02-0541-513/+9916
|/ | | | This pulls in the patches that move all of the compiler stuff around
* glsl: move to compiler/Emil Velikov2016-01-266-7/+78
| | | | | | 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-2672-0/+24141
Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]> Acked-by: Jose Fonseca <[email protected]>