Skip to content

vkd3d-shader/hlsl: Broaden resources support (draft).

Francisco Casas requested to merge fcasas/vkd3d:resources into master

This patch series has gotten quite big

I don't expect this to be approved but I think it would be good if you review this approach so I start sending this patch series in fragments

Because there are design decisions with long term effects

Includes:

  • Many small fixes to corner cases I have stumbled upon.
  • For SM1, the tex2D and tex3D intrinsics, inferring generic samplers dimension from usage, writing sampler declarations, and writing sample instructions.
  • Support for arrays of resources for both SM1 and SM4.
  • Support for synthetic combined samplers for SM1 and synthetic separated samplers for SM4, considering that they can be arrays or members of other structs.

All of this considering that the assignment of register indexes on allocation for each object component has to match match

Some design changes are important in the long run

Long reach of support to make sure this changes were in the right direction (I had to discard several approaches before reaching this one)

Resource allocation is challenging because it is done at array level even if array is a member within a struct.

because

While I doubt this will be accepted quickly, I think it is a good thing

Among the most complex things is ensuring that allocated

I have tested with ps_3_0 and ps_5_0

These are some of the tests I have been running both for SM1 and SM4 (with -GeC) flag, so that the allocated registers matches the ones of the native compiler.

sm1-separated-samplers.hlsl

sm1-separated-samplers-array.hlsl

sm1-separated-samplers-2.hlsl

sm1-reserves-and-arrays.hlsl

sm1-reserves-and-dims.hlsl

sm1-combined-order.hlsl

sm1-separated-and-combined-samplers.hlsl

This patch series doesn't include these tests nor at automated way of testing them yet.

Merge request reports

Loading