summaryrefslogtreecommitdiffstats
path: root/src/glsl
Commit message (Collapse)AuthorAgeFilesLines
* nir/spirv: don't declare builtin blocksConnor Abbott2015-07-162-5/+22
| | | | | They aren't used, and the backend was barfing on them. Also, remove a hack in in compiler.cpp now that they're gone.
* nir/spirv: add support for loading UBO'sConnor Abbott2015-07-162-28/+178
| | | | | We directly emit ubo load intrinsics based off of the offset information handed to us from SPIR-V.
* nir/types: add more nir_type_is_xxx() wrappersConnor Abbott2015-07-152-0/+14
|
* nir: move to two-level binding model for UBO'sConnor Abbott2015-07-152-17/+32
| | | | | | | | | The GLSL layer above is still hacky, so we're really just moving the hack into GLSL-to-NIR. I'd rather not go all the way and make GLSL support the Vulkan binding model too, since presumably we'll be switching to SPIR-V exclusively, and so working on proper GLSL support will be a waste of time. For now, doing this keeps it working as we add SPIR-V->NIR support though.
* nir/spirv: update to SPIR-V revision 31Connor Abbott2015-07-132-1092/+599
| | | | | | | | This means that now the internal version of glslangValidator is required. This includes some changes due to the sampler/texture rework, but doesn't actually enable anything more yet. We also don't yet handle UBO's correctly, and don't handle matrix stride and row major/column major yet.
* nir: Add C++ versions of NIR_(SRC|DEST)_INITJason Ekstrand2015-07-101-2/+10
|
* nir/spirv: fix wrong writemask for ALU operationsConnor Abbott2015-07-091-0/+1
|
* nir/spirv: fix memory context for builtin variableConnor Abbott2015-07-081-1/+1
| | | | Fixes valgrind errors with func.depthstencil.basic.
* nir/spirv: zero out value arrayConnor Abbott2015-07-081-1/+1
| | | | | | | Before values are pushed or annotated with a name, decoration, etc., they need to have an invalid type, NULL name, NULL decoration, etc. ralloc zero's everything by accident, so this wasn't an issue in practice, but we should be explicitly zero'ing it.
* nir/spirv: fix some bugsvulkan-header-0.90.0Connor Abbott2015-07-061-3/+4
|
* nir/spirv: add support for builtins inside structuresConnor Abbott2015-07-062-21/+125
| | | | | We may be able to revert this depending on the outcome of bug 14190, but for now it gets vertex shaders working with SPIR-V.
* nir/spirv: fix a bug with structure creationConnor Abbott2015-07-061-1/+1
| | | | We were creating 2 extra bogus fields.
* nir/spirv: fix a bad assertion in the decoration handlingConnor Abbott2015-07-061-3/+6
| | | | | | We should be asserting that the parent decoration didn't hand us a member if the child decoration did, but different child decorations may obviously have different members.
* nir/spirv: pull out logic for getting builtin locationsConnor Abbott2015-07-061-62/+107
| | | | Also add support for more builtins.
* nir/spirv: plumb through the type of dereferencesConnor Abbott2015-07-062-16/+25
| | | | We need this to know if a deref is of a builtin.
* nir/spirv: handle structure member builtin decorationsConnor Abbott2015-07-061-9/+72
|
* nir/spirv: add a vtn_type structConnor Abbott2015-07-063-32/+73
| | | | This will handle decorations that aren't in the glsl_type.
* nir/spirv: move 'type' into the unionConnor Abbott2015-07-062-62/+65
| | | | | | | Since SSA values now have their own types, it's more convenient to make 'type' only used when we want to look up an actual SPIR-V type, since we're going to change its type soon to support various decorations that are handled at the SPIR-V -> NIR level.
* nir/spirv: Add initial structure member decoration supportJason Ekstrand2015-07-011-1/+44
|
* nir/spirv: Make vtn_handle_type match the other handler functionsJason Ekstrand2015-07-011-36/+48
| | | | | | Previously, the caller of vtn_handle_type had to handle actually inserting the type. However, this didn't really work if the type was decorated in any way.
* nir/spirv: Add basic support for Op[Group]MemberDecorateJason Ekstrand2015-07-012-15/+32
|
* Merge branch 'wip/nir-vtn' into vulkanConnor Abbott2015-06-266-117/+1061
|\ | | | | | | Adds composites and matrix multiplication, plus some control flow fixes.
| * nir/vtn: add support for phi nodesConnor Abbott2015-06-232-0/+129
| |
| * nir/builder: add support for inserting before/after blocksConnor Abbott2015-06-231-0/+36
| |
| * nir/vtn: fix emitting code after loopsConnor Abbott2015-06-221-1/+1
| | | | | | | | | | | | | | When we're done emitting the code for a loop, we need to visit the new break block, which is the merge block of the current loop, rather than the old merge block, which is the merge block of the loop containing the one we just emitted code for.
| * unbreak thingsConnor Abbott2015-06-221-1/+1
| |
| * matrices matrices matricesConnor Abbott2015-06-182-28/+268
| |
| * nir/types: be less strict about constructing matrix typesConnor Abbott2015-06-181-1/+1
| |
| * nir/builder: add a nir_fdot() convenience functionConnor Abbott2015-06-181-0/+17
| |
| * nir/types: add a helper to transpose a matrix typeConnor Abbott2015-06-182-0/+9
| |
| * fix glsl450 for compositesConnor Abbott2015-06-181-11/+13
| |
| * composites composites compositesConnor Abbott2015-06-172-87/+593
| |
| * awesome control flow bugfixes/clarificationsConnor Abbott2015-06-031-14/+16
| |
* | nir/spirv: Set the right location for shader input/outputsJason Ekstrand2015-06-251-0/+11
| | | | | | | | We need to add FRAG_RESULT_DATA0 etc. to the input/output location.
* | nir/spirv: Set the interface type on uniform blocksJason Ekstrand2015-06-251-0/+1
| |
* | nir/spirv: Set the system value mode on builtinsJason Ekstrand2015-06-251-0/+1
| |
* | nir/spirv: Actually put variables on the right linked listJason Ekstrand2015-06-251-6/+21
| |
* | glsl: Move vert_attrib varying_slot and frag_result enums to shader_enums.hJason Ekstrand2015-06-251-0/+207
| |
* | nir/spirv: Fix up some dererf ralloc parentingJason Ekstrand2015-06-241-2/+2
| |
* | nir/spirv: Use vtn_ssa_value for texture coordinatesJason Ekstrand2015-06-241-5/+3
| |
* | nir/spirv: Add support for the Uniform storage classJason Ekstrand2015-06-241-1/+1
| | | | | | | | | | This is kida sketchy. I'm not really sure this is the way it's supposed to be used.
* | nir/spirv: Add support for some more decorations including built-inJason Ekstrand2015-06-241-3/+68
| |
* | nir/spirv: Make the header file C++ safeJason Ekstrand2015-06-241-0/+8
| |
* | Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2015-06-2341-215/+567
|\ \
| * | glsl: binding point is a texture unit, which is a combined spaceIlia Mirkin2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes compilation failures in Dota 2 Reborn where a texture unit binding point was used that was numerically higher than the max per stage. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Tested-by: Nick Sarnie <[email protected]> Cc: "10.5 10.6" <[email protected]>
| * | glsl: Specify the shader stage in linker errors due to too many in/outputs.Jose Fonseca2015-06-231-4/+8
| | | | | | | | | | | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
| * | nir: Allow vec2/vec3/vec4 instructions in the select peephole pass.Kenneth Graunke2015-06-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are basically just moves, so they should be safe as well. When disabling i965's GLSL IR level scalarizer (channel expressions) pass, I started seeing NIR code like this: if ssa_21 { block block_1: /* preds: block_0 */ vec4 ssa_120 = vec4 ssa_82, ssa_83, ssa_84, ssa_30 /* succs: block_3 */ } else { block block_2: /* preds: block_0 */ /* succs: block_3 */ } block block_3: /* preds: block_1 block_2 */ vec4 ssa_33 = phi block_1: ssa_120, block_2: ssa_2 Previously, the GLSL IR scalarizer pass would break the vec4 into a series of fmovs, which were allowed by the peephole pass. But with the vec4 operation, they were not. We want to keep getting selects. Normal i965 on Broadwell: instructions in affected programs: 200 -> 176 (-12.00%) helped: 4 With brw_fs_channel_expressions() disabled: instructions in affected programs: 1832 -> 1646 (-10.15%) helped: 30 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
| * | glsl: fix formatting glitch in _mesa_print_ir()Brian Paul2015-06-191-1/+1
| | | | | | | | | | | | Print the closing ) before the newline. Trivial.
| * | glsl: Fail linkage when UBO exceeds GL_MAX_UNIFORM_BLOCK_SIZE.Jose Fonseca2015-06-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not totally clear whether other Mesa drivers can safely cope with over-sized UBOs, but at least for llvmpipe receiving a UBO larger than its limit causes problems, as it won't fit into its internal display lists. This fixes piglit "arb_uniform_buffer_object-maxuniformblocksize fsexceed" without regressions for llvmpipe. NVIDIA driver also fails to link the shader from "arb_uniform_buffer_object-maxuniformblocksize fsexceed". Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65525 PS: I don't recommend cherry-picking this for Mesa stable, as some app might inadvertently been relying on UBOs larger than GL_MAX_UNIFORM_BLOCK_SIZE to work on other drivers, so even if this commit is universally accepted it's probably best to let it mature in master for a while. Reviewed-by: Roland Scheidegger <[email protected]>
| * | glsl: guard gl_NumSamples enablement on ARB_sample_shadingIlia Mirkin2015-06-181-1/+2
| | | | | | | | | | | | | | | | | | | | | gl_NumSamples should only be enabled when ARB_sample_shading is enabled. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>