On Thu Jul 13 21:16:29 2023 +0000, Zebediah Figura wrote:
These tests are not passing for me on Windows (well, Wine really, but native d3dcompiler)—it fails in various places with "error X3523: DX9-style intrinsics are disabled when not in dx9 compatibility mode." Adding D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY to most D3DCompile() calls gets around that, but there's still a couple of failures. I see, I added a patch (4/10) to include the D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY flag on the pertinent shader_runner*.c files, but please check it.
--- Regarding this test: ``` Texture2D tex; sampler sam; // Textures for new separated samplers are allocated before regular textures. float4 main() : sv_target { return 10 * tex.Sample(sam, float2(0, 0)) + tex2D(sam, float2(0, 0)); } ``` Turns out I didn't `[require]` `shader model >= 4.0` at the beginning of the file so, on Windows, this ran with ps_3_0. In that case is the separated sampler which is lowered and allocated first: ``` // Name Reg Size // ------------ ----- ---- // sam+tex s0 1 // sam s1 1 ``` In ps_4_0 is the combined sampler which is lowered and allocated first, giving the expected result: ``` // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // sam sampler NA NA 0 1 // sam texture float4 2d 0 1 // tex texture float4 2d 1 1 ``` So I moved the `[require]` `shader model >= 4.0` to the beginning of the file. --- In this test: ``` sampler sam0; sampler sam1; sampler sam2; float4 main() : sv_target { return 100 * tex2D(sam1, float2(0, 0)) + 10 * tex2D(sam0, float2(0, 0)) + tex2D(sam2, float2(0, 0)); } ``` Seems that I made a mistake when I used to manually inspect the shader output. Indeed, the textures for separated are allocated in order of appearance, unlike the samplers. ``` // Name Type Format Dim HLSL Bind Count // ------------------------------ ---------- ------- ----------- -------------- ------ // sam0 sampler NA NA s0 1 // sam1 sampler NA NA s1 1 // sam2 sampler NA NA s2 1 // sam1 texture float4 2d t0 1 // sam0 texture float4 2d t1 1 // sam2 texture float4 2d t2 1 ``` I changed the expected result, and now the new texture variables are added in the order they appear and not after their respective sampler. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/209#note_38934