Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-05Roll dependencies.Hans-Kristian Arntzen
2021-05-07HLSL: Implement invariant as precise.Hans-Kristian Arntzen
Only option we have.
2021-05-07Honor NoContraction qualifier.Hans-Kristian Arntzen
We'll need to force a temporary and mark it as precise. MSL is a little weird here, but we can piggyback on top of the invariant float math option here to force fma() operations everywhere.
2021-04-22Rewrite how non-uniform qualifiers are handled.Hans-Kristian Arntzen
Remove all shenanigans with propagation, and only consume nonuniform qualifiers exactly where needed (last minute).
2020-07-27Adding BuiltInSampleMask in HLSLTomek Ponitka
2020-06-16HLSL: Fix texProj in legacy HLSL.Hans-Kristian Arntzen
2020-05-19HLSL: Implement image queries for UAV images.Hans-Kristian Arntzen
This was completely unimplemented for some reason.
2020-04-21Ensure unpack/pack2x32 tests are compatible with test suite.Hans-Kristian Arntzen
2020-04-21GLSL/HLSL: Support packUint2x32 and unpackUint2x32Asuka
2020-04-03HLSL: Add support for treating NonWritable UAV texture as SRV instead.Hans-Kristian Arntzen
2020-03-05HLSL: Do not emit globallycoherent for SRV ByteAddressBuffer.Hans-Kristian Arntzen
2020-03-04HLSL: Add option to always treat SSBO as UAV, even with readonly.Hans-Kristian Arntzen
This can make codegen more predictable since ByteAddressBuffer is SRV and not UAV.
2020-01-08HLSL: Support loading complex composites from ByteAddressBuffer.Hans-Kristian Arntzen
2019-11-05Move all .invalid shaders into no-opt folders.Dan Sinclair
2019-10-14HLSL: Fix unrolled S/G LE/LT/GE/GT opcodes.Hans-Kristian Arntzen
Need to bitcast the unrolled expressions as well.
2019-09-02Support the SPV_EXT_fragment_shader_interlock extension.Chip Davis
This was straightforward to implement in GLSL. The `ShadingRateInterlockOrderedEXT` and `ShadingRateInterlockUnorderedEXT` modes aren't implemented yet, because we don't support `SPV_NV_shading_rate` or `SPV_EXT_fragment_invocation_density` yet. HLSL and MSL were more interesting. They don't support this directly, but they do support marking resources as "rasterizer ordered," which does roughly the same thing. So this implementation scans all accesses inside the critical section and marks all storage resources found therein as rasterizer ordered. They also don't support the fine-grained controls on pixel- vs. sample-level interlock and disabling ordering guarantees that GLSL and SPIR-V do, but that's OK. "Unordered" here merely means the order is undefined; that it just so happens to be the same as rasterizer order is immaterial. As for pixel- vs. sample-level interlock, Vulkan explicitly states: > With sample shading enabled, [the `PixelInterlockOrderedEXT` and > `PixelInterlockUnorderedEXT`] execution modes are treated like > `SampleInterlockOrderedEXT` or `SampleInterlockUnorderedEXT` > respectively. and: > If [the `SampleInterlockOrderedEXT` or `SampleInterlockUnorderedEXT`] > execution modes are used in single-sample mode they are treated like > `PixelInterlockOrderedEXT` or `PixelInterlockUnorderedEXT` > respectively. So this will DTRT for MoltenVK and gfx-rs, at least. MSL additionally supports multiple raster order groups; resources that are not accessed together can be placed in different ROGs to allow them to be synchronized separately. A more sophisticated analysis might be able to place resources optimally, but that's outside the scope of this change. For now, we assign all resources to group 0, which should do for our purposes. `glslang` doesn't support the `RasterizerOrdered` UAVs this implementation produces for HLSL, so the test case needs `fxc.exe`. It also insists on GLSL 4.50 for `GL_ARB_fragment_shader_interlock`, even though the spec says it needs either 4.20 or `GL_ARB_shader_image_load_store`; and it doesn't support the `GL_NV_fragment_shader_interlock` extension at all. So I haven't been able to test those code paths. Fixes #1002.
2019-07-17Support the SPV_EXT_demote_to_helper_invocation extension.Chip Davis
This extension provides a new operation which causes a fragment to be discarded without terminating the fragment shader invocation. The invocation for the discarded fragment becomes a helper invocation, so that derivatives will remain defined. The old `HelperInvocation` builtin becomes undefined when this occurs, so a second new instruction queries the current helper invocation status. This is only fully supported for GLSL. HLSL doesn't support the `IsHelperInvocation` operation and MSL doesn't support the `DemoteToHelperInvocation` op. Fixes #1052.
2019-07-14Update external repos.Chip Davis
Fix fallout from changes. There's a bug in glslang that prevents `float16_t`, `[u]int16_t`, and `[u]int8_t` constants from adding the corresponding SPIR-V capabilities. SPIRV-Tools, meanwhile, tightened validation so that these constants are only valid if the corresponding `Float16`, `Int16`, and `Int8` caps are on. This affects the `16bit-constants.frag` test for GLSL and MSL.
2019-07-08Fall back to complex loop if non-trivial continue block is found.Hans-Kristian Arntzen
There is a case where we can deduce a for/while loop, but the continue block is actually very painful to deal with, so handle that case as well. Removes an exceptional case.
2019-07-03MSL/HLSL: Support scalar reflect and refract.Hans-Kristian Arntzen
2019-07-01MSL/HLSL: Support OpOuterProduct.Hans-Kristian Arntzen
2019-06-28Deal with scalar input values for distance/length/normalize.Hans-Kristian Arntzen
HLSL and MSL don't support it, so fall back to simpler intrinsics.
2019-06-27Handle more cases with FP16 and texture sampling.Hans-Kristian Arntzen
2019-05-28Support emitting OpLine directive.Hans-Kristian Arntzen
Facilitates easier mapping from source language to cross-compiled output in tooling.
2019-05-13HLSL/MSL: Deal correctly with nonuniformEXT qualifier.Hans-Kristian Arntzen
MSL does not seem to have a qualifier for this, but HLSL SM 5.1 does. glslangValidator for HLSL does not support this, so skip any validation, but it passes in FXC.
2019-05-07HLSL: Support OpArrayLength.Hans-Kristian Arntzen
2019-03-21GLSL/HLSL: Implement NMin/NMax/NClamp.Hans-Kristian Arntzen
Need to emulate these calls for correctness.
2019-02-22MSL: Fix textures which are sampled and compared against.Hans-Kristian Arntzen
depth2d in MSL only returns float, not float4, even for normal sampling. We need to conditionally remap-swizzle back to float4.
2019-02-20Fix case where a struct is loaded which contains a row-major matrix.Hans-Kristian Arntzen
2019-02-06Support LUTs in single-function CFGs on Private storage class.Hans-Kristian Arntzen
Fairly common pattern in unoptimized SPIR-V. Support this case as well.
2019-01-30Update to latest glslang/SPIRV-Tools.Hans-Kristian Arntzen
Fix various bugs along the way.
2019-01-30Support initializers on StorageClassOutput.fix-838Hans-Kristian Arntzen
2019-01-11HLSL: Support dual-source blending.Hans-Kristian Arntzen
2019-01-04Merge pull request #799 from KhronosGroup/fix-780Hans-Kristian Arntzen
Use correct block-name / other-name aliasing rules.
2019-01-04Use correct block-name / other-name aliasing rules.Hans-Kristian Arntzen
A block name cannot alias with any name in its own scope, and it cannot alias with any other "global" name. To solve this, we need to complicate the name cache updates a little bit where we have a "primary" namespace and "secondary" namespace.
2019-01-04Register implied expression reads in OpLoad/OpAccessChain.Hans-Kristian Arntzen
This is required to avoid relying on complex sub-expression elimination in compilers, and generates cleaner code. The problem case is if a complex expression is used in an access chain, like: Composite comp = buffer[texture(...)]; vec4 a = comp.a + comp.b + comp.c; Before, we did not have common subexpression tracking for OpLoad/OpAccessChain, so we easily ended up with code like: vec4 a = buffer[texture(...)].a + buffer[texture(...)].b + buffer[texture(...)].c; A good compiler will optimize this, but we should not rely on it, and forcing texture(...) to a temporary also looks better. The solution is to add a vector "implied_expression_reads", which works similarly to expression_dependencies. We also need an extra mechanism in to_expression which lets us skip expression read checking and do it later. E.g. for expr -> access chain -> load, we should only trigger a read of expr when using the loaded expression.
2018-11-26Fix unsigned switch case selectors.Hans-Kristian Arntzen
2018-11-12Deal with depth_greater/depth_less qualifiers.Hans-Kristian Arntzen
Adds support on HLSL SM 5.0, and fixes bug on GLSL. Makes sure early fragment tests is tested on MSL as well.
2018-11-12HLSL: Complete support for combined image samplers in legacy.Hans-Kristian Arntzen
2018-11-01Deal with OpSpecConstantOp used as array size.Hans-Kristian Arntzen
When trying to validate buffer sizes, we usually need to bail out when using SpecConstantOps, but for some very specific cases where we allow unsized arrays currently, we can safely allow "unknown" sized arrays as well. This is probably the best we can do, when we have even more difficult cases than this, we throw a more sensible error message.
2018-11-01Add test case for local_size_x_id and some complex cases.Hans-Kristian Arntzen
2018-10-27Add Windows support in Travis CI.Hans-Kristian Arntzen
- Add new Windows support - Use CMake/CTest instead of Make + shell scripts - Use --parallel in CTest - Fix CTest on Windows - Cleanups in test_shaders.py - Force specific commit for SPIRV-Headers - Fix Inf/NaN odd-ball case by moving to ASM
2018-09-27Update glslang and SPIRV-Tools.Hans-Kristian Arntzen
A lot of changes in spirv-opt output. Some new invalid SPIR-V was found but most of them were not significant for SPIRV-Cross, so just marked them as invalid.
2018-09-17Implement atomic increment/decrement in GLSL and HLSL.Hans-Kristian Arntzen
2018-09-12Merge branch 'legacy-color-4comp' of git://github.com/crosire/SPIRV-CrossHans-Kristian Arntzen
2018-09-11Add tests for previous fixcrosire
2018-09-10Add composite array test shaders for GLSL and HLSL as well.Hans-Kristian Arntzen
2018-08-27MSL: Fix naming issue of aliased global variables.Hans-Kristian Arntzen
When the name of an alias global variable collides with a global declaration, MSL would emit inconsistent names, sometimes with the naming fix, sometimes without, because names were being tracked in two separate meta blocks. Fix this by always redirecting parameter naming to the original base variable as necessary.
2018-08-07MSL: Fix support for texelFetchOffset.Hans-Kristian Arntzen
Just apply the offset directly, MSL has no immediate offset parameter.
2018-08-06MSL: Properly support passing parameters by value.Hans-Kristian Arntzen
MSL would force thread const& which would not work if the input argument came from a different storage class. Emit proper non-reference arguments for such values.