Commit Graph

721 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen 0f971790e6 vkd3d-shader: Attempt to parse ISG1 as well when parsing input signatures.
DXIL blobs use ISG1.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 15:20:10 +01:00
Hans-Kristian Arntzen 4a9ab29903 vkd3d-shader: Add helper function to query if a blob is DXIL.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 15:20:10 +01:00
Hans-Kristian Arntzen edd4c990ed vkd3d-shader: Move vkd3d_find_shader into private header.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-27 15:20:10 +01:00
Philip Rebohle 82f9f76931 vkd3d-shader: Rework SPIR-V extension enablement.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-27 10:30:34 +01:00
Philip Rebohle 7cccf5756a vkd3d-shader: Rework SPIR-V capability enablement.
We're going to need more capabilities outside the 0-63 range
going forward, so a bitmask doesn't cut it and adding extra
struct members for each capability seems excessive.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-27 10:30:34 +01:00
Hans-Kristian Arntzen 0c241ff54f vkd3d: Fix regression with UAV counters.
Need to report back actual bindings, not 0/0.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-26 13:00:10 +01:00
Philip Rebohle 27595a8147 vkd3d-shader: Drop support for OpenGL targets.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Philip Rebohle c4c9fa82b0 vkd3d-shader: Drop support for combined resource samplers.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Philip Rebohle c3871951ad vkd3d-shader: Factor out methods to retrieve resource binding info.
Allows us to get more detailed info about any given binding.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Philip Rebohle 74e706cbe3 vkd3d-shader: Introduce vkd3d_shader_descriptor_type_from_register_type helper.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Philip Rebohle d95762db65 vkd3d-shader: Also log register space for unmapped bindings.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-26 10:18:30 +01:00
Hans-Kristian Arntzen 93e4b6ff9b vkd3d: Deal correctly with SM 5.1 register spaces.
Resource index is found in idx[0] in SM 5.0, but idx[1] when using SM
5.1, and register space is encoded separately. An rb_tree keeps track of
the internal resource index idx[0] and can map that to space/binding as
required when emitting SPIR-V.

For this to work, we must also make UAV counters register space aware.
In earlier implementation, UAV counter mask was assumed to correlate 1:1
with register_index, which breaks on SM 5.1.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-24 12:32:29 +01:00
Hans-Kristian Arntzen 022500044f vkd3d-shader: Use correct register offset.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Hans-Kristian Arntzen c6fd8e442a vkd3d-shader: Fix TessFactor order for isolines.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Hans-Kristian Arntzen 5a7ebf7630 vkd3d-shader: Deal with reading packed TessFactor in DS.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Hans-Kristian Arntzen 185c037f98 vkd3d-shader: Compute XfbOffset per buffer.
Fixes Hairworks GPU crash on Metro Exodus.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-12 14:15:55 +01:00
Philip Rebohle 4bdec95f37 vkd3d-shader: Clean up vkd3d_dxbc_compiler_emit_shader_phase_input.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-12 14:15:55 +01:00
Philip Rebohle 934646027a vkd3d-shader: Allow hull shader join phases to read patch constants.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-12 14:15:55 +01:00
Philip Rebohle 6e4fc511f9 vkd3d-shader: Add missing lookups to vkd3d_siv_from_sysval_indexed.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-12 14:15:55 +01:00
Philip Rebohle 7c092a0640 vkd3d-shader: Don't re-declare inputs in default control point phase.
Otherwise, we delcare certain input control points twice in shaders that
access them in a fork phase, which is not allowed as per Vulkan spec:

    "Any two inputs listed as operands on the same OpEntryPoint must not
     be assigned the same location, either explicitly or implicitly"

Fixes invalid SPIR-V and resulting RADV driver crashes in Metro Exodus.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-02-12 14:15:55 +01:00
Henri Verbeet d0586297c5 vkd3d-shader: Handle VKD3DSPR_GSINSTID in vkd3d_dxbc_compiler_get_register_name().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:11:22 +01:00
Henri Verbeet ebac7ee24c vkd3d-shader: Avoid declaring outputs multiple times with incompatible types.
This would cause CoreValidation-Shader-InterfaceTypeMismatch validation
errors from Wine's test_shader_interstage_interface() d3d11 test. This
reverts parts of commits 1eb7eca411 and
04ec461fb4.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:11:20 +01:00
Henri Verbeet 61799500e2 vkd3d-shader: Handle normalised types in vkd3d_component_type_from_data_type().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:11:18 +01:00
Philip Rebohle 6c65f1b814 vkd3d-shader: Support vicp inputs for hull shader fork/join phases.
This case needs special care since both VKD3DSPR_INPUT in the
control point phase and VKD3DSPR_INCONTROLPOINT in fork/join
phases refer to the same set of input variables, and we should
not declare input variables with the same location twice.

Encountered in Shadow of the Tomb Raider.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 19:24:33 +01:00
Philip Rebohle 1eb7eca411 vkd3d-shader: Don't redundantly override shader output info.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:18:23 +01:00
Philip Rebohle 0e00448229 vkd3d-shader: Handle tessellation factor built-ins in emit_output.
Uses the private patch constant array for tessellation factor built-ins.
Fixes two separate issues encountered in Shadow of the Tomb Raider:

- The output registers that have one component mapped to any of
  the TESS_FACTOR sysvals can have their other components mapped
  to a regular patch constant output, in which case we need to
  use a private io variable.

- The tessellation factor outputs are not necessarily dynamically
  indexed within shader code. Previously, this did not work correctly
  and lead to invalid store operations in the generated SPIR-V.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:17:34 +01:00
Philip Rebohle 306acf2193 vkd3d-shader: Compute correct output array index for line tess factors.
Line tessellation factors use two different DXBC semantics that
both map to the same SPIR-V built-in. In this case, we cannot
rely on the semantic index.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:17:32 +01:00
Philip Rebohle 7ac0873b4a vkd3d-shader: Use full write mask for variables for array built-ins.
Private variables are always vec4, so using a sparse write mask here
will lead to invalid code being generated when accessing the variable.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:17:29 +01:00
Philip Rebohle a08ee1e2df vkd3d-shader: Use private array variable for patch constant outputs.
Fork and join phases in hull shaders allow dynamic indexing for
all output registers, not just the tessellation factor built-ins.

Moreover, the patch constant output register space is shared with
join phases, which can read back the outputs computed in the fork
phases, also allowing dynamic indexing.

In order to support this in a not overly complex way, use a private
array representing the entire patch constant space, and use epilogue
functions to assign them to the actual output variables.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:17:26 +01:00
Philip Rebohle 3fe9997010 vkd3d-shader: Add array index field to private output variable info.
Needed to support dynamically indexed output arrays.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:17:22 +01:00
Philip Rebohle 04ec461fb4 vkd3d-shader: Don't fetch output variable id before writing output info.
Otherwise, if a private variable is used for the given output,
vkd3d_dxbc_compiler_emit_store_shader_output will write to the
private variable again instead of the actual output, and some
outputs may never be emitted. This is common in hull shaders.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:17:19 +01:00
Philip Rebohle 907d733ffe vkd3d-shader: Don't shift output array component write mask.
Fixes an assertion when compiling shaders with more than four
clip or cull distances. Output arrays are arrays of scalars,
so shifting the write mask is not very meaningful.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 16:39:04 +02:00
Henri Verbeet a6f6d4fbb1 vkd3d-shader: Always emit the invocation count for geometry shaders.
Even if the shader doesn't explicitly declare it.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 19:16:48 +02:00
Hans-Kristian Arntzen 7a7ed132ec vkd3d-shader: Fix MSVC build.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 19:15:16 +02:00
Philip Rebohle ae44e06deb vkd3d-shader: Enable DemoteToHelperInvocation capability.
Fixes validation errors complaining about invalid shader modules.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-13 19:31:16 +02:00
Józef Kucia 077e8b1459 vkd3d-shader: Add support for SPV_EXT_demote_to_helper_invocation.
Requires SPIRV-Headers commit dcce859e34cf0c23625ec75ac44df750aa2f4d70.

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>
2019-07-31 08:24:34 +02:00
Józef Kucia eb340126b6 vkd3d-common: Move vkd3d_write_mask_is_contiguous() from vkd3d-shader.
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>
2019-07-05 17:52:04 +02:00
Józef Kucia 3172faf612 vkd3d-shader: Avoid multiple PrimitiveId declarations in hull 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>
2019-06-25 19:23:08 +02:00
Józef Kucia 0bde4c7dca vkd3d-shader: Fix component decoration for shader IO variables.
This fixes a regression introduced by commit
91820630cb.

We need to take into account the combined write mask returned from
needs_private_io_variable().

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>
2019-06-18 16:40:38 +02:00
Józef Kucia ecdcb5c1b1 vkd3d-shader: Make sure that InvocationId is emitted once in hull 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>
2019-06-12 22:37:48 +02:00
Józef Kucia a81729cf88 vkd3d-shader: Assign unique locations for patch constants.
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>
2019-06-12 22:37:46 +02:00
Józef Kucia 4a0b62084a vkd3d-shader: Forbid mixing samplers with CBVs/SRVs/UAVs in root signatures.
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>
2019-06-12 22:37:40 +02:00
Józef Kucia faeb03c1a3 vkd3d-shader: Add enum for minimum-precision data 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>
2019-05-21 16:25:02 +02:00
Philip Rebohle 578ce3653d vkd3d-shader: Parse ISG1, PSG1 and OSG1 signatures.
These signatures extend the OSG5 format by a minimum
precision hint, which gets ignored for now but could
be implemented using 16-bit floats in the future.

Fixes some shader parsing errors in Resident Evil 2.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-20 20:33:27 +02:00
Józef Kucia 91820630cb vkd3d-shader: Try to avoid private IO variables even harder.
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>
2019-05-14 20:13:11 +02:00
Józef Kucia 267f10df8b vkd3d-shader: Handle interpolation mode in 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>
2019-05-14 20:13:09 +02:00
Józef Kucia f0530d92b8 vkd3d-shader: Clear output register status while leaving control point phase.
We need to clear output register status when epilogue function isn't
used.

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>
2019-05-14 20:13:06 +02:00
Józef Kucia 68a4b89d61 vkd3d-shader: Do not assume destination is 4 component vector in vkd3d_dxbc_compiler_emit_store().
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>
2019-05-14 20:13:03 +02:00
Józef Kucia f650b2f6ac vkd3d-shader: Try harder to avoid private variables 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>
2019-05-14 20:13:00 +02:00
Józef Kucia 1f8cde763a vkd3d-shader: Avoid generating debug names for hull shader SPIR-V built-ins.
SPIRV Tools disassembler generates pretty names for SPIR-V built-ins.

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>
2019-05-14 20:12:57 +02:00
Józef Kucia 3b6a63425a vkd3d-shader: Allow vPrim in hull shader phases.
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>
2019-05-14 20:12:54 +02:00
Józef Kucia df72746729 vkd3d-shader: Use locale-insensitive string comparison.
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>
2019-05-01 22:54:20 +02:00
Józef Kucia de3423e98e vkd3d-shader: Improve asserts for write mask component count.
Helps Clang Static Analyzer.

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>
2019-05-01 22:54:16 +02:00
Józef Kucia 2faae71f5a vkd3d-shader: Use more appropriate variables for descriptor range count.
Helps Clang Static Analyzer.

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>
2019-05-01 22:54:13 +02:00
Józef Kucia ef71edcb32 vkd3d-shader: Remove dead assignment.
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>
2019-05-01 22:54:10 +02:00
Józef Kucia 3963316c50 vkd3d-shader: Translate lod shader 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>
2019-04-30 09:25:45 +02:00
Józef Kucia ee3994a1cd vkd3d-shader: Simplify resource declaration handling in SPIR-V generator.
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>
2019-04-30 09:25:42 +02:00
Józef Kucia c77f02ca01 vkd3d-shader: Add support for parsing Shader Model 5.1 bytecode.
Translation to SPIR-V isn't implemented yet.

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>
2019-04-30 09:25:40 +02:00
Józef Kucia 9046233492 vkd3d-shader: Improve ID assignment for specialization constants.
Allows using 0 as SpecId.

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>
2019-04-30 09:25:32 +02:00
Józef Kucia 3393719692 vkd3d-shader: Translate samplepos instructions.
This returns standard sample locations. DXC and glslang do the same thing.

d4d0b29752

In the long term, we could also add a shader parameter to pass sample
positions to the shader compiler.

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>
2019-04-30 09:25:25 +02:00
Józef Kucia def3a71513 vkd3d-shader: Make sure that specialization constants are emitted once.
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>
2019-04-26 16:37:23 +02:00
Józef Kucia 004f33432a vkd3d-shader: Use specialization constants by default for shader parameters.
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>
2019-04-26 16:37:22 +02:00
Józef Kucia 63d12751bb vkd3d-shader: Add support for specialization constants.
Allows reusing the same SPIR-V binary with different shader parameters.

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>
2019-04-26 16:37:20 +02:00
Józef Kucia f510e93948 vkd3d-shader: Implement sampleinfo for rasterizer.
Also adds initial infrastructure for more flexible shader parameters.

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>
2019-04-26 16:37:18 +02:00
Józef Kucia 2bdc63d682 vkd3d-shader: Fix write mask for shader inputs.
Shader inputs with non-contiguous write masks (e.g. xyw) were not
handled properly in rare cases.

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>
2019-04-26 16:37:13 +02:00
Józef Kucia d5d1ee4031 vkd3d-shader: Do not export vkd3d_shader_free_root_signature_v_1_0().
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>
2019-04-25 17:20:25 +02:00
Józef Kucia 374bcd276e vkd3d-shader: Remove versioned_ prefix from root signature functions.
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>
2019-04-25 17:20:18 +02:00
Józef Kucia 070de4dfbb vkd3d-shader: Add FIXME() for unknown root signature descriptor flags.
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>
2019-04-25 17:20:15 +02:00
Józef Kucia 21ab63c4d6 vkd3d-shader: Remove vkd3d_shader_serialize_root_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>
2019-04-24 10:48:24 +02:00
Józef Kucia a9ad6f637d vkd3d-shader: Implement serialization for versioned root signatures.
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>
2019-04-24 10:48:17 +02:00
Józef Kucia 16f36b0c9b vkd3d-shader: Remove vkd3d_shader_parse_root_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>
2019-04-19 16:24:09 +02:00
Józef Kucia fbeabe0849 vkd3d-shader: Implement conversion between root signature 1.0 and 1.1.
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>
2019-04-19 16:24:04 +02:00
Józef Kucia f9b9ae8cc7 vkd3d-shader: Implement parsing of root signature 1.1.
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>
2019-04-19 16:23:53 +02:00
Józef Kucia f7fa7a3fb8 vkd3d-shader: Assert that write masks are valid.
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>
2019-04-08 19:39:41 +02:00
Józef Kucia a46a2fb21b vkd3d-shader: Avoid mixing enum types (Coverity).
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>
2019-04-08 19:39:36 +02:00
Józef Kucia 41274e6285 vkd3d: Drop support for 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>
2019-04-04 17:25:23 +02:00
Józef Kucia 5842898cc7 vkd3d-shader: Drop support for dummy samplers.
This shouldn't be needed by any Vulkan driver anymore.

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>
2019-04-04 17:25:21 +02:00
Józef Kucia acc9430abe vkd3d-shader: Fix SV_Position.w in pixel 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>
2019-04-01 21:42:35 +02:00
Józef Kucia bcd60c21ca vkd3d-shader: Do not enable SpvCapabilityUniformBufferArrayDynamicIndexing.
This capability is for dynamic indexing *arrays* of uniform buffers.

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>
2019-03-19 18:41:28 +01:00
Józef Kucia 27b4779930 vkd3d-shader: Check shader visibility for combined samplers.
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>
2019-03-19 18:41:25 +01:00
Józef Kucia c6477964a3 vkd3d-shader: Translate eval_centroid shader 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>
2019-03-14 23:53:29 +01:00
Józef Kucia 38f5081496 vkd3d-shader: Translate eval_sample_index shader 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>
2019-03-14 23:53:27 +01:00
Józef Kucia 19f9745adf vkd3d-shader: Use epilogue functions for fork and join phases.
In order to handle packed outputs properly.

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>
2019-03-06 16:00:39 +01:00
Józef Kucia 74c8ca0f64 vkd3d-shader: Add basic support for vocp 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>
2019-03-06 16:00:37 +01:00
Józef Kucia 7fc98ade64 vkd3d-shader: Use SPIR-V built-ins for hull shader inputs.
I missed this case before because apps don't seem to use SV_Position
for hull shader inputs. vkd3d_siv_from_sysval() needs to be restored
for hull 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>
2019-03-06 16:00:34 +01:00
Józef Kucia 67a160683d vkd3d-shader: Take into account dst write mask for scalar stores.
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>
2019-03-06 16:00:32 +01:00
Józef Kucia 0ffaf4a2b7 vkd3d-shader: Introduce is_control_point_phase() 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>
2019-02-26 22:08:19 +01:00
Józef Kucia ff132543c1 vkd3d-shader: Index control point phase outputs by InvocationId.
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>
2019-02-26 22:08:16 +01:00
Józef Kucia 0328118947 vkd3d-shader: Handle partial shader output updates in epilogue functions.
Fork and join phases quite often write only a few components of an
output variable.

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>
2019-02-26 22:08:14 +01:00
Józef Kucia bc441fd6c6 vkd3d-shader: Add more advanced helper for 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>
2019-02-26 22:08:10 +01:00
Józef Kucia 6c70edf511 vkd3d-shader: Remove output register symbols while leaving control point phase.
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>
2019-02-26 22:08:08 +01:00
Józef Kucia 02cbc53b96 vkd3d-shader: Get rid of vkd3d_dxbc_compiler_emit_swizzle_ext().
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>
2019-02-25 19:08:05 +01:00
Józef Kucia cb24be8e83 vkd3d-shader: Do not assume float type for arrayed 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>
2019-02-25 19:08:03 +01:00
Józef Kucia 04e2091afa vkd3d-shader: Do not assume vec4 destination in vkd3d_dxbc_compiler_emit_store().
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>
2019-02-25 19:08:01 +01:00
Józef Kucia 95b6d5222d vkd3d-shader: Call vkd3d_dxbc_compiler_leave_shader_phase() also for last phase.
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>
2019-02-25 19:07:59 +01:00
Józef Kucia 38f75846b4 vkd3d-shader: Emit epilogue functions while leaving shader phases.
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>
2019-02-25 19:07:57 +01:00
Józef Kucia 61aeaae0c2 vkd3d-shader: Factor out vkd3d_dxbc_compiler_emit_store().
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>
2019-02-25 19:07:55 +01:00
Józef Kucia 64f7ff3898 vkd3d-shader: Merge ifs in vkd3d_dxbc_compiler_emit_swizzle_ext().
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>
2019-02-25 19:07:52 +01:00
Philip Rebohle c560fdfa26 vkd3d-shader: Decorate integer fragment shader builtins as flat.
From the Vulkan spec, 8.13 "Interpolation Decorations":

    Fragment shader inputs that are signed or unsigned integers,
    integer vectors, or any double-precision floating-point type
    must be decorated with Flat.

This also matches glslang behaviour.

Specifically, this fixes tone-mapping in Unreal Engine 4 on RADV
and AMDGPU-PRO, where gl_Layer is used as a fragment shader input.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
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>
2019-02-25 19:07:50 +01:00
Józef Kucia d1e0ac115c vkd3d-shader: Avoid generating unique array types for immediate constant buffers.
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>
2019-02-22 12:30:44 +01:00
Józef Kucia a0069d9fb7 vkd3d-shader: Use correct base index for relative addressing of aggregates.
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>
2019-02-22 12:30:39 +01:00
Józef Kucia d300e6f84c vkd3d-shader: Remove v{Fork, Join}InstanceID from symbol table when leaving shader phase.
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>
2019-02-22 12:30:37 +01:00
Józef Kucia 9c46011b43 vkd3d-shader: Simplify vkd3d_dxbc_compiler_get_register_id().
Special casing is not needed.

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>
2019-02-22 12:30:35 +01:00
Józef Kucia 3cbdad5f29 vkd3d-shader: Translate vPrim 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>
2019-02-22 12:30:33 +01:00
Józef Kucia 7466758f08 vkd3d-shader: Fix swizzle for scalars.
In rare cases, OpCompositeExtract was generated for scalars.

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>
2019-02-22 12:30:30 +01:00
Józef Kucia 197c1d9612 vkd3d-shader: Handle VKD3DSPR_INCONTROLPOINT in vkd3d_dxbc_compiler_get_register_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>
2019-02-20 19:15:14 +01:00
Józef Kucia b6de566e3a vkd3d-shader: Add basic support for dcl_index_range.
We can address SPIR-V arrays dynamically.

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>
2019-02-20 19:15:10 +01:00
Józef Kucia d274318fe2 vkd3d-shader: Avoid using SPIR-V built-ins for shader interface between tessellation stages.
We can do this because both tessellation shaders are required in
Direct3D.

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>
2019-02-20 19:15:04 +01:00
Józef Kucia 7b84adec32 vkd3d-shader: Set xxxx swizzle for scalar registers.
Mainly for vOutputControlPointID.

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>
2019-02-20 19:15:00 +01:00
Józef Kucia 3fbbc68160 vkd3d-shader: Replace VKD3DSIH_TABLE_SIZE with VKD3DSIH_INVALID.
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>
2019-02-20 19:14:58 +01:00
Józef Kucia c333fddaf9 vkd3d-shader: Add support for OpenGL tessellation shaders.
In DXBC tessellator parameters are specified in hull shaders. In OpenGL,
even in SPIR-V, tessellator parameters must be specified in the
tessellation evaluation shader.

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>
2019-02-14 16:01:14 +01:00
Józef Kucia b1b3405bcf vkd3d-shader: Implement user patch constants for hull 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>
2019-02-13 17:21:50 +01:00
Józef Kucia 7fde0ac78f vkd3d-shader: Implement relative addressing for arrayed 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>
2019-02-13 17:21:48 +01:00
Józef Kucia d30afc37c4 vkd3d-shader: Implement input registers for control point phase.
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>
2019-02-13 17:21:46 +01:00
Józef Kucia efe68b00bb vkd3d-shader: Add basic support for vpc registers in domain 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>
2019-02-13 17:21:44 +01:00
Józef Kucia 1a5f058f4a vkd3d-shader: Translate vOutputControlPointID 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>
2019-02-13 17:21:42 +01:00
Józef Kucia 09dea5f4d9 vkd3d-shader: Implement default control point phase.
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>
2019-02-11 18:33:31 +01:00
Józef Kucia c9fb9c7a7d vkd3d-shader: Simplify vkd3d_dxbc_compiler_emit_mov().
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>
2019-02-11 18:33:29 +01:00
Józef Kucia bdae9e30b4 vkd3d-shader: Ignore dcl_hs_max_tessfactor.
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>
2019-02-11 18:33:26 +01:00
Józef Kucia 0498fafbb0 vkd3d-shader: Try to use SpvOpCopyMemory for mov 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>
2019-02-11 18:33:24 +01:00
Józef Kucia a81a7f837e vkd3d-shader: Add initial support for built-in patch constants.
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>
2019-02-08 17:20:39 +01:00
Józef Kucia 4ad4cbb7df vkd3d-shader: Factor out vkd3d_symbol_set_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>
2019-02-08 17:20:37 +01:00
Józef Kucia df654aa327 vkd3d-shader: Factor out vkd3d_dxbc_compiler_emit_builtin().
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>
2019-02-08 17:20:35 +01:00
Józef Kucia c314b5b01c vkd3d-shader: Get sysval semantic from shader signature for inputs.
In domain shaders, inputs are declared with dcl_input without semantic.

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>
2019-02-08 17:20:33 +01:00
Józef Kucia ba7807b456 vkd3d-shader: Rename scan instruction function to vkd3d_shader_scan_instruction().
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>
2019-02-08 17:20:17 +01:00
Józef Kucia fd3d661bf0 vkd3d-shader: Unset r# registers state while leaving current shader phase.
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>
2019-02-07 17:01:59 +01:00
Józef Kucia 59d97b07fe vkd3d-shader: Implement hull shader barriers.
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>
2019-02-07 17:01:57 +01:00
Józef Kucia 0397808f81 vkd3d-shader: Add support for instanced join phases.
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>
2019-02-07 17:01:56 +01:00
Józef Kucia 18784e6500 vkd3d-shader: Translate vForkInstanceId 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>
2019-02-07 17:01:53 +01:00
Józef Kucia ea4dd22309 vkd3d-shader: Add support for instanced fork phases.
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>
2019-02-07 17:01:51 +01:00
Józef Kucia e88b73797b vkd3d-shader: Delay generating functions for shader phases.
Mainly in order to wait for dcl_hs_{fork,join}_phase_instance_count.

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>
2019-02-07 17:01:49 +01:00
Józef Kucia 97f0e778af vkd3d-shader: Allocate temporary registers per shader phase.
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>
2019-02-06 15:38:54 +01:00
Józef Kucia b8b09e58fa vkd3d-shader: Do not generate shader epilogue for fork and join shader phases.
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>
2019-02-06 15:38:52 +01:00
Józef Kucia 904ab0ead5 vkd3d-shader: Generate functions for hull shader phases.
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>
2019-02-06 15:38:50 +01:00
Józef Kucia 82d56f4872 vkd3d-shader: Introduce vkd3d_spirv_get_op_type_function().
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>
2019-02-06 15:38:44 +01:00
Józef Kucia 363beefa9b vkd3d-shader: Introduce vkd3d_spirv_build_op_access_chain1().
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>
2019-02-05 19:26:40 +01:00
Józef Kucia 97c3aa0cdc vkd3d-shader: Use VKD3D_SHADER_DEBUG instead of VKD3D_DEBUG.
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>
2019-01-31 18:05:55 +01:00
Józef Kucia 52015b30b3 vkd3d-common: Add support for naming debug environment variable.
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>
2019-01-31 18:05:53 +01:00
Józef Kucia 1ae1f831f6 vkd3d-shader: Move VKD3D_SHADER_DUMP_PATH implementation from libvkd3d.
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>
2019-01-31 18:05:51 +01:00
Józef Kucia bcd91910e4 vkd3d-shader: Use proper vkd3d_spirv_builtin for PS fragment coordinates.
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>
2019-01-25 18:59:23 +01:00
Józef Kucia 495d4b9474 vkd3d-shader: Add more general support for SPIR-V aggregates.
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>
2019-01-25 18:59:21 +01:00
Józef Kucia 2838ee5833 vkd3d-shader: Translate dcl_tessellator_output_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>
2019-01-25 18:59:17 +01:00
Józef Kucia 559c0191c8 vkd3d-shader: Implement vCoverage shader 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>
2019-01-24 17:03:59 +01:00
Józef Kucia 4f55d990b9 vkd3d-shader: Mark hs_decls as declaration instruction.
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>
2019-01-24 17:03:57 +01:00
Józef Kucia 54d9714fcd vkd3d-shader: Implement oMask shader 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>
2019-01-23 17:43:01 +01:00
Józef Kucia fd0844e420 vkd3d-shader: Avoid using private variables for depth output 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>
2019-01-23 17:42:58 +01:00
Józef Kucia 35e062b0a4 vkd3d-shader: Fix resinfo for cube textures.
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>
2019-01-23 17:42:54 +01:00
Józef Kucia 4c0692b2ef vkd3d-shader: Rename vkd3d_shader_interface to vkd3d_shader_interface_info.
For consistency with other vkd3d and vkd3d-shader structures.

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>
2019-01-17 19:44:05 +01:00
Józef Kucia bb7d1046da vkd3d-shader: Use result type for bitfield instructions source parameters.
Fixes SPIR-V validation errors:

  Expected Base Type to be equal to Result Type: BitFieldSExtract

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>
2019-01-15 15:26:04 +01:00
Józef Kucia 84759c40fe vkd3d-shader: Use vkd3d_dxbc_compiler_emit_load_src() 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>
2019-01-15 15:26:02 +01:00
Józef Kucia ff7df2cdf9 vkd3d-shader: Use result type for atomic instructions source parameters.
Fixes SPIR-V validation errors:

  AtomicIAdd: expected Value to be of type Result 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>
2019-01-15 15:25:57 +01:00
Józef Kucia da3e283717 vkd3d-shader: Fix SV_VertexID.
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>
2019-01-15 15:25:51 +01:00
Józef Kucia 3d80b3f4bd vkd3d-shader: Add basic support for transform feedback.
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>
2019-01-14 20:31:13 +01:00
Józef Kucia 731e11902a vkd3d-shader: Introduce vkd3d_dxbc_compiler_emit_initial_declarations().
To emit more declarations immediately after creating a new SPIR-V builder.

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>
2019-01-14 20:31:10 +01:00
Józef Kucia dadf2eda08 vkd3d-shader: Declare OriginUpperLeft execution mode for fragment shaders.
Required by the Vulkan spec:

  "fragment entry points must declare OriginUpperLeft."

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>
2019-01-11 19:31:31 +01:00
Józef Kucia 49e55dd639 vkd3d-shader: Implement DXBC checksum for root signatures.
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-12-20 19:41:44 +01:00
Józef Kucia 3795add878 vkd3d-shader: Import MD5 implementation from Wine.
With style changes.

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-12-20 19:41:41 +01:00
Józef Kucia 5b0ed414a1 vkd3d-shader: Add support for dual source blending.
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-12-17 19:17:10 +01:00
Józef Kucia 4e66897a1e vkd3d-shader: Avoid BYTE.
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-12-12 17:28:16 +01:00
Józef Kucia a7aaa09eb3 vkd3d-shader: Avoid BOOL.
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-12-12 17:28:16 +01:00
Józef Kucia 2c5a8cda7a vkd3d-shader: Translate sample_info 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-11-26 20:25:34 +01:00
Józef Kucia 23361bbcb2 vkd3d-shader: Add support for 2D MS arrays.
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-11-26 20:25:31 +01:00
Józef Kucia 7decb65f54 vkd3d-shader: Implement shader visibility for UAV counters.
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-11-15 18:33:37 +01:00
Józef Kucia 8ac9b120fe vkd3d-shader: Avoid SIZE_T.
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-11-13 20:49:43 +01:00
Józef Kucia bf227d4a28 include: Avoid bitfields in public structures.
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-11-08 19:07:39 +01:00
Józef Kucia 41ca2469b2 include: Add STATIC_ASSERT() macro.
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-11-08 19:07:37 +01:00
Józef Kucia c2e0bf1244 build: Build libvkd3d-shader as public library.
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-11-02 11:19:00 +01:00
Józef Kucia 00a0958526 vkd3d-shader: Fix swizzling for scalars.
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-11-02 11:18:58 +01:00
Józef Kucia 7338ba0337 vkd3d-shader: Try harder to avoid using private variables for 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-10-31 19:15:19 +01:00
Józef Kucia 2ace6f204d vkd3d-shader: Use vkd3d_dxbc_compiler_emit_swizzle_ext() in 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-10-31 19:15:17 +01:00
Józef Kucia 11a65da62a vkd3d-shader: Check more accurately if swizzle is required.
Eliminates redundant OpVectorShuffle 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-10-31 19:15:15 +01:00
Józef Kucia f97b745ae7 vkd3d-shader: Add structure type fields to public API structures.
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-10-30 18:21:59 +01:00
Józef Kucia 2f15b30e30 vkd3d-shader: Require shader signature elements for 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-10-30 18:21:57 +01:00
Józef Kucia 6b9c589795 vkd3d-shader: Implement vkd3d_write_mask_component_count() on top of vkd3d_popcount().
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-10-30 18:21:55 +01:00
Józef Kucia 78a09d37d2 vkd3d-shader: Add support for stores to scalar variables.
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-10-30 18:21:54 +01:00
Józef Kucia ebf09feb82 vkd3d-shader: Simplify vkd3d_dxbc_compiler_emit_load_scalar().
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-10-30 18:21:52 +01:00
Józef Kucia d2e5ced1ac vkd3d-shader: Use typed shader outputs directly.
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-10-30 18:21:50 +01:00
Józef Kucia 7b58e7cb23 vkd3d-shader: Rename "output setup" function to "shader epilogue".
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-10-30 18:21:48 +01:00
Józef Kucia 34f61154f7 vkd3d-shader: Avoid uint32_t in public interface.
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-10-29 17:08:47 +01:00
Józef Kucia 0f0af935a6 vkd3d-shader: Introduce VKD3D_SHADER_VISIBILITY_COMPUTE.
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-10-29 17:08:45 +01:00
Józef Kucia ae84b5210e vkd3d-shader: Introduce vkd3d_shader_binding_flags.
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-10-29 17:08:43 +01:00
Józef Kucia feeb2b49df vkd3d-shader: Use typed shader inputs directly.
... instead of copying them to a private floating-point variable.

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-10-29 17:08:40 +01:00
Józef Kucia bec3430d88 vkd3d-shader: Propagate errors from vkd3d_dxbc_compiler_emit_control_flow_instruction().
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-10-26 19:47:14 +02:00
Józef Kucia b909a5fe04 vkd3d-shader: Add asserts() to vkd3d_dxbc_compiler_emit_control_flow_instruction().
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-10-26 19:47:13 +02:00
Józef Kucia 049d21ad7a vkd3d-shader: Fix typo in vkd3d_dxbc_compiler_have_combined_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-10-24 17:00:45 +02:00
Józef Kucia 94497f31a0 vkd3d-shader: Implement SV_ViewportArrayIndex.
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-10-22 10:57:29 +02:00
Józef Kucia 2f5b718205 vkd3d-shader: Try to always use combined samplers for t# registers.
For bufinfo and resinfo.

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-10-22 10:57:27 +02:00
Józef Kucia 11de335abd vkd3d-shader: Add support for combined samplers.
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-10-22 10:57:25 +02:00
Józef Kucia 063f0f057a vkd3d-shader: Scan sampler comparison mode.
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-10-22 10:57:22 +02:00
Józef Kucia 781c5ed7c9 vkd3d-shader: Merge prepare_image() functions.
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-10-22 10:57:21 +02:00
Józef Kucia f242922587 vkd3d-shader: Generalize helper for emitting descriptor binding decorations.
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-10-22 10:57:19 +02:00
Józef Kucia 3efa365b5e vkd3d-shader: Remove sampler_id from struct vkd3d_shader_image.
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-10-22 10:57:15 +02:00
Józef Kucia 299f126f7a vkd3d-shader: Simplify DepthReplacing execution mode handling.
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-10-19 21:43:04 +02:00
Józef Kucia c81e28c03a vkd3d-shader: Implement conservative depth output.
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-10-19 21:43:02 +02:00
Józef Kucia dac94fb58e vkd3d-shader: Translate bufinfo 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-10-19 21:43:00 +02:00
Józef Kucia 6639f618af vkd3d-shader: Implement early depth/stencil tests.
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-10-18 19:49:22 +02:00
Józef Kucia 3957242ea7 vkd3d-shader: Translate ld2dms 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-10-18 19:49:20 +02:00
Józef Kucia 123f3ed387 vkd3d-shader: Fix resinfo for multisample textures.
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-10-18 19:49:20 +02:00
Józef Kucia 55abf3d6d4 vkd3d-shader: Fix f32tof16 instruction.
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-10-18 19:49:20 +02:00
Józef Kucia dc9fdf5d31 vkd3d-shader: Fix f16tof32 instruction.
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-10-18 19:49:06 +02:00
Józef Kucia acf8ae9673 vkd3d-shader: Fix bitfield instructions.
Avoid overwriting registers before all results are computed.

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-10-18 19:49:03 +02:00
Józef Kucia 170bb60baa vkd3d-shader: Add support for OpenGL atomic counters.
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-10-18 00:59:44 +02:00
Józef Kucia 08183841eb vkd3d-shader: Translate sample_b 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-10-18 00:59:43 +02:00
Józef Kucia 907d137a4b vkd3d-shader: Translate sample_d 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-10-18 00:59:41 +02:00
Józef Kucia 86b4c8c9de vkd3d-shader: Constify vkd3d_dxbc_compiler pointers.
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-10-18 00:59:38 +02:00
Józef Kucia 2f43965c2c vkd3d-shader: Add OpenGL SPIR-V target environment.
More changes are needed for full support.

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-10-11 18:37:36 +02:00
Józef Kucia 970aafaf55 vkd3d-shader: Recognize enableMinimumPrecision global flag.
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-10-11 18:37:34 +02:00
Józef Kucia 1f4e6dc603 vkd3d-shader: Implement SV_SampleIndex.
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-10-08 22:25:04 +02:00
Józef Kucia 4068243279 vkd3d-shader: Bump SPIR-V generator version.
In preparation for the next release.

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-10-02 19:36:32 -07:00
Józef Kucia d11b9618e0 vkd3d-shader: Use TRACE() for skipped DXBC chunks.
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-09-28 20:32:58 +02:00
Józef Kucia a4cd1b255f vkd3d-shader: Translate gather4_po_c 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-09-28 01:12:44 +02:00
Józef Kucia b66d4ed521 vkd3d-shader: Translate retc 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-09-28 01:12:43 +02:00
Józef Kucia 99939f626b vkd3d-shader: Use vkd3d_dxbc_compiler_emit_conditional_branch() 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-09-28 01:12:41 +02:00
Józef Kucia 5319cc2420 vkd3d-shader: Translate gather4_po 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-09-24 19:20:35 +02:00
Józef Kucia a553eb1afe vkd3d-shader: Translate gather4_c 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-09-24 19:20:31 +02:00
Józef Kucia 01ef2ceced vkd3d-shader: Find innermost loops for breakc 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-09-24 19:20:26 +02:00
Józef Kucia 9781b15531 vkd3d-shader: Translate continuec 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-09-24 19:20:16 +02:00
Józef Kucia 79339d153a vkd3d-shader: Translate continue 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-09-24 19:20:12 +02:00
Józef Kucia a970f71581 vkd3d-shader: Translate ineg 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-09-24 19:20:10 +02:00
Józef Kucia 62628dd90d vkd3d-shader: Promote immediate scalar constants to vectors.
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-09-24 19:20:07 +02:00
Józef Kucia ae5471b978 vkd3d-shader: Implement texel offset for sample 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-09-13 19:26:18 +02:00
Józef Kucia 0b278a7773 vkd3d-shader: Implement texel offsets for ld 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-09-13 19:26:17 +02:00
Józef Kucia 6296758849 vkd3d-shader: Add support for more interpolation modifiers.
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-09-13 19:26:15 +02:00
Józef Kucia 5398d65d3e vkd3d-shader: Correctly handle multiple clip/cull distance output 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-09-05 17:18:25 +02:00
Józef Kucia e425b86610 vkd3d-shader: Implement cull distances.
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-09-05 17:18:24 +02:00
Józef Kucia 814cd31522 vkd3d-shader: Implement clip distances.
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-09-05 17:18:22 +02:00
Józef Kucia 060968fad2 vkd3d-shader: Add get_type_id() helper functions.
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-09-05 17:18:20 +02:00
Józef Kucia bca28c79ec vkd3d-shader: Downgrade FIXME() about unhandled instruction modifiers to WARN().
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-27 23:17:42 +02:00
Józef Kucia 99a2daedb1 vkd3d-shader: Strip debug info after generating all 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-20 09:54:41 +02:00
Józef Kucia 76f64b86de libs/vkd3d-shader: Require shader signature elements 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-08-16 11:02:15 +02:00
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