PatrickvL
061e38af6f
HLSL Pixel Shader tweaks;
...
Fully declare stages, to avoid "error X4000: variable 'stages' used without having been completely initialized"
Add alphakill support to fixed function
Use macro-based alphakill declaration in template (same as in fixed function)
Updated comments to differentiate between texture stage and combiner stage
Rename st into ts (texture stage) where appropriate
Fixed a typo in Brdf macro (was s1, must be ts now)
Updated Reflect to use C0 (uppercase, instead of lowercase host c0)
Initialized stage to zero for use in the C0 macro, now used Reflect
Fixed type of CombinerOutputMapping to actualle be PS_COMBINEROUTPUT_OUTPUTMAPPING
Introduced and used varios PS_*_MASK defines
Added some comments on pixel shader verification and test-case discovery.
2021-06-07 10:59:35 +02:00
Anthony
d46abef9a1
Redefine undefined ALPHAOP behaviour for Crash WoC
...
To aid debugging add a LOG_TEST_CASE , and include ALPHAARGs when ALPHAOP is disabled
2021-06-07 10:59:34 +02:00
Anthony
3da5b9f5d9
Include debug comment about how the final combiner hlsl was generated
...
Make hasFinalCombiner correspond to DecodedHasFinalCombiner
2021-06-07 10:59:34 +02:00
Anthony
a29c2f7d62
Force VS to write to oFog.x
...
Default fog factor to 1 (no fog)
2021-06-07 10:59:33 +02:00
Anthony
d8c18cf268
Mask flags when detecting colorarg1 + missing texture case
2021-06-07 10:59:33 +02:00
Anthony
6bf2a1f44f
Reuse colorOp variable
...
And additional comments
2021-06-07 10:59:32 +02:00
Anthony
ce7a5f6e40
Fix GTA III logos
...
Depending on ALPHAOP == DISABLE
2021-06-07 10:59:32 +02:00
Anthony
5aaadd026c
Implement missing texture behaviour
2021-06-07 10:59:32 +02:00
Anthony
990a24292d
Fix reflection equation
...
Improve BumpDemo
2021-06-07 10:59:31 +02:00
Anthony
85f792d2b2
Fix DOTPRODUCT3 texture op
...
Improves PerPixelLighting
2021-06-07 10:59:31 +02:00
Anthony
2f9558d307
Use SAMPLE_NONE instead of IsTextureSet
2021-06-07 10:59:30 +02:00
Anthony
814b040ff1
Normalize the values returned by the texture state converter
2021-06-07 10:59:30 +02:00
Anthony
657a8ef7c3
Disable lighting for point sprites
2021-06-07 10:59:30 +02:00
Anthony
5ea12636ee
Passthrough fogging and generate fog factor for fixed function mode
2021-06-07 10:59:29 +02:00
Anthony
3ea3cdc1a8
Fix implicitly extern shader variable
...
So the hardcoded values are used,
as values were unintuitively being read from constant registers
2021-06-07 10:59:29 +02:00
Anthony
6f2460c70a
Fixed function pixel shader
...
Placeholder shader until we are able to directly load the pixel shader program used on the Xbox
A shader is generated for each texture op and argument combination
2021-06-07 10:59:28 +02:00
Anthony
03200fdcd3
Re-enable texture stage swap hack
2021-06-07 10:59:28 +02:00
medievil1
90bdeac904
fix up fog mode ( #2163 )
...
fix up fog mode
2021-06-07 10:59:26 +02:00
Anthony
726d6ff4f3
Improve scaling of depth buffer texture coordinates
...
- GetZScale accepts a PixelContainer rather than a surface
- Fix accidental call to CxbxGetPixelContainerDepth instead of GetZScale
- Assume we should scale the z component for all depth buffers, not just linear ones
2021-06-07 10:58:46 +02:00
Anthony
512502ce36
Fix Azurik render issue
...
Remove #ifndef blocks that were driven by the opposite define than they should have been
Also provide the opposite flag as a comment, next to where the 'driver' define
2021-06-07 10:58:45 +02:00
Anthony
ad1652f050
Fix array index out-of-range crash
...
Remove PS_REGISTER_ONE usage since its not a register, but a combination of PS_REGISTER_ZERO and an INPUT_MAPPING
2021-06-07 10:58:45 +02:00
Anthony
fe6de7c621
Fix fog when xfc is undefined
...
* flip fog factor lerp. fog factor 1 = no fog
* ensure RC is zero initialized
2021-06-07 10:58:44 +02:00
Anthony
6373ba58bb
fixup typo VXSH instead of PXSH
2021-06-07 10:58:44 +02:00
Anthony
3c96e3236b
use vs_3_0
2021-06-07 10:58:43 +02:00
Anthony
b565d39ffe
fix abs instead of clamp
2021-06-07 10:58:43 +02:00
Anthony
7745515588
Fix front/back colour usage
2021-06-07 10:58:43 +02:00
PatrickvL
55f3c60ef2
Include Pixel Shader HLSL in output artifacts (and fixed a few typos in FixedFunction HLSL)
2021-06-07 10:58:42 +02:00
PatrickvL
b5cc970d7e
Corrected fixed-function formula's in final combiner
2021-06-07 10:58:42 +02:00
Anthony
7f89e72b2b
fixup enable complement in final combiner
...
(cherry picked from commit 71df0a3a5af94f550c2ecc25a47f78e54e74ee4a)
2021-06-07 10:58:41 +02:00
Anthony
e3c0b7287c
fixup FC0 and FC1 constant mapping
...
(cherry picked from commit 45cd7f72f07a5528b83bdadb24b46a934a7bfc50)
2021-06-07 10:58:41 +02:00
Anthony
cb4bbc17ee
Calculate the fog factor in the vertex shader
...
(cherry picked from commit 3c3ede07da1f0829697cc1635058b5dc4ec610d2)
2021-06-07 10:58:41 +02:00
Anthony
3216931da6
fixup fog colour constant register
...
(cherry picked from commit b99e63d944d2ceb474761ae88c8c90246071f0bc)
2021-06-07 10:58:40 +02:00
Anthony
9480bea9c0
Use sampler state
...
(cherry picked from commit ab2064ef690179560761d29eed53fd5b756b5dc7)
2021-06-07 10:58:39 +02:00
Anthony
65734fac9d
Wrap PS_INPUTMAPPING ops in brackets for consistent order of operations
...
(cherry picked from commit 001dca83fea387debd7e85893eb8b8631ea264fd)
2021-06-07 10:58:39 +02:00
PatrickvL
845bc7ef06
Renames, indenting, comments
2021-06-07 10:58:38 +02:00
PatrickvL
af0058ad61
WIP pointsprite nuances
2021-06-07 10:58:37 +02:00
PatrickvL
c6fdfc7101
Code cleanup (comments and variable renames)
2021-06-07 10:58:37 +02:00
patrickvl
4af986f058
No time to test, but here's alphakill support in PS HLSL
2021-06-07 10:58:36 +02:00
PatrickvL
29017db910
In DxbxUpdateActivePixelShader, transfer values step by step, instead of using a switch/case loop.
...
Also, working towards removing host SetTextureStageState calls (doesn't work yet).
2021-06-07 10:58:36 +02:00
PatrickvL
2990552230
Fixes after rebase
2021-06-07 10:58:35 +02:00
PatrickvL
b72b52a4a2
RenderState mapping table review remarks (nothing functional)
2021-06-07 10:58:35 +02:00
PatrickvL
4517f36456
Unrelated to PS :
...
UpdateFixedFunctionVertexShaderState now derives TexCoordComponentCount from GetXboxVertexAttributeFormat, which makes it honor overrides.
This could fix corrupted textures when Fixed Function HLSL is used together with VertexStream override modes.
2021-06-07 10:58:34 +02:00
PatrickvL
609a4d3276
[WIP] Xbox register combiner to HLSL pixel shader
2021-06-07 10:58:33 +02:00
PatrickvL
1e6845c940
Generalized HLSL shader compilation
2021-06-07 10:58:32 +02:00
Luke Usher
f6e54acf17
Merge pull request #2231 from NZJenkins/sleeps
...
SleepPrecise for more accurate sleeps
2021-06-07 09:45:56 +01:00
Luke Usher
da7a917ec5
Merge pull request #2232 from NZJenkins/ff-state2
...
Avoid unnecessary shader constant updates
2021-06-07 08:46:57 +01:00
Anthony
7d672600bb
Update dirty shader constants only
...
And try to minimize D3D9 calls
Constants are synced every draw, but titles may only use a few constants
so we can potentially save a lot of work
Increases performance a little (at least on certain titles like Buffy)
2021-06-06 23:15:38 +12:00
Anthony
0cb849a3f8
Avoid setting vertex shader constants more than once per draw
2021-06-06 22:49:58 +12:00
Anthony
3b1daf52ab
Addd braces
2021-06-02 22:38:43 +12:00
Anthony
76eb475ed6
Move SleepPrecise to Timer
2021-06-02 22:36:40 +12:00