Commit Graph

288 Commits

Author SHA1 Message Date
Philip Rebohle a42f03e32d
[dxbc] Add Xfb structures to DxbcModuleInfo 2018-10-10 10:28:15 +02:00
Andre Heider 8fcdf78b51 [dxbc] rename DxbcProgramVersion to DxbcProgramInfo
The version in not part of this class anymore.
2018-10-08 12:32:01 +02:00
Andre Heider 8492f0501e [dxbc] Drop unused major/minor from DxbcProgramVersion 2018-10-08 12:32:01 +02:00
Philip Rebohle 059073fcd0
[dxbc] Fix missing hull shader input declarations
Fixes tessellation in Tomb Raider 2013. Closes #368.
2018-09-13 18:25:32 +02:00
Philip Rebohle 797c568c74
[dxbc] Use temporary array for per-patch hull shader outputs
Drivers don't seem to like it when output arrays are addressed dynamically.
2018-09-13 15:17:39 +02:00
Philip Rebohle 16a3ae52fe
[dxbc] Remove emitCsSystemValueLoad
There are no compute shader system values.
2018-09-10 11:50:13 +02:00
Philip Rebohle f8dc5612f7
[d3d11] Added option to limit tessellation factors
d3d11.maxTessFactor accepts values ranging from 8 to 64, and limits
the maximum tessellation factor accordingly.
2018-09-09 23:14:00 +02:00
Philip Rebohle 108a6645e6
[dxbc] Make emitRawBufferLoad more readable 2018-09-06 21:44:53 +02:00
Philip Rebohle 9520c9b1b8
[dxbc] Apply Modulo 31 to bit counts and offsets (shr/shl/bfe/bfi)
Assassin's Creed Syndicate relies on correct behaviour.
2018-09-03 01:01:44 +02:00
Philip Rebohle 05e505a844
[dxbc] Implement pixel shader output component mapping 2018-09-01 18:15:27 +02:00
Philip Rebohle 01cc49555a [dxbc] End functions correctly even if last instruction is not 'ret'
Some DXBC shaders don't end in a return instruction, but rather implicitly
end when all branches end in a return instruction. Fixes an illegal shader
generated in Crysis 1.
2018-08-27 14:29:40 +02:00
Philip Rebohle b51361eaa9
Revert "[dxbc] Work around OpControlBarrier issue on radv 18.2-git"
This reverts commit 9293acfeb5.

This issue is caused by an LLVM bug, which now has a workaround in RADV:
https://cgit.freedesktop.org/mesa/mesa/commit/?id=71d5b2fbf83061a1319141d26942771e8c75ff2b
2018-08-17 11:50:36 +02:00
Philip Rebohle e113392bb9
[dxbc] Implement DtoI, DtoU, ItoD and UtoD 2018-08-15 20:11:40 +02:00
Philip Rebohle 86fbba06be
[dxbc] Implement DDiv, DFma and DRcp 2018-08-15 20:11:40 +02:00
Philip Rebohle fabcdbc3ae
[dxbc] Add definitions for extended double instructions 2018-08-15 20:11:34 +02:00
Philip Rebohle e1479f41c1
[dxbc] Fix case labels when case blocks are terminated with ret
Fixes incorrect shader in Monster Hunter World, which caused
RADV to crash.
2018-08-10 03:31:35 +02:00
Philip Rebohle 9293acfeb5
[dxbc] Work around OpControlBarrier issue on radv 18.2-git 2018-08-03 15:15:18 +02:00
Philip Rebohle 1da6617a73
[dxbc] Fix sample location order for 2xMSAA case
The sample locations were apparently incorrectly documented
in the Vulkan spec and have changed with the 1.1.82 update.
2018-08-01 11:38:59 +02:00
Philip Rebohle 0ba00b3f59
[dxvk] Add extended device feature structure
This allows the client API to query and enable extended
features in the future, should it become necessary, much
like the extende feature queries.
2018-07-31 16:58:25 +02:00
Philip Rebohle 91407098d5
[dxbc] Actually set "icb" as the debug name of the ICB 2018-07-30 22:08:01 +02:00
Philip Rebohle f8392b4f83
[dxbc] Fix incorrect pointer type when loading from baked ICBs 2018-07-30 21:08:52 +02:00
Philip Rebohle 2166769096
[dxbc] Map large ICBs to a constant buffer
Should fix an issue with compiling a specific compute shader in
the game Dragon Ball Xenoverse 2 (#523).
2018-07-30 20:52:42 +02:00
Philip Rebohle c31e646921
[dxvk] Introduce concept of shader constants
Large constant arrays should be moved to a uniform buffer instead
of being baked directly into the shader code.
2018-07-30 20:29:05 +02:00
Philip Rebohle a8eb7d343a
[dxvk] Reconfigure bindings
In order to map ICBs to uniform buffers, we need one spare constant
buffer slot per shader stage.
2018-07-30 20:29:05 +02:00
Philip Rebohle a196451400
[dxbc] Respect number of input/output components
Fixes issues with geometry shaders exceeding output component limits.
2018-07-01 17:45:50 +02:00
Philip Rebohle 2bce1491c6
WIP: Typed shader interfaces 2018-07-01 12:44:37 +02:00
Philip Rebohle c370eea948
[dxbc] Decorate untyped write-only UAVs as NonReadable 2018-06-28 03:42:11 +02:00
Philip Rebohle 6cc303c5ef
[dxbc] Implement SV_ViewportID as pixel shader input 2018-06-27 12:02:54 +02:00
Philip Rebohle 845c78fd20
[dxbc] Consider stream index in signature entry lookup 2018-06-23 20:13:00 +02:00
Philip Rebohle dd51437584
[dxbc] Implement EmitThenCut / EmitThenCutStream 2018-06-23 17:34:50 +02:00
Philip Rebohle 07ef25fec5
[dxbc] Parse OSG5 chunk for Shader Model 5 geometry shaders 2018-06-23 17:25:03 +02:00
Philip Rebohle 102591369e
[dxbc] Add DxbcModuleInfo struct
This will be required in the future to pass data from the
application to the shader compiler.
2018-06-23 17:14:35 +02:00
Philip Rebohle f7587014c7
[dxbc] Fix compiler warning 2018-06-18 15:33:35 +02:00
Philip Rebohle a607fe107f
[dxbc] Remove workarounds for the old Nvidia shader compiler 2018-06-12 22:13:53 +02:00
Philip Rebohle f5d55726b3
[dxbc] Fix index returned by ImmAtomicConsume instruction
Since the atomic operations always return the old value, we have to
subtract one for the consume instruction. The append instruction is
unaffected. Fixes an issue with vegetation in Final Fantasy XV.
2018-06-11 20:17:29 +02:00
Philip Rebohle e35cbf833c
[dxbc] Fixed issue with FtoD instruction picking an incorrect type 2018-06-07 16:02:59 +02:00
Philip Rebohle 10170a89ab
[dxbc] Implemented 64-bit compare instructions 2018-06-07 15:21:30 +02:00
Philip Rebohle a89eb15546
[dxbc] Implemented 64-bit Vector ALU instructions 2018-06-07 15:05:06 +02:00
Philip Rebohle 97af5ee6fe
[dxbc] Implement DtoF and FtoD instructions 2018-06-07 14:32:56 +02:00
Philip Rebohle 217399926d
Revert "[dxbc] Bound-check dynamically indexed constant buffer reads"
This reverts commit 621aed5fdb.

Breaks Dishonored 2. Apparently, out-of-bounds access to constant buffers
is allowed as long as it doesn't exceed the range of bound constants.
2018-06-02 18:09:59 +02:00
Philip Rebohle 9ff17b03f2
[dxbc] Support RenderTargetId and ViewportId in Vertex/Domain shaders
Fixes shader compilation errors in Pillars of Eternity II (#408)
and Lost Sphear (#406). Currently unsupported by RADV.
2018-06-01 13:57:26 +02:00
Philip Rebohle aa76bae32a
[dxbc] Fix incorrect OpSelectionMerge instruction
Fixes a regression introduced in v0.53 that would cause
Witcher 3 to crash when enabling Nvidia Hairworks on RADV.
2018-05-31 14:20:12 +02:00
Philip Rebohle 621aed5fdb
[dxbc] Bound-check dynamically indexed constant buffer reads
Emulates D3D11 behaviour more closely on Nvidia hardware.
Fixes an issue in Dark Souls Remastered caused by constant
buffer access with an undefined index value (#405).
2018-05-31 10:13:32 +02:00
Philip Rebohle 001794a094
[dxbc] Implement deferred kill operation
Fixes visual issues during LOD transitions in The Witcher 3,
Rise of the Tomb Raider and other games with a similar LOD
system. UAV stores and atomics are conditionalized as well.
2018-05-26 19:25:20 +02:00
Philip Rebohle 0619842dd9
[dxbc] Make UAV stores and atomics conditional
We should only perform stores when the corresponding
UAV is bound. This may be extended with range checks
at a later time.
2018-05-26 19:01:44 +02:00
Philip Rebohle 9278221416
[dxbc] Run analyzer before creating compiler object
We may need the analysis results when initializing the compiler object.
2018-05-26 17:46:49 +02:00
Philip Rebohle af62d423b2
[dxbc] Add per-device option for deferred kills 2018-05-26 17:08:39 +02:00
Philip Rebohle ec5572aa69
[dxbc] Scan for discard and derivative instructions 2018-05-26 17:08:08 +02:00
Philip Rebohle d79f39b963
[dxbc] Implement sampleinfo instruction for rasterizer 2018-05-26 14:54:05 +02:00
Philip Rebohle a43025294a
[dxbc] Remove DxbcImageInfo::layered property 2018-05-24 12:07:03 +02:00