Commit Graph

182 Commits

Author SHA1 Message Date
Philip Rebohle 7441137a33 [dxbc] Ignore system value components when declaring inputs 2024-04-19 01:01:52 +02:00
Philip Rebohle 69d74a46a0 [dxbc] Remove emitRawBuffer{Load,Store}
And factor these into the callers. We need to preserve the raw
index and offset parameters to use raw access chains.
2024-03-05 14:41:18 +01:00
Philip Rebohle 94098aa97d [dxbc] Enable SPV_NV_raw_access_chains 2024-03-05 14:41:18 +01:00
Philip Rebohle a67c99943a [dxbc] Set output topology for GS and TES correctly 2023-07-20 23:43:03 +02:00
Philip Rebohle 8011a40843 Revert "[dxbc] Handle dead code in shader binaries"
Apparently this regressed something, but the reporter who asked
for this fix in the first place did not specify what, so let's
just revert this and break the whole thing again until we get
something to actually work with.

This reverts commit 5115d80d51.
2023-01-10 20:37:22 +01:00
Philip Rebohle 5115d80d51 [dxbc] Handle dead code in shader binaries
We should not emit any code when not inside a function.

Fixes #3154.
2023-01-06 20:49:13 +01:00
Philip Rebohle 35a84053b5 [dxbc] Implement rasterizer ordered views 2022-09-19 15:44:23 +02:00
Philip Rebohle 5b6b9923ab [dxbc] Write point size in vertex shaders
Silences some validation errors when point rendering is enabled.
2022-09-17 01:52:19 +02:00
Philip Rebohle d93568f1a9 [dxbc] Don't emit built-in position as a block variable
This is no longer needed for interface matching.
2022-09-17 01:52:19 +02:00
Philip Rebohle eda366662c [dxbc] Handle workgroup-coherent UAVs more efficiently
Some drivers don't handle the workgroup scope on stores and loads properly,
so let's just do the availability and visibility operation on barriers.
2022-09-12 18:19:02 +02:00
Philip Rebohle 8176101228 [dxbc] Enable Vulkan memory model 2022-09-10 14:27:13 +02:00
Philip Rebohle 3401964ee2 [dxbc] Implement support for SV_InnerCoverage 2022-09-05 07:21:47 +02:00
Philip Rebohle 336aafcdf7 [dxbc] Explicitly store whether a resource is a raw SSBO 2022-08-26 05:53:03 +02:00
Philip Rebohle d6613f50c5 [dxbc] Implement ld for buffers with sparse feedback 2022-08-26 05:53:03 +02:00
Philip Rebohle d5b68b3642 [dxbc] Implement gather operations with sparse feedback 2022-08-26 05:53:03 +02:00
Philip Rebohle 614024873d [dxbc] Implement CheckAccessFullyMapped instruction 2022-08-26 05:53:03 +02:00
Philip Rebohle 165648017e [dxbc] Remove fallback path for discards 2022-08-19 13:36:54 +00:00
Philip Rebohle ec813e036c
[dxbc] Fix UAV write test
We broke this during the null descriptor refactor. Also make it so that
we don't generate conditionals when there's nothing to test.
2022-07-20 22:56:32 +02:00
Philip Rebohle 0f16a8f70d
[dxbc] Remove output mapping code 2022-07-17 17:06:42 +02:00
Philip Rebohle c3af42356f
[dxbc] Enable SPIR-V 1.6 2022-07-15 16:10:16 +02:00
Philip Rebohle 320534cb34
[spirv] Automatically track interface variables 2022-07-15 16:10:16 +02:00
Philip Rebohle f99a833f51
[d3d11] Remove d3d11.constantBufferRangeCheck option 2022-07-12 02:11:39 +02:00
Philip Rebohle a637134c56
[d3d11,dxbc] Use push constant instead of spec constant for rasterizer sample count 2022-07-03 13:41:06 +02:00
Philip Rebohle 87e2d70448
[dxbc] Remove bound spec constants from shader code 2022-07-03 13:41:06 +02:00
Philip Rebohle db07861518
[dxvk] Remove old pipeline layout implementation 2022-06-28 14:35:58 +02:00
Philip Rebohle 79ecd4e94a
[dxbc] Pass new binding info struct to shaders 2022-06-28 14:32:31 +02:00
Philip Rebohle 8993560cde [dxbc] Use new DxvkShader constructor 2022-04-18 13:20:16 +02:00
Philip Rebohle b015cf0bb2
[dxbc] Support switch-case fallthrough
Apparently this is a thing in Shader Model 4, although FXC cannot emit it.
2022-03-22 17:32:43 +01:00
Philip Rebohle cf4ff820be
[dxbc] Handle shaders without refactoringAllowed flag 2021-03-18 17:46:45 +01:00
Philip Rebohle f5fa7a9099
[dxbc] Set float control bits as necessary 2021-01-28 19:37:10 +01:00
Philip Rebohle 45461ee54e
[dxbc] Use opSelect for unbound texel fetch instructions
Generates less annoying code compared to control flow instructions,
and drivers should be able to optimize away the texture instruction
anyway since the bound state is a specialization constant.
2020-11-24 18:36:40 +01:00
Rhys Perry 73cb711f32 [dxbc] Bounds-check temporary array stores
Fixes flickering terrain in Just Cause 3 on RADV and possibly ANV.
2020-09-14 16:56:06 +02:00
Philip Rebohle 3d213efe53
[dxbc] Use SSBOs for dynamically indexed constant buffers if needed
SSBOs are tightly bound-checked on all Nvidia GPUs, so this allows for
a more accurate workaround for games relying on OOB access behaviour.
2019-10-28 15:42:46 +01:00
Philip Rebohle 6888a98c89
[dxbc] Always set geometry shader invocation count
Fixes validation errors when the DXBC shader does not specify
the invocation count itself.
2019-10-26 23:19:59 +02:00
Philip Rebohle 2d6a3396dd
[dxbc] Declare length of shader input array late
Otherwise, we generate out-of-bounds array reads and writes
in broken ENB shaders.
2019-10-23 16:36:52 +02:00
Philip Rebohle 94ce76da6b
[dxbc] Implement label, call and callc instructions
Fixes #1200.
2019-09-22 22:28:58 +02:00
Philip Rebohle 17a6c4168e
[dxbc] Implement stencil ref export from fragment shaders
This is an optional feature in D3D11.3, but easy enough to support.
2019-09-16 12:42:15 +02:00
Philip Rebohle 26afaba410
[dxbc] Implement MSAD4 instruction
Apparently we're required to support this for Direct3D 11.2+.
There are currently no known games that require this instruction.
2019-09-16 12:42:14 +02:00
Philip Rebohle 163e6aaa50
[dxbc] Store alignment for raw and structured buffers 2019-06-11 20:20:40 +02:00
Philip Rebohle 04e6479690
[dxbc] Remove old spec constant code 2019-05-01 01:57:34 +02:00
Philip Rebohle dc3cfc9fa0
[dxbc] Use new spec constant API for rasterizer sample count 2019-05-01 01:57:34 +02:00
Philip Rebohle 7111af423d
[dxbc] Add new emitNewSpecConstant method
Convenience method to declare new specialization constants.
2019-05-01 01:57:34 +02:00
Philip Rebohle 3b1e753bb5
[dxvk] Re-implement early discard with quad granularity
May perform better on some hardware in situations where we cannot
discard a full subgroup. Closes #753.
2019-04-30 14:46:03 +02:00
Philip Rebohle e5a06d3f4a
[dxbc] Only load requested components from constant buffers
Results in better performance compared to loading the entire vector
on RADV. Suggested by Samuel Pitoiset.
2019-01-30 16:32:25 +01:00
Philip Rebohle 0b5cffb0bb
[dxbc] Parse patch constant signature 2019-01-26 14:52:29 +01:00
Philip Rebohle 01b8e74457
[dxbc] Use raw SSBOs for raw and structured buffers if appropriate 2018-12-14 23:45:37 +01:00
Philip Rebohle 7096937c11
[dxbc] Use ballot to determine early-discard condition in fragment shaders 2018-11-27 11:50:01 +01:00
Philip Rebohle ea5f11d091
[dxbc] Implement function to clear thread-group shared memory
Can be enabled in case a game reads undefined data from TGSM.
2018-11-23 15:57:54 +01:00
Philip Rebohle 79a6dd111e
[dxbc] Store workgroup size for compute shaders 2018-11-23 14:39:33 +01:00
Philip Rebohle 6dd82dfe03
[dxbc] Clamp written depth value to (0.0, 1.0)
Fixes shadow issue in Overwatch (#738).
2018-11-23 12:00:23 +01:00