baldurk
22dcb1f539
Centralise calculation of derivatives, implement OpFwidth*
2020-04-14 17:55:29 +01:00
baldurk
139d53e5e1
Add some type variants of supported glsl450 functions
2020-04-14 17:41:32 +01:00
baldurk
80e1cbfba4
Don't duplicate workgroup for derivatives
...
* Because SPIR-V is SSA, we can use the current workgroup for all cross-group
operations, knowing that the output ID of any such opcode can't also be the
input (so doing workgroup operations one-at-a-time is still fine, we won't
corrupt results of later threads by updating earlier ones.
2020-04-14 15:11:41 +01:00
baldurk
7bfee85edc
Treat OpInBoundsAccessChain the same as OpAccessChain
2020-04-13 18:24:47 +01:00
baldurk
2318305c96
Implement OpVectorExtract/InsertDynamic
2020-04-13 18:24:47 +01:00
baldurk
8192dab204
Set result number of rows from texture sample
2020-04-13 18:24:47 +01:00
baldurk
cc9d91e976
Fix compilation
2020-04-11 00:02:24 +01:00
baldurk
9a6696a191
Fix implementation of OpSelect
2020-04-10 20:52:18 +01:00
baldurk
a61822cfe1
Generate SPIR-V shader to implement some image samples on 2D image
2020-04-10 20:52:09 +01:00
baldurk
4b830d4a66
Pass the texture type to CalculateSampleGather
2020-04-10 18:15:54 +01:00
baldurk
9cf265284e
Pass ThreadState to CalculateSampleGather
...
* This is needed to fetch the values of Id parameters in
ImageOperandsAndParamDatas
2020-04-10 12:57:13 +01:00
baldurk
4ebdf806c9
Add SPIR-V side of handling images and samples
...
* This is still stubbed out on the vulkan API side to actually perform the
sample operation
2020-04-09 19:34:36 +01:00
baldurk
73c05536e0
Make Pointer a full VarType instead of a ShaderVariable member
2020-04-09 18:36:12 +01:00
baldurk
c3d53237f7
Fix handling of OpUndef and improve disassembly of NULL/Undef values
2020-04-09 18:36:12 +01:00
baldurk
d68aa1cd83
Implement OpCompositeInsert
2020-04-09 11:12:09 +01:00
baldurk
b99b0214ae
Implement bitwise operations
2020-04-08 18:39:03 +01:00
baldurk
3a1352a8af
Add errors for pipe instructions
2020-04-08 18:39:03 +01:00
baldurk
64cf07b8da
OpExtInstImport isn't expected to happen during debugging
2020-04-08 18:39:03 +01:00
baldurk
96c7eb0b93
Add OpSMod support with other modulo operations
2020-04-08 18:39:03 +01:00
baldurk
8a6dbd7045
Implement OpDot
2020-04-08 18:39:02 +01:00
baldurk
59c3a2fbd9
Implement matrix multiplication with matrix/vector/scalar
2020-04-08 18:39:02 +01:00
baldurk
33eb5a631f
Implement Op*Negate
2020-04-08 18:39:02 +01:00
baldurk
57400e1bf8
Add support for extended instruction sets
...
* Implement a few instructions in GLSL.std.450
2020-04-08 18:39:02 +01:00
baldurk
d874c32275
Implement modulo/remainder operations
2020-04-07 23:21:07 +01:00
baldurk
6d8a972133
Implement OpBitcast
2020-04-07 23:20:51 +01:00
baldurk
d8fa0b624d
Implement derivatives
2020-04-07 18:37:13 +01:00
baldurk
1b6cc3a70e
Implement OpVectorShuffle
2020-04-07 17:43:30 +01:00
baldurk
33d7971364
Mark integer divide by zero as "generated NaN of Inf" in shader debug
2020-04-02 18:15:44 +01:00
baldurk
528a0c5f5e
Guard against integer division by zero
...
* The SPIR-V spec doesn't state what will happen, only that it's undefined. For
the sake of something sensible (and because it has a good chance of matching
at least some hardware) we use D3D's behaviour and set the value to 0xFFFFFFFF
2020-04-01 17:38:44 +01:00
baldurk
53ca92965d
Add missing resize when constructing matrix composite
2020-04-01 17:37:16 +01:00
baldurk
414d8df8f5
Fix debugging function calls without return values
2020-03-31 18:45:36 +01:00
baldurk
6c0aa42ff1
Propagate thread initial state to whole workgroup properly
2020-03-20 16:16:51 +00:00
baldurk
12e378f04b
Add cases for opcodes we explicitly expect not to handle
2020-02-25 18:19:52 +00:00
baldurk
0a309f04c2
Handle block-level flow control
2020-02-24 18:10:56 +00:00
baldurk
4d6938614e
Add a couple of simple operations
...
* This includes maths, comparison, conversion.
2020-02-24 18:10:56 +00:00
baldurk
0ff541caca
Handle scope changes between function calls properly
2020-02-24 18:10:56 +00:00
baldurk
cf3153f238
Use isinf() instead of finite()
2020-02-20 20:02:49 +00:00
baldurk
6b28d14089
Add source variables for named IDs where possible
2020-02-20 19:07:30 +00:00
baldurk
5ae8fc1ed7
Implement load/store through access chains and composite swizzles
...
* This is enough for very simple shaders. We add a utility function for setting
values and handling pointer changes.
2020-02-20 19:07:30 +00:00
baldurk
5fee776a52
Allocate function variables in stack frame, and copy function parameters
2020-02-20 19:07:29 +00:00
baldurk
d0ff4f27aa
Start iteration of SPIR-V opcodes
...
* Currently the only flow control we handle is function calls and returns,
ending the thread when we return from the entry point.
2020-02-20 19:07:29 +00:00