d3d12: Handle bitcasting of shader images

This is handled in 2 ways:
* For casts in the same "class," we can just do the cast. There's also
  limited support for 4x8 => 1x32 and 2x16 => 1x32.
* For casts that are just by size, use a lowering pass. This reads the
  data in the appropriate UINT format (except R11G11B10), retrieves
  the original bits, re-packs it into the dest, and returns it to the
  app for loads. For stores, the process is done in reverse - bits
  for the final format are computed and re-expanded to the format that
  should be used for the store.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14342>
This commit is contained in:
Jesse Natalie
2021-12-30 17:54:05 -08:00
committed by Marge Bot
parent 156ef05ec7
commit 0f8213cb10
9 changed files with 352 additions and 1 deletions

View File

@@ -230,6 +230,7 @@ init_texture(struct d3d12_screen *screen,
(support.Support2 & (D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD | D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE)) ==
(D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD | D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE)) {
desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
desc.Format = d3d12_get_typeless_format(templ->format);
}
}