Chip Davis
674f97a40e
Handle interpolation qualifiers on the entire struct, too.
2018-09-06 12:29:42 -05:00
Chip Davis
1e51b235af
Add tests showing we don't emit interpolation qualifiers in vertex shaders.
...
In MSL, these only have an effect on fragment `[[stage_in]]` members.
They have no effect in vertex shaders. The Khronos front end doesn't
even emit the SPIR-V decorations for them.
2018-09-06 12:28:22 -05:00
Chip Davis
9e6469bd40
MSL: Handle interpolation qualifiers.
2018-09-05 12:02:07 -05:00
Chip Davis
1958438f69
Add optimized reference output for added test case.
2018-09-05 10:15:40 -05:00
Chip Davis
9fbe39c9c0
MSL: Emit spvTexelBufferCoord() on ImageWrite to a Buffer as well.
...
This is necessary to get the coordinates to give to the texture's
`write()` method.
2018-09-04 12:14:34 -05:00
Hans-Kristian Arntzen
917ca818ed
Merge pull request #673 from cdavis5e/min-max-clamp
...
MSL: Emit F{Min,Max,Clamp} as fast:: and N{Min,Max,Clamp} as precise::.
2018-09-04 15:15:18 +02:00
Chip Davis
b76a330baf
Update a bunch of test cases that I missed.
2018-09-03 17:31:15 -05:00
Hans-Kristian Arntzen
93e167eb0f
Add some uncommitted reference files.
2018-09-03 12:39:40 +02:00
Hans-Kristian Arntzen
0c1d4d8b6a
MSL: Support texture2d_ms_array.
2018-09-03 11:02:31 +02:00
Hans-Kristian Arntzen
778f998cd2
MSL: Throw error on multisampled array textures.
2018-09-03 10:21:59 +02:00
Hans-Kristian Arntzen
f284acae5f
MSL: Add test case for gl_FragDepth when used in function.
2018-08-29 09:21:48 +02:00
Hans-Kristian Arntzen
87de951105
MSL: Fix naming issue of aliased global variables.
...
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-27 09:59:55 +02:00
Hans-Kristian Arntzen
ae859934ca
Use GL_NV_gpu_shader5 as a fallback for AMD_gpu_shader_half_float.
2018-08-23 15:37:09 +02:00
Hans-Kristian Arntzen
f6ec83e5d4
GLSL: Allow blocks to have their own namespace.
2018-08-21 11:29:08 +02:00
Hans-Kristian Arntzen
981d7c1d85
Need to make sure the fetch expression is uint.
2018-08-07 16:02:17 +02:00
Hans-Kristian Arntzen
eee290a029
MSL: Fix support for texelFetchOffset.
...
Just apply the offset directly, MSL has no immediate offset parameter.
2018-08-07 15:28:04 +02:00
Hans-Kristian Arntzen
361fe52c9d
MSL: Properly support passing parameters by value.
...
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.
2018-08-06 15:43:51 +02:00
Hans-Kristian Arntzen
34a21b96cf
Add test case for phi-only continue block.
2018-08-06 14:06:40 +02:00
Bill Hollings
c3d74e1e14
CompilerMSL disable rasterization on buffer writes in vertex shader.
2018-07-27 16:53:36 -04:00
Bill Hollings
ac238b858b
CompilerMSL vertex entry point return void when rasterization disabled.
...
Add CompilerMSL::Options::disable_rasterization input/output API flag.
Disable rasterization via API flag or when writing to textures.
Disable rasterization when shader declares no output.
Add test shaders for vertex no output and write texture forcing void output.
2018-07-26 00:50:33 -04:00
Hans-Kristian Arntzen
18b82caf83
Properly track read dependencies for UAV access chain.
2018-07-09 14:02:50 +02:00
Hans-Kristian Arntzen
e1367e609a
Fix a lot of redundant code when loading flattened composites.
2018-07-06 10:57:23 +02:00
Hans-Kristian Arntzen
2bf57d6dff
Deal with composite constants in variable initializer.
2018-07-05 15:29:49 +02:00
Hans-Kristian Arntzen
dcddd5326e
Add LUT test cases for OpVariable with initializer.
2018-07-05 14:51:07 +02:00
Hans-Kristian Arntzen
af290ede87
Remove some redundant spvArrayCopy declarations.
2018-07-05 14:43:12 +02:00
Hans-Kristian Arntzen
5582523d9a
Add some tests for LUT promotion.
...
Also, update other tests.
2018-07-05 14:14:18 +02:00
Hans-Kristian Arntzen
d29f48ef06
Deduce constant LUTs from read-write variables.
2018-07-05 13:25:57 +02:00
Hans-Kristian Arntzen
e044732896
Support OpTypeImage with depth == 2 (unknown) properly.
...
Track which OpSampledImages are ever used with Dref opcodes.
2018-07-04 14:26:23 +02:00
Bill Hollings
4c5142b9d3
CompilerMSL support larger texel buffers by using 2D Metal textures.
...
Add CompilerMSL::Options::texture_width_max.
Emit and use spvTexelBufferCoord() function to convert 1D
texel buffer coordinates to 2D Metal texture coordinates.
2018-06-26 17:30:21 -04:00
Bill Hollings
4beefe756c
Fixes from PR 621 code review.
2018-06-25 11:40:20 -04:00
Bill Hollings
f66507a701
Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross
2018-06-25 10:52:15 -04:00
Hans-Kristian Arntzen
994f789465
Merge pull request #624 from KhronosGroup/fix-619
...
Support branch/loop hints in HLSL.
2018-06-25 10:53:52 +02:00
Hans-Kristian Arntzen
33c61d2abe
Support branch/loop hints in HLSL.
2018-06-25 10:33:13 +02:00
Hans-Kristian Arntzen
327fb03677
Merge pull request #623 from KhronosGroup/fix-618
...
Support globallycoherent in HLSL.
2018-06-25 10:31:28 +02:00
Hans-Kristian Arntzen
10dfaf79d5
Support globallycoherent in HLSL.
2018-06-25 10:04:25 +02:00
Hans-Kristian Arntzen
ffa9133d77
Support ternary expressions in OpSpecConstantOp.
2018-06-25 09:49:13 +02:00
Bill Hollings
e091031613
CompilerMSL pass builtin struct members into functions.
...
Add and use Compiler::get_non_pointer_type() convenience functions.
2018-06-24 15:06:12 -04:00
Hans-Kristian Arntzen
d94d20f4f3
Deal with some builtins being declared with wrong signedness.
2018-06-22 11:30:56 +02:00
Hans-Kristian Arntzen
9d31154917
Deal with switch case labels which share a block.
2018-06-20 10:49:28 +02:00
Bill Hollings
ac57a30ad6
Regenerate MSL shaders to fix conflicts from merge.
2018-06-12 11:51:56 -04:00
Bill Hollings
ab2ea93e35
Merge branch 'master' of https://github.com/KhronosGroup/SPIRV-Cross
2018-06-12 11:42:56 -04:00
Bill Hollings
9b4defe202
CompilerMSL support matrices & arrays in stage-in & stage-out.
...
Support flattening StorageOutput & StorageInput matrices and arrays.
No longer move matrix & array inputs to separate buffer.
Add separate SPIRFunction::fixup_statements_in & SPIRFunction::fixup_statements_out
instead of just SPIRFunction::fixup_statements.
Emit SPIRFunction::fixup_statements at beginning of functions.
CompilerMSL track vars_needing_early_declaration.
Pass global output variables as variables to functions that access them.
Sort input structs by location, same as output structs.
Emit struct declarations in order output, input, uniforms.
Regenerate reference shaders to new formats defined by above.
2018-06-12 11:41:35 -04:00
Hans-Kristian Arntzen
58fab58e5e
Do not unpack transposed matrices.
2018-06-12 09:43:47 +02:00
Hans-Kristian Arntzen
192a882df3
Also unpack regular unary/binary operations on MSL.
...
Apparently MSL gets confused when you have packed_float3 op float3 ...
2018-06-11 16:23:09 +02:00
Hans-Kristian Arntzen
b86bd0a265
Unpack expressions when used in functions on MSL.
...
OSX 10.14 broke (?) how overload resolution works,
so overloading e.g. dot(float3, packed_float3) no longer works.
Fix this by unpacking expressions before various func ops.
This fix might need to be applied elsewhere, but do so later if needed.
2018-06-11 10:56:45 +02:00
Hans-Kristian Arntzen
f1e8555801
Emit matrix layouts in structs directly.
...
Unlike GLSL, child structs do not inherit matrix layouts.
2018-06-05 09:42:07 +02:00
Hans-Kristian Arntzen
6bcc890e63
Sanitize underscores in general, not just for members.
2018-06-04 10:13:57 +02:00
Hans-Kristian Arntzen
04b149feb0
Fix image load/store on cube arrays in MSL.
2018-05-25 12:43:25 +02:00
Hans-Kristian Arntzen
f65120c147
Deal with packed expressions in more scenarios.
...
Make a new "to_extract_component_expression" helper.
2018-05-25 10:57:02 +02:00
Hans-Kristian Arntzen
280fb93204
Add test for reading SSBO from fragment shader on MSL.
2018-05-25 10:20:17 +02:00