-
Notifications
You must be signed in to change notification settings - Fork 0
Added flag for disabling HLSL intrinsics #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devshFixes
Are you sure you want to change the base?
Conversation
|
PR description is empty, please add some valid description |
…hlsl-intrinsics` flag is set
| // Also removed: compress, decompress, /Gch (child effect), /Gpp (partial precision) | ||
| // /Op - no support for preshaders. | ||
|
|
||
| def devsh_disable_hlsl_intrinsics : Flag<["-"], "devsh-disable-hlsl-intrinsics">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could call it fvk- instead of devsh- to keep with the convention
| extern std::optional<bool> disableHLSLIntrinsicsGlobalVariableBecauseIDontCare; | ||
|
|
||
| inline bool shouldDisableHLSLIntrinsics() | ||
| { | ||
| assert(disableHLSLIntrinsicsGlobalVariableBecauseIDontCare.has_value()); | ||
|
|
||
| if (!disableHLSLIntrinsicsGlobalVariableBecauseIDontCare.has_value()) | ||
| exit(-1); | ||
|
|
||
| return disableHLSLIntrinsicsGlobalVariableBecauseIDontCare.value(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hide the global var (they mess with DLL delay loads), make the function non-inline and export like the hlsl::Check functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of the other SemaHLSL things seem to work via global vars!
| "WorldToObject", | ||
| "WorldToObject3x4", | ||
| "WorldToObject4x3" | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bunch of these are builtin input or output variables, shouldn't be allowed
| StringRef nameIdentifier, | ||
| size_t argumentCount) { | ||
| // TODO: only check if the flag "devsh-disable-hlsl-intrinsics" is enabled | ||
| if (shouldDisableHLSLIntrinsics() && !checkIfIntrinsicIsAllowed(nameIdentifier)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need a standalone shouldDisableHLSLIntrinsics ? you could slap it into checkIfIntrinsicIsAllowed
No description provided.