hlsl: Minor fixes for intrinsic type handling.
Merge request reports
Activity
I wonder whether
elementwise_intrinsic_convert_args()
andelementwise_intrinsic_float_convert_args()
should return a pointer to the type that was computed, rather than just a boolean, given that we always end looking for it.Also, would you consider writing some tests? They would often depend on overloading, I guess, but hopefully eventually we'll have that too.
I wonder whether
elementwise_intrinsic_convert_args()
andelementwise_intrinsic_float_convert_args()
should return a pointer to the type that was computed, rather than just a boolean, given that we always end looking for it.Yeah, I think you're right.
Also, would you consider writing some tests? They would often depend on overloading, I guess, but hopefully eventually we'll have that too.
Yeah, it would probably be nice to have comprehensive tests for this.
Since this is purely a HLSL-side feature, and comprehensive type system testing would ideally involve a lot of tests, it'd be nice if we can find a way to test without needing to run the shader... maybe SHDR exact content matching is not unreasonable here.
Since this is purely a HLSL-side feature, and comprehensive type system testing would ideally involve a lot of tests, it'd be nice if we can find a way to test without needing to run the shader... maybe SHDR exact content matching is not unreasonable here.
I don't immediately see what advantage that would give us, but I'm not necessarily against it.
Some preliminary benchmarks suggest that, on this machine:
Windows HLSL compilation: 0.7 ms (sm1), 1.2 ms (sm4) Windows d3d12 draw/readback cycle: 7.3 ms vkd3d HLSL compilation: 0.12 ms vkd3d d3d12 draw/readback cycle: 1 ms
So yeah, avoiding the draw/readback does improve things by up to six times. Maybe that's still not enough to be worth the effort?
It is worth noting though that we do already emit the exact same bytecode for the simple case where we're able to return a constant value, though.
edit: markdown
Edited by Elizabeth Figura
added 46 commits
-
dec50535...6e6e2910 - 40 commits from branch
wine:master
- 7636f2a2 - vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in write_atan_or_atan2().
- 24e29649 - vkd3d-shader/hlsl: Use elementwise_intrinsic_convert_args() in intrinsic_dst().
- e7eadb38 - vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in intrinsic_faceforward().
- b23c172a - vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in intrinsic_smoothstep().
- 2688a24b - vkd3d-shader/hlsl: Preserve halves in intrinsic_step().
- 82773eb8 - vkd3d-shader/hlsl: Use elementwise_intrinsic_float_convert_args() in refract().
Toggle commit list-
dec50535...6e6e2910 - 40 commits from branch