I implemented that idea on this branch: https://gitlab.winehq.org/fcasas/vkd3d/-/commits/srv_buffers2,
I am not sure I like it very much, so I will wait for feedback before pushing it to this MR.
Broadly, I like it better than the alternative. I do notice you're checking for RESOURCE_DIMENSION_2D in a number of places, and that's likely a mistake. In general, buffer resources are the special case, and e.g. 2D, 2D-array, and 3D textures can all be handled by the same code.
I think we should also adjust the .shader_test syntax. Instead of ``` [texture 0] size (2, 2) 0.1 0.2 0.3 0.4 0.5 0.7 0.6 0.8 0.6 0.5 0.2 0.1 0.8 0.0 0.7 1.0
[buffer uav 0] size (1, 1) 0.1 0.2 0.3 0.4
[render target 1] format r32g32b32a32 float size (640, 480) ``` I'd suggest ``` [srv 0] size (2d, 2, 2) 0.1 0.2 0.3 0.4 0.5 0.7 0.6 0.8 0.6 0.5 0.2 0.1 0.8 0.0 0.7 1.0
[uav 0] size (buffer, 1) 0.1 0.2 0.3 0.4
[rtv 1] format r32g32b32a32 float size (2d, 640, 480) ``` or perhaps some variant. We may want to start thinking about separating resources from views at some point as well, but we probably don't need to worry about that too much for the moment.