summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
Commit message (Collapse)AuthorAgeFilesLines
* nir/spirv: Refactor variable deocration handlingJason Ekstrand2016-09-081-15/+29
| | | | | | | | | | | Previously, we dind't apply variable decorations to the members of a split structure variable. This doesn't quite work, unfortunately, because things such as the "flat" qualifier may get applied to an entire structure instead of propagated to the members. This fixes 9 of the new CTS tests in the dEQP-VK.glsl.linkage.varying.struct.* group. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Break variable decoration handling into a helperJason Ekstrand2016-09-081-74/+81
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Implement OpAtomicLoad/Store for shared variablesLionel Landwerlin2016-09-071-1/+34
| | | | | | | Missing bits from 2afb950161f847d9b0a7be03dfb62cacc5ea51ba. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/spirv: Remove an erroneous "fall through" commentJason Ekstrand2016-09-071-1/+0
|
* spirv/nir: Add support for OpAtomicLoad/StoreLionel Landwerlin2016-09-071-11/+113
| | | | | | | | | | | | Fixes new CTS tests : dEQP-VK.spirv_assembly.instruction.compute.opatomic.load dEQP-VK.spirv_assembly.instruction.compute.opatomic.store v2: don't handle images like ssbo/ubo (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/spirv: Use fill_common_atomic_sources for image atomicsJason Ekstrand2016-09-061-56/+43
| | | | | | | | | We had two almost identical copies of this code and they were both broken but in different ways. The previous two commits fixed both of them. This one just unifies them so that it's easier to handle in the future. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* nir/spirv: Use the correct sources for CompareExchange on imagesJason Ekstrand2016-09-061-2/+2
| | | | | | | | | The CompareExchange operation has two "Memory Semantics" parameters instead of one so the real arguments start at w[7] instead of w[6]. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* nir/spirv: Swap the argument order for AtomicCompareExchangeJason Ekstrand2016-09-061-2/+2
| | | | | | | | | | | SPIR-V has the two arguments in the opposite order from GLSL. NIR uses the GLSL order so we had them backwards. Fixes dEQP-VK.spirv_assembly.instruction.compute.opatomic.compex Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* spirv: replace assert with unreachableTimothy Arceri2016-08-301-1/+1
| | | | | | | Fixes uninitialised warning for coord_components. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* spirv/nir: Add support for ImageQuerySamplesJason Ekstrand2016-07-221-0/+3
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Handle texture projectorsJason Ekstrand2016-07-221-0/+15
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Refactor coordinate handling in handle_textureJason Ekstrand2016-07-221-29/+28
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Refactor type handling in handle_textureJason Ekstrand2016-07-221-5/+8
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Move opcode selection higher up in handle_textureJason Ekstrand2016-07-221-48/+48
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Don't increment coord_components for array lod queriesJason Ekstrand2016-07-221-1/+1
| | | | | | | | | For lod query instructions, we really don't care whether or not the sampler is an array type because that doesn't factor into the LOD. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Properly handle gather componentsJason Ekstrand2016-07-221-1/+11
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Add support for shadow samplers that return vec4Jason Ekstrand2016-07-221-1/+2
| | | | | | | | | | While SPIR-V technically doesn't support "old style" shadow, the shadow-compare gather instruction does return a vec4 so we need to be able to set the old_style_shadow bit in NIR. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* spirv/nir: Fix some texture opcode assertsJason Ekstrand2016-07-221-2/+2
| | | | | | | | | We can't get an lod with txf_ms and SPIR-V considers textureGrad to be an explicit-LOD texturing instruction. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* compiler: Rename INTERP_QUALIFIER_* to INTERP_MODE_*.Kenneth Graunke2016-07-172-4/+4
| | | | | | | | | | | | | | | | | Likewise, rename the enum type to glsl_interp_mode. Beyond the GLSL front-end, talking about "interpolation modes" seems more natural than "interpolation qualifiers" - in the IR, we're removed from how exactly the source language specifies how to interpolate an input. Also, SPIR-V calls these "decorations" rather than "qualifiers". Generated by: $ find . -regextype egrep -regex '.*\.(c|cpp|h)' -type f -exec sed -i \ -e 's/INTERP_QUALIFIER_/INTERP_MODE_/g' \ -e 's/glsl_interp_qualifier/glsl_interp_mode/g' {} \; Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Dave Airlie <[email protected]>
* nir/spirv: Don't multiply the push constant block size by 4Jason Ekstrand2016-07-131-1/+1
| | | | | | | | | I have no idea why we were multiplying by 4 before. The offsets we get from SPIR-V are in bytes and so is nir->num_uniforms so there's no need to do any adjustment whatsoever. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* Remove wrongly repeated words in commentsGiuseppe Bilotta2016-06-231-1/+1
| | | | | | | | | | | | | | | | | Clean up misrepetitions ('if if', 'the the' etc) found throughout the comments. This has been done manually, after grepping case-insensitively for duplicate if, is, the, then, do, for, an, plus a few other typos corrected in fly-by v2: * proper commit message and non-joke title; * replace two 'as is' followed by 'is' to 'as-is'. v3: * 'a integer' => 'an integer' and similar (originally spotted by Jason Ekstrand, I fixed a few other similar ones while at it) Signed-off-by: Giuseppe Bilotta <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* spirv: Use the system value version of gl_FrontFaceJason Ekstrand2016-06-211-2/+2
| | | | | | | | | | SPIR-V treats it as an input but NIR wants the system value. This shouldn't have been too much of a surprise given that we have to do the same conversion in the GLSL IR to NIR pass. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Make a decoration switch completeJason Ekstrand2016-06-031-3/+1
| | | | | | | | Getting rid of the default case makes the compiler warn if we are missing cases. While we're here, we also add the one missing case. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Make unhandled decorations and capabilities non-fatalJason Ekstrand2016-06-032-18/+36
| | | | | | | | glslang frequently throw bogus decorations into shaders. While we are free to assert-fail, it's a bit nicer to the application to just warn. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Add a way to print non-fatal warningsJason Ekstrand2016-06-032-0/+19
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Add string lookup tables for a couple of SPIR-V enumsJason Ekstrand2016-06-032-0/+177
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Complete the list of capabilitiesJason Ekstrand2016-06-031-3/+45
| | | | | | | | | Previously we supported a subset of capabilities and just left a default case for the others. It's time to stop being lazy and actually audit the capabilities. This should bring them up-to-date with reality. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Handle the WorkgroupSize builtin decorationJason Ekstrand2016-06-031-0/+22
| | | | | | | | | This fixes the 7 dEQP-VK.pipeline.spec_constant.compute.local_size.* tests in the latest dev version of the Vulkan CTS. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Use breaks instead of returns in constant handlingJason Ekstrand2016-06-031-3/+4
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* nir/spirv: Allow pointless variable decorations on inputsJason Ekstrand2016-05-261-0/+2
| | | | | | SPIR-V specifies that a bunch of stuff gets applied to types. This means taht a local variable could get, for instance, an array stride. Just because it's pointless doesn't mean you'll never see it.
* spirv: Mark default cases unreachable().Matt Turner2016-05-251-0/+2
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* nir/spirv: Handle location decorations on structure membersJason Ekstrand2016-05-241-20/+28
|
* nir/spirv: Add explicit handling for all decorationsJason Ekstrand2016-05-242-17/+110
| | | | | | | From time to time we have had cases where glslang has added a decoration we don't handle and it has caused problems. This audit ensures that, for every decoration, we either handle it or hit an unreachable() with an accurate description of why we don't have to.
* spirv: Handle the PixelCenterInteger execution mode.Kenneth Graunke2016-05-203-0/+7
| | | | | | | | | This isn't allowed by Vulkan, but might be useful someday for SPIR-V in OpenGL (if that ever becomes a thing). It's easy enough to hook up, and as precedent, we already do so for OriginLowerLeft. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/spirv: Handle the NonReadable decoration on struct membersJason Ekstrand2016-05-191-0/+1
|
* spirv: add switch case for nir_texop_txf_ms_mcs in vtn_handle_texture()Brian Paul2016-05-181-0/+2
| | | | | | | | | | | Mark it as unreachable. Silences a compiler warning: spirv/spirv_to_nir.c:1397:4: warning: enumeration value 'nir_texop_txf_ms_mcs' not handled in switch [-Wswitch] switch (instr->op) { ^ Reviewed-by: Jason Ekstrand <[email protected]>
* spirv: Properly size the src[] array.Matt Turner2016-05-181-1/+1
| | | | | | | Operations like nir_op_bitfield_insert have four arguments, and Coverity isn't privy to the fact that 4-argument operations aren't possible here, so it thinks this can lead to memory corruption. Just increase the size of the array to quell any fears.
* nir: glsl_get_bit_size() should take glsl_typeRob Clark2016-05-122-5/+5
| | | | | | | | It's what all the call-sites once, so gets rid of a bunch of inlined glsl_get_base_type() at the call-sites. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* spirv: Fix structure splitting with per-vertex interface arrays.Kenneth Graunke2016-05-071-1/+2
| | | | | | | | | | | | | | | | | | | We want to use interface_type, not vtn_var->type. They're normally equivalent, but for geometry/tessellation per-vertex interface arrays, we need to unwrap a level. Otherwise, we tried to iterate a structure members but instead used an array length. If the array length was longer than the number of fields in the structure, we'd crash. Fixes the CreatePipelineGeometryInputBlockPositive layer validation test. v2: Just use glsl_without_array() on the vtn_var type (requested by Jason Ekstrand). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* spirv: fix warning in release buildGrazvydas Ignotas2016-04-251-1/+1
| | | | | | | | Mark variable MAYBE_UNUSED to avoid unused-but-set-variable warning in release build. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* spirv: Trivially handle the NonWriteable decorationJason Ekstrand2016-04-202-0/+4
| | | | Signed-off-by: Jason Ekstrand <[email protected]>
* spirv: Move to compiler/Jason Ekstrand2016-04-149-0/+7568
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.