vkd3d-shader/hlsl: Implement SampleCmp() method.
Merge request reports
Activity
- Resolved by Nikolay Sivov
- Resolved by Nikolay Sivov
- Resolved by Nikolay Sivov
I won't ask for it for this patch, since I've already reviewed it, but in the future, please try to split up commits more. It's a lot easier to review with granular changes. E.g. in this case we could have had:
- change "lod" to "params"
- parse SamplerComparisonState
- parse the SampleCmp() function
- emit sm4 for HLSL_RESOURCE_SAMPLE_CMP
added 5 commits
- 0e8c4793 - vkd3d-shader/hlsl: Move object type checks to methods handlers.
- ed2e7f33 - vkd3d-shader/hlsl: Use a function table for object methods handlers.
- 792d5e3d - vkd3d-shader/hlsl: Parse SamplerComparisonState objects.
- 6d077f12 - vkd3d-shader/hlsl: Parse SampleCmp() method.
- 398b4c30 - vkd3d-shader/tpf: Write out comparison mode sampler declarations and...
Toggle commit listComparison samplers by themselves aren't hard, but it does mean we need to add stuff for depth write and also support rebinding a DSV as an SRV. (Or blitting?) Both things that'd be nice to have eventually; I'd like everything to have at least some manner of test even if it's not in the shader runner...
Mmmh, maybe I am misunderstanding what
SampleCmp()
does. Based on what I can read in https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-samplecmp it doesn't look like that you have to deal with DSVs:For each texel fetched (based on the sampler configuration of the filter mode), SampleCmp performs a comparison of the z value (3rd component of input) from the shader against the texel value (1 if the comparison passes; otherwise 0). SampleCmp then blends these 0 and 1 results for each texel together as in normal texture filtering (not an average) and returns the resulting [0..1] value to the shader.
It seems that you just have to create a texture with some data in the third component and then sample it. Am I missing something?
If I am indeed misunderstanding and it turns out that having a non trivial test would take a lot of work, then ignore my comment.
Edited by Giovanni Mascellani
added 16 commits
-
398b4c30...1af662ae - 11 commits from branch
wine:master
- ce5c5406 - vkd3d-shader/hlsl: Move object type checks to methods handlers.
- 41ce32d2 - vkd3d-shader/hlsl: Use a function table for object methods handlers.
- 5b15f7b5 - vkd3d-shader/hlsl: Parse SamplerComparisonState objects.
- ca83e013 - vkd3d-shader/hlsl: Parse SampleCmp() method.
- 4bdd9c34 - vkd3d-shader/tpf: Write out comparison mode sampler declarations and...
Toggle commit list-
398b4c30...1af662ae - 11 commits from branch
added 12 commits
-
4bdd9c34...855bb71f - 7 commits from branch
wine:master
- f20071da - vkd3d-shader/hlsl: Move object type checks to methods handlers.
- c7df2754 - vkd3d-shader/hlsl: Use a function table for object methods handlers.
- 52f45b6c - vkd3d-shader/hlsl: Parse SamplerComparisonState objects.
- 33497b62 - vkd3d-shader/hlsl: Parse SampleCmp() method.
- 8741481b - vkd3d-shader/tpf: Write out comparison mode sampler declarations and...
Toggle commit list-
4bdd9c34...855bb71f - 7 commits from branch
added 11 commits
-
8741481b...ea7d8c65 - 6 commits from branch
wine:master
- 69cead6c - vkd3d-shader/hlsl: Move object type checks to methods handlers.
- 66fe3a70 - vkd3d-shader/hlsl: Use a function table for object methods handlers.
- 58b38454 - vkd3d-shader/hlsl: Parse SamplerComparisonState objects.
- c0e222d0 - vkd3d-shader/hlsl: Parse SampleCmp() method.
- 1d2e9b0e - vkd3d-shader/tpf: Write out comparison mode sampler declarations and...
Toggle commit list-
8741481b...ea7d8c65 - 6 commits from branch
added 1 commit
- efc91cff - vkd3d-shader/hlsl: Parse SampleCmpLevelZero() method.
added 26 commits
-
efc91cff...bb680e73 - 20 commits from branch
wine:master
- 32d981ec - vkd3d-shader/hlsl: Move object type checks to methods handlers.
- 9b1d7228 - vkd3d-shader/hlsl: Use a function table for object methods handlers.
- 90eb00eb - vkd3d-shader/hlsl: Parse SamplerComparisonState objects.
- 8ed58548 - vkd3d-shader/hlsl: Parse SampleCmp() method.
- 04d8c3d0 - vkd3d-shader/tpf: Write out comparison mode sampler declarations and...
- 8c5a892d - vkd3d-shader/hlsl: Parse SampleCmpLevelZero() method.
Toggle commit list-
efc91cff...bb680e73 - 20 commits from branch
added 7 commits
-
aa17d139 - 1 commit from branch
wine:master
- 87cd3f87 - vkd3d-shader/hlsl: Move object type checks to methods handlers.
- efe107d2 - vkd3d-shader/hlsl: Use a function table for object methods handlers.
- 7c94705c - vkd3d-shader/hlsl: Parse SamplerComparisonState objects.
- 2fd3550b - vkd3d-shader/hlsl: Parse SampleCmp() method.
- c33219c9 - vkd3d-shader/tpf: Write out comparison mode sampler declarations and...
- a2e85a8a - vkd3d-shader/hlsl: Parse SampleCmpLevelZero() method.
Toggle commit list-
aa17d139 - 1 commit from branch