Closed danginsburg closed 5 months ago
Should the HLSL be:
uint16_t2 v2 = bit_cast<uint16_t2>( nWidth );
?
Your code casting it to uint16_t4 which is not 4 bytes.
Oh, yeah, sorry I was just playing around to see what compiled, I hadn't gotten to the point of trying to write usable code with it yet. :) Probably it should generate errors somewhere north of spirv-val though?
Agreed. We are missing a diagnostic here.
From: Dan Ginsburg @.> Sent: Thursday, February 15, 2024 1:12 PM To: shader-slang/slang @.> Cc: Yong He @.>; Comment @.> Subject: Re: [shader-slang/slang] [ SPIR-V ] Support HLSL SM6.6 Pack/Unpack intrinics (Issue #3594)
Oh, yeah, sorry I was just playing around to see what compiled, I hadn't gotten to the point of trying to write usable code with it yet. :) Probably it should generate errors somewhere north of spirv-val though?
— Reply to this email directly, view it on GitHubhttps://github.com/shader-slang/slang/issues/3594#issuecomment-1947346950, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAUHRBN4XCBS2W5BX7POLX3YTZ24TAVCNFSM6AAAAABDKXXWUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXGM2DMOJVGA. You are receiving this because you commented.Message ID: @.***>
Given that there is already a better alternative for SPIRV, the main work here is to expose the HLSL intrinsics.
@danginsburg I want to drop the priority of this issue a bit in hope that the current solution is sufficient to unblock your progress. Let us know if you want this prioritized.
@danginsburg I want to drop the priority of this issue a bit in hope that the current solution is sufficient to unblock your progress. Let us know if you want this prioritized.
So you are saying that bit_cast<>
with the direct SPIR-V backend should provide all the functionality of the SM6.6 intrinics, sans catching errors?
Unless I am missing anything, the HLSL intrinsic is essentially just providing bit cast without exposing real int8 types. SPIRV already gives us int8 and bit cast, and it feels silly to use that HLSL intrinsics.
@jkwak-work Is this something you can plan with Ariel to get done?
@jkwak-work Is this something you can plan with Ariel to get done?
I think Ariel can do it because the goal is very clear and the scope is limited.
Because the milestone is set to Q2, I am gonna assume that we can aim for the completion within two or three months. Please let me know if it is more urgent than I can see.
Yes, that's fine. Thank you for taking this!
This is done.
This bug covers a few different requests/issues:
bit_cast
functionality does not generate valid GLSL for the SPIR-V glslang backendbit_cast
functionality does not generate valid SPIR-V for the SPIR-V direct backendSo I hope the outcome would be adding the HLSL syntax and fixing code generation bugs. For example for #2/#3:
In the glslang backend it generates:
In the direct SPIR-V backend it generates code, but it fails spirv-val:
Full spir-v: