Philip Rebohle
89dbd9254f
vkd3d-shader: Implement atomic operations on SSBOs.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Philip Rebohle
f12f15ff38
vkd3d-shader: Implement raw and structured stores to SSBOs.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Philip Rebohle
2d2dc323d5
vkd3d-shader: Implement raw and structured loads from SSBOs.
2020-10-16 14:24:36 +02:00
Philip Rebohle
367cda017f
vkd3d-shader: Implement resource declarations with raw SSBOs.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-10-16 14:24:36 +02:00
Hans-Kristian Arntzen
85dbb6c569
vkd3d-shader: Support StorageImageReadWithoutFormat.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-12 14:55:24 +02:00
Hans-Kristian Arntzen
e7281f22c6
vkd3d-shader: Add NonUniformEXT decoration where required.
...
It's the argument to the opcode which consumes the final resource handle
or pointer which needs to marked as NonUniformEXT. Was missing this for
sampled images and bindless UAV counters.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-30 10:57:50 +02:00
Philip Rebohle
b16276f9d6
vkd3d-shader: Support bindless UAV counters through texel buffer array.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle
40764d82ef
vkd3d-shader: Introduce VKD3D_SHADER_BINDING_FLAG_RAW_VA.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Hans-Kristian Arntzen
96402f1164
vkd3d: Fix straggling warnings for MSVC.
...
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-16 13:00:09 +02:00
Hans-Kristian Arntzen
7bccab7427
debug: Re-introduce different debug channels.
...
vkd3d-shader is currently kinda buggy and crashes when you try to trace
DXBC. This used to never be run since it was guarded by
VKD3D_SHADER_DEBUG, but with the move to a static build we merged all
debug logging under VKD3D_DEBUG. Reintroduce different debug channels in
a way that is compatible with a statically linked vkd3d.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 14:18:15 +02:00
Joshua Ashton
12e4014b54
vkd3d-shader: Fix incorrect assertion
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Joshua Ashton
8af31b5105
vkd3d-shader: Fix potential buffer overrun for image_operands
...
This would happen if you both sampled with both a texel offset and were LOD masked.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-29 15:26:54 +02:00
Joshua Ashton
d1b58f954e
vkd3d-shader: Fix buffer overrun for bindless constant loads
...
Previously, last_index would be 4 by the time it got to the loop if we were bindless -- which corrupted the component_ids that were being written.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-29 15:26:54 +02:00
Joshua Ashton
9564f57a69
vkd3d-shader: Fix incorrect use of static in ext arrays
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-26 15:42:41 +02:00
Joshua Ashton
ce7eba6210
vkd3d-shader: Fix incorrect type enum in global binding
...
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-26 15:42:41 +02:00
Joshua Ashton
0b6d460813
vkd3d-shader: Fix wrong enum for {CLIP,CULL}_DISTANCE
...
The wrong enum was used here... It was just returning the same thing
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-26 15:42:41 +02:00
Krzysztof Bogacki
c11d3eed17
vkd3d: Remove SPIRV-Tools-based debugging code
...
Signed-off-by: Krzysztof Bogacki <krzysztof.bogacki@leancode.pl>
2020-06-26 13:43:08 +02:00
Joshua Ashton
da2c9a1043
vkd3d: Eliminate HAVE_SPIRV_UNIFIED1_SPIRV_H and HAVE_SPIRV_UNIFIED1_GLSL_STD_450_H
...
These are submodules now.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-23 14:55:43 +02:00
Joshua Ashton
bfd7127284
vkd3d-shader: Don't use return value semantics in void functions
...
Fixes warnings in MSVC.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 12:13:54 +02:00
Joshua Ashton
b9909854fe
vkd3d: Make nameless unions really nameless
...
This makes it consistent across tests and vkd3d.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-15 19:59:52 +02:00
Philip Rebohle
4cf8467b9d
vkd3d-shader: Introduce vkd3d_dxbc_compiler_find_register_info.
...
Does not generate logs when not finding a register, which reduces
some misleading spam in Anno 1800 tessellation shaders.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-15 13:32:55 +02:00
Hans-Kristian Arntzen
b3be23c066
vkd3d-shader: Only sample with the required number of components.
...
Works around a driver bug on NV which affected RE2 in particular, but
probably other titles as well.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-05-22 11:54:04 +02:00
Philip Rebohle
6478632dca
vkd3d-shader: Remove old Nvidia workaround for dref instructions.
...
This was fixed two years ago in the 396 and later 390 drivers.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
37b9875e98
vkd3d-shader: Implement sparse ld_uav_typed instruction.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
a1b2cef928
vkd3d-shader: Implement sparse ld_raw and ld_structured instructions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
7b9dbdc4ce
vkd3d-shader: Implement sparse ld instructions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
bb5e0969b2
vkd3d-shader: Implement sparse gather instructions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
1839d13ef3
vkd3d-shader: Implement sparse sample_c instructions.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
45ec9b7f27
vkd3d-shader: Implement sparse sample instructions.
...
In addition to sparse feedback, these instructions also clamp the
LOD, with the minimum LOD being passed in as the last parameter.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
c09b66f404
vkd3d-shader: Implement check_access_fully_mapped instruction.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
277f731bd7
vkd3d-shader: Add helpers to deal with sparse instruction results.
...
OpImageSparse* operations return a struct containing a status value
and the sampled value, so we need to take it apart when storing results.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
26f6e59f3e
vkd3d-shader: Add helper to declare a struct once.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle
bbfbf94c5e
vkd3d-shader: Always use private vars for arrayed builtins.
...
Fixes invalid shader code being generated in Monster Hunter World.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-16 10:30:51 +02:00
Philip Rebohle
0c2057ff68
vkd3d-shader: Support texel offset for sample_c instruction.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-16 10:30:51 +02:00
Philip Rebohle
407c740927
vkd3d: Rework vkd3d_dxbc_compiler_get_resource_binding.
...
Instead of taking the resource type, take the binding flag.
This allows us to also use this function for UAV counters.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-10 14:32:33 +02:00
Philip Rebohle
56df26d845
vkd3d-shader: Implement support for stencil export.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-06 11:53:09 +02:00
Philip Rebohle
3ee4ab56d7
vkd3d-shader: Enable SPV_EXT_shader_viewport_index_layer if necessary.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-06 11:53:09 +02:00
Philip Rebohle
c07f46f09c
vkd3d-shader: Look up existing register fpr built-in outputs.
...
Otherwise, if two built-in outputs share the same register, we
may end up multiple redundant private variables, only one of
which gets initialized, leading to uninitialized outputs.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-06 11:53:09 +02:00
Philip Rebohle
4d896bf53c
vkd3d-shader: Use correct addressing model for physical storage buffers.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:04:23 +01:00
Philip Rebohle
aca3e7636e
vkd3d-shader: Implement bindless UAV counter ops.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:04:23 +01:00
Philip Rebohle
cb9775ca05
vkd3d-shader: Respect bindless flag for UAV counter bindings.
...
Also stores the type ID of the pointer to the UAV counter struct,
since we need to load the pointer before we can access the counter.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:04:23 +01:00
Philip Rebohle
11a9ac6c19
vkd3d-shader: Emit declarations for bindless UAV counters.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:04:23 +01:00
Philip Rebohle
3fa194ce21
vkd3d-shader: Support nonuniform qualifier for bindless UAVs.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle
fb92b7c113
vkd3d-shader: Emit bindless UAV declarations.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle
8dd73f3e45
vkd3d-shader: Explicitly pass flags to get_global_binding.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle
a0c1ce4e55
vkd3d-shader: Explicitly pass image format to get_global_binding.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle
18caa8adc3
vkd3d-shader: Pass resource binding struct to get_global_binding.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle
81ee079449
vkd3d-shader: Move atomic counter declaration.
...
Allows us to have bindless UAVs without a special code path
for bindless UAV counters for now.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-26 12:05:47 +01:00
Philip Rebohle
a9ba32a6c4
vkd3d-shader: Add option to declare bindless CBVs as SSBOs.
...
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Philip Rebohle
5bf4b207f2
vkd3d-shader: Bound-check root constant reads.
...
Safety measure in case a broken app performs out-of-bounds reads.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 11:57:35 +01:00