tgjones / shader-playground

Shader playground website for exploring HLSL, GLSL, SPIR-V compilers
http://shader-playground.timjones.io
BSD 2-Clause "Simplified" License
585 stars 46 forks source link

Microsoft DXC trunk is older than the advertised date (2022-02-05) #107

Closed sooknarine closed 2 years ago

sooknarine commented 2 years ago

Shader Playground says it's using DXC trunk 2022-02-05 but the output DXIL suggests it's quite a bit older.

Example: https://shader-playground.timjones.io/7fe4cff3eee0b279d6a0c62f84c8c639

The problematic line in the output DXIL:

%4 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 8, i32 0 })  ; AnnotateHandle(res,props)  resource: Texture2DMSArray<<invalid CompType>>

When I compile the same shader using the December 2021 DXC release, I see the correct output:

%4 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %3, %dx.types.ResourceProperties { i32 8, i32 1033 })  ; AnnotateHandle(res,props)  resource: Texture2DMSArray<4xF32>

The second component of ResourceProperties is i32 1033 instead of i32 0 and the CompType is 4xF32 instead of invalid CompType.

I think the fix happened in https://github.com/microsoft/DirectXShaderCompiler/commit/fd07613a95723550c3491b548967d5bae1ece374 (2021-03-15).

didito commented 2 years ago

Stumbled upon this issue after wanting to try HLSL 2021 support (--HV 2021).

Didn't work. Only current latest version, v1.6.2112 from Dec 08, 2021 has support for that: "DX Compiler for December 2021 with HLSL 2021 Preview"

After feeding -help via "Extra Options" you can see the actual version

Version: dxcompiler.dll: 1.6 - 1.6.0.2901 (87b11c2e)

That's clearly not "Updated from trunk on 2022-02-05". I can't even find traces of that version in the official DXC repository. I assume it's some out of band release, probably coming from an early Windows or Vulkan SDK release ...

tgjones commented 2 years ago

Thanks @sooknarine and @didito - this is fixed now.