vkd3d-shader/dxil: Handle some issues with pointers.
Forward pointers currently won't work because we don't emit an SSA value for pointers, so we can't allocate an id which will be defined later. Making VSIR support access chains is one way to resolve this. But if we do that, we should probably handle forward referenced resource handles the same way, and it would result in quite a bit of extra backend code. We probably don't need to deal with forward pointers before the next release. It would be nice to have though.
It's difficult to make dxcompiler emit forward pointer refs, so there are no tests for those.
Merge request reports
Activity
added 6 commits
- 6a307f35 - vkd3d-shader/dxil: Emit an error if a LOAD instruction uses a forward-referenced pointer.
- 941eb7b5 - vkd3d-shader/dxil: Emit an error if a STORE instruction uses a forward-referenced pointer.
- 2c161129 - vkd3d-shader/dxil: Emit an error if a ATOMICRMW instruction uses a forward-referenced pointer.
- 0efbf736 - vkd3d-shader/dxil: Emit an error if a CMPXCHG instruction uses a forward-referenced pointer.
- 360f3570 - tests/hlsl: Add a test for constexpr pointer cast.
- 88fc2352 - vkd3d-shader/dxil: Handle constexpr pointer cast.
Toggle commit listeven more difficult to arrange forward pointer refs, so there are no tests.
But have you seen forward constexpr pointer casts in the wild? My concern with the current implementation is that a forward reference might point to a value which is itself a forward reference, and if you just go through them in their definition order you might be copying an invalid register. In theory you'd need to first topologically sort the forward references and then process them in that order. Even if we keep the current implementation we probably want to error out if you find a forward reference (i.e., a register with type
VKD3DSPR_COUNT
) while resolving forward references.added 1 commit
- 8538f561 - vkd3d-shader/dxil: Handle constexpr pointer cast.
added 13 commits
-
8538f561...91762a62 - 7 commits from branch
wine:master
- b4b5af66 - vkd3d-shader/dxil: Emit an error if a LOAD instruction uses a forward-referenced pointer.
- 9615c389 - vkd3d-shader/dxil: Emit an error if a STORE instruction uses a forward-referenced pointer.
- b67a68b4 - vkd3d-shader/dxil: Emit an error if a ATOMICRMW instruction uses a forward-referenced pointer.
- 05510c11 - vkd3d-shader/dxil: Emit an error if a CMPXCHG instruction uses a forward-referenced pointer.
- 2fc32c3d - tests/hlsl: Add a test for constexpr pointer cast.
- fb730b11 - vkd3d-shader/dxil: Handle constexpr pointer cast.
Toggle commit list-
8538f561...91762a62 - 7 commits from branch