Józef Kucia
f7a21ad982
vkd3d-compiler: Do not overallocate memory for shader code.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 11:02:12 +02:00
Józef Kucia
da8eb496cf
libs/vkd3d-shader: Zero-initialize unused shader output components.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:31:13 +02:00
Józef Kucia
bde5dafe5b
libs/vkd3d-shader: Factor out vkd3d_dxbc_compiler_emit_vector_shuffle().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:31:10 +02:00
Józef Kucia
410e105ac5
libs/vkd3d-shader: Determine shader output component count based on shader signature.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:31:08 +02:00
Józef Kucia
07ffccd186
libs/vkd3d-shader: Fix vkd3d_find_signature_element_for_reg().
...
The exact match of write masks between a shader signature and
dcl_input/dcl_output instructions isn't required.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:31:05 +02:00
Józef Kucia
c54b148a2c
libs/vkd3d-shader: Add support for indexable temporary registers.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:30:59 +02:00
Józef Kucia
b707e36d56
libs/vkd3d-shader: Translate partial derivative instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:30:57 +02:00
Józef Kucia
b14bb73c5b
libs/vkd3d-shader: Translate sincos instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:30:51 +02:00
Józef Kucia
92f3d33e15
libs/vkd3d-shader: Translate round_ne instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 12:30:27 +02:00
Józef Kucia
6e8dae9d62
libs/vkd3d-shader: Add debug name for vDomainLocation register.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-18 17:52:33 +02:00
Józef Kucia
054b1e41dd
libs/vkd3d-shader: Treat vicp register as regular shader input.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-18 17:52:31 +02:00
Józef Kucia
faa1118202
libs/vkd3d-shader: Enable arrayed inputs for all shader types.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-18 17:52:29 +02:00
Józef Kucia
d15c9f79b5
libs/vkd3d-shader: Fix returning multiple components from dot product instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:58 +02:00
Józef Kucia
d14f9196f9
libs/vkd3d-shader: Do not emit output setup for ret in geometry shaders.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:53 +02:00
Józef Kucia
c21a8b56a0
libs/vkd3d-shader: Generate correct SPIR-V code for arrayed shader inputs.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:51 +02:00
Józef Kucia
62b6d01c84
libs/vkd3d-shader: Pass register index to vkd3d_find_signature_element_for_reg().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:49 +02:00
Józef Kucia
ab6b24ff65
libs/vkd3d-shader: Simplify vkd3d_dxbc_compiler_emit_input().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:47 +02:00
Józef Kucia
5fe02889b1
libs/vkd3d-shader: Enable "geometry" capability for SpvBuiltInLayer.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:46 +02:00
Józef Kucia
d74992a119
libs/vkd3d-shader: Do not force input register type to float4.
...
Produces slightly smaller and cleaner SPIR-V code.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:44 +02:00
Józef Kucia
7dce007c53
libs/vkd3d-shader: Add initial support for typed registers.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:42 +02:00
Józef Kucia
270c212265
libs/vkd3d-shader: Do not generate code in vkd3d_dxbc_compiler_get_register_info().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:40 +02:00
Józef Kucia
6cdf3a9fa5
libs/vkd3d-shader: Split SPIR-V built-ins table into two tables.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-26 21:58:38 +02:00
Józef Kucia
a5808cfdd7
libs/vkd3d-shader: Import shader tracing from wined3d.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-29 19:33:04 +02:00
Józef Kucia
b59ad01dd2
libs/vkd3d-shader: Implement SV_RenderTargetArrayIndex.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-29 19:32:41 +02:00
Józef Kucia
a87b3f3fb2
libs/vkd3d-shader: Rename default sampler to dummy sampler.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-24 23:29:32 +02:00
Józef Kucia
40ee9fa0e9
libs/vkd3d-shader: Implement swizzling for shader outputs.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-24 23:29:24 +02:00
Józef Kucia
926f844ead
libs/vkd3d-shader: Rework swizzle macros.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-24 23:29:20 +02:00
Józef Kucia
b901d72877
build: Improve SPIR-V headers detection.
...
Allows building with Vulkan SDK.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-16 22:00:10 +02:00
Józef Kucia
ccc49fe00d
libs/vkd3d-shader: Use unified SPIR-V headers.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-16 22:00:04 +02:00
Józef Kucia
1fe6270307
libs/vkd3d-shader: Translate control point count declarations.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-15 20:00:39 +01:00
Józef Kucia
844c83a837
libs/vkd3d-shader: Avoid Windows data types in public API.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-15 20:00:35 +01:00
Józef Kucia
26c5a1ef73
libs/vkd3d-shader: Implement vDomain.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-06 21:35:30 +01:00
Józef Kucia
2759ea7857
libs/vkd3d-shader: Translate dcl_tessellator_partitioning instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-06 21:35:27 +01:00
Józef Kucia
f1de58c58e
libs/vkd3d-shader: Translate dcl_tessellator_domain instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-06 21:35:24 +01:00
Józef Kucia
8d2c59dd35
libs/vkd3d-shader: Use vkd3d_dxbc_compiler_get_constant_float_vector() in more places.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 18:57:12 +01:00
Józef Kucia
6f2ca74904
libs/vkd3d-shader: Add initial support for arrayed shader inputs.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 18:57:07 +01:00
Józef Kucia
0ecbdbe823
libs/vkd3d-shader: Emit InvocationId for geometry and tessellation shaders.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 18:57:05 +01:00
Józef Kucia
f7cace8216
libs/vkd3d-shader: Translate dcl_gs_instances instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 18:57:02 +01:00
Józef Kucia
f6c708a3cc
libs/vkd3d-shader: Translate geometry shader "cut" instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 18:57:00 +01:00
Józef Kucia
d97e32d035
libs/vkd3d-shader: Translate dcl_input_siv instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-05 18:56:58 +01:00
Józef Kucia
367e55cd59
libs/vkd3d-shader: Force public enums to 32-bit values.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-02 18:49:57 +01:00
Józef Kucia
be8e10e12e
libs/vkd3d-shader: Use our own SPIR-V generator ID.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-02 18:49:55 +01:00
Józef Kucia
b1fc5039c8
libs/vkd3d-shader: Use GLSL.std450 NMin, NMax and NClamp opcodes.
...
This reverts commit 70f5b24f92
.
The bug is fixed in Nvidia drivers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-26 00:24:57 +01:00
Józef Kucia
daebeb3e11
libs/vkd3d-shader: Adjust barrier emission.
...
Aligns with glsang changes which are based on Khronos recommendations.
8297936dd6
838d7afc61
2505057af8
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-26 00:24:53 +01:00
Józef Kucia
38f2d893b1
libs/vkd3d-shader: Translate dcl_input_primitive instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-11 22:31:52 +01:00
Józef Kucia
31ec7b9160
libs/vkd3d-shader: Translate dcl_output_topology instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-11 22:31:50 +01:00
Józef Kucia
fb67ccd159
libs/vkd3d-shader: Translate geometry shader emit instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-11 22:31:48 +01:00
Józef Kucia
374a23bdd8
libs/vkd3d-shader: Introduce separate stream for execution mode declarations.
...
Tessellation and geometry shaders generate a lot of execution mode
declarations.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-11 22:31:47 +01:00
Józef Kucia
4ad1f9683e
libs/vkd3d-shader: Translate dcl_maxout instructions.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-11 22:31:45 +01:00
Józef Kucia
f0bc873e7a
libs/vkd3d-shader: Generate valid SPIR-V for unimplemented registers.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-09 20:37:02 +01:00
Józef Kucia
219b537209
libs/vkd3d-shader: Handle unimplemented registers more gracefully.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-09 20:36:59 +01:00
Józef Kucia
4ae6285c8e
libs/vkd3d-shader: Fix result type for OpImageSampleDref instructions.
...
Per the SPIR-V spec:
"Result Type must be a scalar of integer type or floating-point type."
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-15 16:27:27 +01:00
Józef Kucia
7ee3a02f92
libs/vkd3d-shader: Avoid theoretical crash in vkd3d_dxbc_compiler_emit_dot().
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-14 13:40:26 +01:00
Józef Kucia
006f36c2ac
libs/vkd3d-shader: Introduce vkd3d_dxbc_compiler_get_constant_uint_vector() helper.
...
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-12-14 13:40:20 +01:00
Józef Kucia
e0cb3776c1
libs/vkd3d-shader: Fix discard_z instruction.
2017-12-11 12:55:55 +01:00
Józef Kucia
4e121f8b5d
libs/vkd3d-shader: Implement SV_IsFrontFace.
2017-10-31 15:44:44 +01:00
Józef Kucia
79f80df1ee
libs/vkd3d-shader: Translate dcl_input_ps_sgv instructions.
2017-10-31 15:44:44 +01:00
Józef Kucia
3340cafdc4
libs/vkd3d-shader: Avoid potential stack smashing.
2017-10-25 22:55:39 +02:00
Józef Kucia
f04389d90b
libs/vkd3d-shader: Use more sensible default descriptor binding assignment.
2017-10-25 14:34:44 +02:00
Józef Kucia
e959686f12
libs/vkd3d-shader: Make sure that OpVariables are first instructions in main function.
...
The SPIR-V spec says:
"All OpVariable instructions in a function must be in the first block
in the function. These instructions, together with any immediately
preceding OpLine instructions, must be the first instructions in that
block."
2017-10-25 09:58:14 +02:00
Józef Kucia
b65c42e6f9
libs/vkd3d-shader: Avoid OpVectorShuffle on scalars.
...
The SPIR-V spec states:
"Vector 1 and Vector 2 must both have vector types, with the same
Component Type as Result Type."
2017-10-24 21:26:48 +02:00
Józef Kucia
310335f748
libs/vkd3d-shader: Branch directly to merge block when switch default block is absent.
2017-10-20 18:27:17 +02:00
Józef Kucia
137b5d694b
libs/vkd3d-shader: Move inside_block field to vkd3d_control_flow_info.
2017-10-18 19:02:46 +02:00
Józef Kucia
c112f2ed46
libs/vkd3d-shader: Get rid of VKD3D_BLOCK_ELSE.
2017-10-18 19:02:46 +02:00
Józef Kucia
9f831b938a
libs/vkd3d-shader: Avoid emitting empty else branches.
...
We have to patch SpvOpBranchConditional instruction when emitting the
else block because we do not know if an else block is present in
advance.
2017-10-18 19:02:46 +02:00
Józef Kucia
646385e871
libs/vkd3d-shader: Get rid of VKD3D_BLOCK_MAIN.
2017-10-18 19:02:46 +02:00
Józef Kucia
8a047a8eb7
libs/vkd3d-shader: Rename control flow union member for if instructions.
2017-10-18 19:02:46 +02:00
Józef Kucia
0369f39a47
libs/vkd3d-shader: Generate correct SPIR-V for rcp with multiple components.
2017-10-18 12:21:24 +02:00
Józef Kucia
c5e400fa30
libs/vkd3d-shader: Document hacks introduced for Nvidia driver.
...
See 70f5b24f92
.
2017-10-12 17:47:53 +02:00
Józef Kucia
2171ba6d32
libs/vkd3d-shader: Decrement OpAtomicIDecrement result.
2017-10-12 13:10:26 +02:00
Józef Kucia
586e1cc532
libs/vkd3d-shader: Implement relative addressing for constant buffers.
2017-10-06 17:06:31 +02:00
Józef Kucia
5479ac7011
libs/vkd3d-shader: Always emit default block for OpSwitch.
...
The default block is required in SPIR-V.
2017-10-05 15:58:51 +02:00
Józef Kucia
9feb7a3956
libs/vkd3d-shader: Recognize nop instruction.
2017-10-05 15:58:51 +02:00
Józef Kucia
e7aa2a7bcf
libs/vkd3d-shader: Emit NonReadable decoration for image variables.
...
Fixes image writes for UNORM formats on Anv. Anv uses special surface
state for write-only storage image descriptors.
The SPIR-V spec doesn't state that the NonReadable decoration is
required for images used with StorageImageWriteWithoutFormat. On the
other hand, glslang requires the 'writeonly' keyword for images without
format, and it emits the NonReadable decoration.
2017-09-26 10:37:41 +02:00
Józef Kucia
5a020d6673
libs/vkd3d-shader: Implement shader visibility for descriptors.
2017-09-22 16:42:07 +02:00
Józef Kucia
602f9780f8
libs/vkd3d-shader: Implement "sample" interpolation qualifier.
2017-09-14 15:38:19 +02:00
Józef Kucia
6b757f3002
libs/vkd3d-shader: Subtract BaseInstance from InstanceIndex.
...
Depends on SPV_KHR_shader_draw_parameters extension.
2017-09-12 17:42:42 +02:00
Józef Kucia
b19fe74284
libs/vkd3d-shader: Export shader signature parsing.
2017-09-11 22:35:16 +02:00
Józef Kucia
b61c785bd0
libs/vkd3d-shader: Implement SV_InstanceID.
2017-09-11 22:35:16 +02:00
Józef Kucia
30cd4cc59f
libs/vkd3d-shader: Always declare format for raw/structured image variables.
2017-09-07 17:48:43 +02:00
Józef Kucia
4af15035df
libs/vkd3d-shader: Improve some debug messages.
2017-09-07 17:48:43 +02:00
Józef Kucia
3191e1eaa9
libs/vkd3d-shader: Implement UAV counters instructions.
2017-09-07 17:15:54 +02:00
Józef Kucia
5ef6f71996
libs/vkd3d-shader: Emit declarations for UAV counters.
2017-09-07 17:15:54 +02:00
Józef Kucia
7416c83ae2
libs/vkd3d-shader: Rename vkd3d_descriptor_type to vkd3d_shader_descriptor_type.
2017-09-07 17:15:54 +02:00
Józef Kucia
efdf2ec691
libs/vkd3d-shader: Rename vkd3d_shader_push_constant to vkd3d_shader_push_constant_buffer.
...
This should be clearer. Multiple constant buffers can be assigned to
a single push constant range.
2017-09-07 17:15:54 +02:00
Józef Kucia
ea8e5eaaba
libs/vkd3d-shader: Introduce vkd3d_dxbc_compiler_emit_store_dst_swizzled() helper function.
2017-09-04 18:33:09 +02:00
Józef Kucia
3a4a71905e
libs/vkd3d-shader: Implement texel offset for gather4.
2017-09-04 12:46:52 +02:00
Józef Kucia
293ce313ac
libs/vkd3d-shader: Translate gather4 instructions.
2017-09-04 12:46:52 +02:00
Józef Kucia
72b109d380
libs/vkd3d-shader: Factor out vkd3d_spirv_build_image_instruction() function.
2017-08-31 09:29:02 +02:00
Józef Kucia
7c67665032
libs/vkd3d-shader: Implement ld_{raw, structured} for UAVs.
2017-08-30 16:41:41 +02:00
Józef Kucia
87a2fec426
libs/vkd3d-shader: Translate discard instructions.
2017-08-30 16:41:41 +02:00
Józef Kucia
99b72d4db1
libs/vkd3d-shader: Implement sample_l.
2017-08-30 16:41:41 +02:00
Józef Kucia
5b8d1fbdd5
libs/vkd3d-shader: Implement sample_c_lz.
2017-08-30 16:41:41 +02:00
Józef Kucia
9b8260a246
libs/vkd3d-shader: Translate ld_uav_typed instructions.
2017-08-28 19:10:23 +02:00
Józef Kucia
b5c89fa89f
libs/vkd3d-shader: Implement atomic compare exchange instructions.
2017-08-28 11:01:23 +02:00
Józef Kucia
482af89416
libs/vkd3d-shader: Implement remaining binary atomic instructions.
2017-08-28 11:01:23 +02:00
Józef Kucia
4e300ab1d4
libs/vkd3d-shader: Translate imm_atomic_iadd instructions.
2017-08-24 17:00:16 +02:00
Józef Kucia
cb166fbd5a
libs/vkd3d-shader: Translate atomic_umax instructions.
2017-08-24 17:00:16 +02:00
Józef Kucia
d464c9033f
libs/vkd3d-shader: Translate atomic_umin instructions.
2017-08-24 17:00:16 +02:00
Józef Kucia
a836cc2fe3
libs/vkd3d-shader: Translate atomic_or instructions.
2017-08-24 17:00:16 +02:00
Józef Kucia
1c4b9be079
libs/vkd3d-shader: Implement store_{raw,structured} for TGSM.
2017-08-24 15:13:38 +02:00
Józef Kucia
f7f7c6d889
libs/vkd3d-shader: Implement ld_raw.
2017-08-24 15:13:38 +02:00
Józef Kucia
a94751398b
libs/vkd3d-shader: Add support for atomic instructions on TGSM.
2017-08-24 15:13:38 +02:00
Józef Kucia
61dd701284
libs/vkd3d-shader: Translate imm_atomic_exch instructions.
2017-08-24 15:13:38 +02:00
Józef Kucia
eba87fa55b
libs/vkd3d-shader: Implement ld_structured for TGSM.
2017-08-24 15:13:38 +02:00
Józef Kucia
cf5fb3fbc2
libs/vkd3d-shader: Fix swizzle for raw/structured instructions.
2017-08-24 15:13:38 +02:00
Józef Kucia
4bfd0456e5
libs/vkd3d-shader: Refactor raw/structured buffer addressing.
...
In prep for TGSM support.
2017-08-24 15:13:38 +02:00
Józef Kucia
4d0b4f4f71
libs/vkd3d-shader: Add vkd3d_spirv_build_op_composite_extract1() function.
2017-08-24 11:11:16 +02:00
Józef Kucia
cef35c7c76
libs/vkd3d-shader: Translate dcl_tgsm_structured instructions.
2017-08-24 11:11:16 +02:00
Józef Kucia
9ed0feed12
libs/vkd3d-shader: Translate dcl_tgsm_raw instructions.
2017-08-24 11:11:16 +02:00
Józef Kucia
19c1b81a71
libs/vkd3d-shader: Translate sync instructions.
2017-08-24 11:11:16 +02:00
Józef Kucia
6c5d8da24d
libs/vkd3d-shader: Store structure stride in symbol table.
2017-08-22 14:53:33 +02:00
Józef Kucia
eb5e7a4412
libs/vkd3d-shader: Implement ld_structured for SRVs.
2017-08-22 12:39:56 +02:00
Józef Kucia
d5697448eb
libs/vkd3d-shader: Translate dcl_resource_structured instructions.
2017-08-22 12:39:56 +02:00
Józef Kucia
77e47eddb9
libs/vkd3d-shader: Translate dcl_resource_raw instructions.
2017-08-22 12:39:56 +02:00
Józef Kucia
6ffe54b9ec
libs/vkd3d-shader: Translate round_z instructions.
2017-08-22 12:39:56 +02:00
Józef Kucia
0f7c86e2bd
libs/vkd3d-shader: Translate store_structured instructions.
2017-08-21 16:30:33 +02:00
Józef Kucia
03e189386a
libs/vkd3d-shader: Translate atomic_iadd instructions.
2017-08-21 12:41:07 +02:00
Józef Kucia
d287591889
libs/vkd3d-shader: Set image format for UAV typed reads and atomic instructions.
2017-08-21 12:41:07 +02:00
Józef Kucia
41b7c46c3e
libs/vkd3d-shader: Translate dcl_uav_structured instructions.
2017-08-18 14:52:40 +02:00
Józef Kucia
8f631c8b0c
libs/vkd3d-shader: Make bytecode parser responsible for setting scalar register write masks.
2017-08-18 14:52:40 +02:00
Józef Kucia
ca9cc355b4
libs/vkd3d-shader: Recognize oDepth register.
2017-08-18 14:52:40 +02:00
Józef Kucia
dc7f65122d
libs/vkd3d-shader: Silence push constant size mismatch FIXMEs().
...
This generally doesn't mean anything. It may only be an issue
for out of bounds accesses.
2017-08-17 12:13:50 +02:00
Józef Kucia
ef2f490b20
libs/vkd3d-shader: Do not try to find matching signature element for system-value inputs.
...
Silences false-positive FIXME() messages.
2017-08-17 12:13:50 +02:00
Józef Kucia
242ef52d8b
libs/vkd3d-shader: Translate sample_c instructions.
...
Nvidia expects that the D_ref is packed together with texture
coordinates. The D_ref parameter is ignored.
This isn't a problem for glslang because in GLSL D_ref is generally
passed together with texture coordinates.
2017-08-16 17:38:33 +02:00
Józef Kucia
2527f820cd
libs/vkd3d-shader: Cleanup vkd3d_dxbc_compiler_prepare[_sampled]_image() functions.
2017-08-16 17:38:33 +02:00
Józef Kucia
1857fdc1bc
libs/vkd3d-shader: Translate ld instructions.
2017-08-16 13:11:52 +02:00
Józef Kucia
e3d6bac31b
libs/vkd3d-shader: Introduce vkd3d_shader_interface structure.
2017-08-16 13:11:52 +02:00
Józef Kucia
e6f6d01489
libs/vkd3d-shader: Implement resinfo for SRVs.
2017-08-16 13:11:52 +02:00
Józef Kucia
f82a90ff78
libs/vkd3d-shader: Fix write mask for vPrim register.
2017-08-15 11:25:10 +02:00
Józef Kucia
17e49dc6c6
libs/vkd3d-shader: Translate store_raw instructions.
2017-08-11 13:58:04 +02:00
Józef Kucia
5aefd2c9e4
libs/vkd3d-shader: Translate dcl_uav_raw instructions.
2017-08-11 13:58:04 +02:00
Józef Kucia
2665cbe522
libs/vkd3d: Duplicate Vulkan descriptors for SRVs and UAVs.
...
Vulkan has different descriptor types for buffers and textures.
Therefore, we do not know the exact Vulkan descriptor type for D3D12 SRV
and UAV descriptors up front. This information can be extracted from
shaders when creating PSOs but creating incompatible Vulkan descriptor
set layouts for PSOs with the same root signature would introduce a lot
of complexity.
In order to preserve compatibility between resource bindings for PSOs
with the same root signature we duplicate Vulkan descriptors for SRVs
and UAVs (a buffer view and an image view descriptor). This strategy may
be reasonable for small root signatures.
2017-08-08 17:09:35 +02:00
Józef Kucia
cb86c9c8d0
libs/vkd3d-shader: Implement resinfo for UAVs.
2017-08-08 17:09:35 +02:00
Józef Kucia
eb4c98db17
libs/vkd3d-shader: Add support for switch breaks nested in conditional branches.
2017-08-01 13:55:49 +02:00
Józef Kucia
6b93e6ce99
libs/vkd3d-shader: Add support for switch fall-through blocks.
2017-08-01 13:55:49 +02:00
Józef Kucia
fbeaf0ba95
libs/vkd3d-shader: Make sure that inserted chunks are sorted.
...
The list is expected to be empty or very small so insertion sort should
be fine.
2017-08-01 13:55:49 +02:00
Józef Kucia
3effb4b18c
libs/vkd3d-shader: Get rid of artificial limit for switch case blocks.
2017-08-01 11:38:10 +02:00
Józef Kucia
ae8d8036c6
libs/vkd3d-shader: Implement switch control flow instructions.
2017-08-01 10:51:45 +02:00
Józef Kucia
5061dbaf0c
libs/vkd3d-shader: Add mechanism for inserting words into SPIR-V streams.
...
Allows inserting SPIR-V instructions at arbitrary locations in SPIR-V
streams.
2017-08-01 10:51:45 +02:00
Józef Kucia
c1c94e248c
libs/vkd3d-shader: Allow multiple push constant buffers.
2017-08-01 10:51:45 +02:00
Józef Kucia
d75966ab9e
libs/vkd3d: Assign non-overlapping push constant ranges for root constants.
2017-08-01 10:51:45 +02:00
Józef Kucia
fec337a03c
libs/vkd3d-shader: Fix memory leak in vkd3d_dxbc_compiler_destroy().
2017-07-28 12:56:18 +02:00
Józef Kucia
9725eb3763
libs/vkd3d-shader: Remove double semicolons.
2017-07-28 12:56:18 +02:00
Józef Kucia
92fcb9ffa2
libs/vkd3d-shader: Add support for push constants.
2017-07-27 15:24:38 +02:00
Józef Kucia
edd1e9602d
libs/vkd3d-shader: Implement arbitrary mappings from D3D shader register to Vulkan descriptors.
...
An arbitrary mapping can be passed to vkd3d_shader_compile_dxbc().
2017-07-26 13:45:25 +02:00
Józef Kucia
6c174beb4b
libs/vkd3d-shader: Use component types from input signatures for shader inputs.
...
Fixes Vulkan validation layers errors.
2017-07-25 14:23:27 +02:00
Józef Kucia
5a2ebc62f6
libs/vkd3d-shader: Use component types from output signatures for shader outputs.
...
Fixes Vulkan validation layers errors.
2017-07-25 14:23:27 +02:00
Józef Kucia
a0e82064dc
libs/vkd3d-shader: Mask coordinates for OpImageWrite instructions.
2017-07-24 19:43:50 +02:00
Józef Kucia
046afde8db
libs/vkd3d-shader: Store resource type info in table.
2017-07-24 19:43:50 +02:00
Józef Kucia
aa3465ac83
libs/vkd3d-shader: Fix bitcasts for shader inputs.
2017-07-24 19:43:50 +02:00
Józef Kucia
c71d609fb6
libs/vkd3d-shader: Fix write mask for vThreadIDInGroupFlattened.
2017-07-24 19:43:50 +02:00
Józef Kucia
6bbd6c948a
libs/vkd3d-shader: Translate store_uav_typed instructions.
2017-07-24 19:43:50 +02:00
Józef Kucia
4746833a6f
libs/vkd3d-shader: Translate dcl_uav_typed instructions.
2017-07-24 19:43:50 +02:00
Józef Kucia
ea6b35ef58
libs/vkd3d-shader: Translate udiv instructions.
2017-07-21 14:14:42 +02:00
Józef Kucia
c73b201110
libs/vkd3d-shader: Do not print FIXMEs for known global flags.
2017-07-21 14:14:42 +02:00
Józef Kucia
95b6b7b91b
libs/vkd3d-shader: Clean up vkd3d_dxbc_compiler_emit_control_flow_instruction().
2017-07-21 14:14:42 +02:00
Józef Kucia
18c06c8022
libs/vk3d-shader: Translate break instructions for loops.
2017-07-20 13:32:40 +02:00
Józef Kucia
1cbf6ebddf
libs/vk3d-shader: Fix return instructions in if/else blocks.
2017-07-20 13:32:40 +02:00
Józef Kucia
2022702858
libs/vkd3d-shader: Translate breakc instructions.
2017-07-20 13:32:40 +02:00
Józef Kucia
98c307cdbc
libs/vkd3d-shader: Implement loops.
2017-07-20 13:32:40 +02:00
Józef Kucia
f6f70d8c02
libs/vkd3d-shader: Add support for nested control flow.
2017-07-20 13:32:40 +02:00
Józef Kucia
1e9a38005b
libs/vkd3d-shader: Use vkd3d_spirv_build_once mechanism for SPIR-V constants.
2017-07-19 14:45:54 +02:00
Józef Kucia
ab78c23170
libs/vkd3d-shader: Translate round_{ni,pi} instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
fed8155d08
libs/vkd3d-shader: Translate rcp instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
a4e5d06cac
libs/vkd3d-shader: Translate log instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
87f34094db
libs/vkd3d-shader: Translate imul instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
b75022df72
libs/vkd3d-shader: Translate more integer comparison instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
e8edbac33f
libs/vkd3d-shader: Translate more integer ALU instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
dddd97f126
libs/vkd3d-shader: Translate imad instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
be276b4182
libs/vkd3d-shader: Translate frc instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
aa8ce19b2e
libs/vkd3d-shader: Translate exp instructions.
2017-07-19 13:53:59 +02:00
Józef Kucia
e307beee29
libs/vkd3d-shader: Fix immediate constant buffers.
2017-07-18 17:32:26 +02:00
Józef Kucia
2420fdb3af
libs/vkd3d-shader: Add support for vThreadGroupID register.
2017-07-18 17:32:26 +02:00
Józef Kucia
79e61d95df
libs/vkd3d-shader: Fix shader input register mask handling.
2017-07-18 17:32:26 +02:00
Józef Kucia
78a085199f
libs/vkd3d-shader: Use vkd3d_get_spirv_builtin() directly.
2017-07-18 17:32:26 +02:00
Józef Kucia
9d944ad96c
libs/vkd3d-shader: Store info about SPIR-V built-ins in table.
2017-07-18 17:32:26 +02:00
Józef Kucia
e5a4ad3385
libs/vkd3d-shader: Add support for vThreadIDInGroupFlattened register.
2017-07-18 17:32:26 +02:00
Józef Kucia
caa1f4a37a
libs/vkd3d-shader: Allow compute shader registers as source operands.
2017-07-18 17:32:26 +02:00
Józef Kucia
9d319bbc3d
libs/vkd3d-shader: Translate swapc instructions.
2017-07-18 13:31:46 +02:00
Józef Kucia
3407702d60
libs/vkd3d-shader: Avoid duplicated OpTypeImage instructions.
2017-07-17 18:12:02 +02:00
Józef Kucia
758247de4d
libs/vkd3d-shader: Avoid duplicated OpTypeSampledImage instructions.
2017-07-17 18:12:02 +02:00
Józef Kucia
42d8b97176
libs/vkd3d-shader: Avoid duplicated OpTypePointer instructions.
2017-07-17 18:12:02 +02:00
Józef Kucia
e715a6d1c9
libs/vkd3d-shader: Add more general way to emit SPIR-V instructions once.
2017-07-17 18:12:02 +02:00
Józef Kucia
3dc307bfb8
libs/vkd3d-shader: Make SPIR-V builder responsible for emitting parameterless types once.
2017-07-17 18:12:02 +02:00
Józef Kucia
acb683690b
libs/vkd3d-shader: Make SPIR-V builder responsible for emitting OpTypeSampler once.
2017-07-17 18:12:02 +02:00
Józef Kucia
cc536e72ab
libs/vkd3d-shader: Translate sample instructions.
2017-07-17 16:25:29 +02:00
Józef Kucia
e86f7fc82e
libs/vkd3d-shader: Translate dcl_resource instructions.
2017-07-17 16:25:29 +02:00
Józef Kucia
4854b74151
libs/vkd3d-shader: Introduce vkd3d_dxbc_compiler_emit_swizzle() helper function.
2017-07-14 17:21:23 +02:00
Józef Kucia
96f5bb3936
libs/vkd3d-shader: Use vkd3d_dxbc_compiler_emit_load_src() for dot product instructions.
...
Fixes source modifiers for dot product instructions.
2017-07-14 17:21:23 +02:00
Józef Kucia
7c606089f1
libs/vkd3d-shader: Add FIXME comment for local function variables.
2017-07-14 13:44:35 +02:00
Józef Kucia
a47724ce3a
libs/vkd3d-shader: Translate dcl_sampler instructions.
2017-07-14 13:44:35 +02:00
Józef Kucia
cd07a50b21
libs/vkd3d-shader: Implement relative addressing for immediate constant buffers.
2017-07-11 17:23:02 +02:00
Józef Kucia
1a8b74549a
libs/vkd3d-shader: Use vkd3d_dxbc_compiler_emit_variable() in vkd3d_dxbc_compiler_emit_dcl_temps().
2017-07-11 17:23:02 +02:00
Józef Kucia
c8d713dc83
libs/vkd3d-shader: Implement immediate constant buffers.
2017-07-11 17:23:02 +02:00
Józef Kucia
d8d5701409
libs/vkd3d-shader: Use appropriate message severity for invalid SPIR-V shaders.
2017-07-11 17:23:02 +02:00
Józef Kucia
682e725d6e
libs/vkd3d-shader: Add support for multiple shader outputs packed into single register.
2017-07-10 15:33:34 +02:00
Józef Kucia
7f1242888e
libs/vkd3d-shader: Recognize vThreadIDInGroup register.
2017-07-10 15:33:34 +02:00
Józef Kucia
2e6f80e24c
libs/vkd3d-shader: Pass buffer size to vkd3d_dxbc_compiler_get_register_name().
2017-07-10 15:33:34 +02:00
Józef Kucia
649a814b23
libs/vkd3d-shader: Use ERR() instead of FIXME() in vkd3d_dxbc_compiler_emit_ext_glsl_instruction().
...
vkd3d_dxbc_compiler_emit_ext_glsl_instruction() is called only for
implemented instructions.
2017-07-10 15:33:34 +02:00