Commit Graph

607 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen 06cf1441ad vkd3d-shader: Support non-BDA bindless UAV counters in DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-29 17:15:00 +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 8800ae7323 vkd3d-shader: Add declspec hidden to shader dumping entry points.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-27 11:14:49 +02:00
Hans-Kristian Arntzen 7083b30fd5 vkd3d-shader: Dump DXIL blobs to .dxil.
Makes it easier to extract all DXIL shaders when debugging.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-27 11:14:49 +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 7b0345a149 vkd3d-shader: Add way to scan for expected patch vertex count from HS.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +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
Hans-Kristian Arntzen 854814d81c vkd3d: Fix various minor warnings.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-10 14:18:15 +02:00
Joshua Ashton 19c910904b vkd3d-shader: Use uint32 for immediate constants
DWORD and uint32_t are different types on Windows.
Fixes warnings.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +02:00
Joshua Ashton 77679e8b32 vkd3d-shader: Split read_dword into read_uint32
On Windows, DWORD is unsigned long, which means it's technically a different pointer type.

Let's keep type safety (as much as we can in C) and remove some warnings.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-03 16:56:10 +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 079a012dab build: Use Meson subproject for dxil-spirv
Removes the CMake dependency and solves some trouble building.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-26 18:33:27 +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 161dc007c5 build: Link dxil-spirv statically
Don't need to link this in any fancy way

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:18:56 +02:00
Joshua Ashton 22545c189a vkd3d-shader: Build statically
We don't need this to be another random so floating around...

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:18:56 +02:00
Joshua Ashton 4521b253dd vkd3d: Toss VKD3D_DEBUG_ENV_NAME
Creates linking problems if we want to build vkd3d-shader statically given this links back to something in vkd3d-common.

We don't need this distinction anyways...

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 15:18:56 +02:00
Joshua Ashton 8c216e637c build: Add Meson build system
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-23 14:55:43 +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
Philip Rebohle bc7426ceb0 vkd3d-shader: Fix modifier handling.
This is a set of flags, so we should treat it as such.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-09 13:20:36 +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 6d0c1b4dd3 vkd3d-shader: Handle feedback instructions in UAV read scanner.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle fa029a1a84 vkd3d-shader: Add definitions for sparse feedback instructions.
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
Hans-Kristian Arntzen 671560c4e3 vkd3d-shader: Allow bindless UAV counters in DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-27 15:43:19 +01:00
Hans-Kristian Arntzen 31a2a308ee vkd3d-shader: Enable physical storage extension in DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-27 15:43:19 +01: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