DirectXShaderCompiler/include
Tex Riddell 52ace1c57c
Fix module loading and validation issues (#5880)
Fix module loading and validation issues

There are a couple interacting issues:
1. When RefreshCache occurs, it doesn't fill in the m_pResRetType cache.
  - This is because in GetOpFunc, if it finds a function matching the
    expected name, it simply returns that, skipping function type
    construction.
- This causes a validation error if CheckAccessFullyMapped is validated
    before a function that calls it.  This depends on the order of
    function declarations/definitions in the module.
- The solution is to move the check after type construction, and verify
    that the function type matches expectations as well.
2. When RefreshCache() and FixOverloadNames() was called from
DxilOperations
    constructor, the m_LowPrecisionMode has not yet been set, leading to
    incorrect overload types when allowing function type construction to
    proceed in GetOpFunc before looking for a matching function by name.
  - This leads to an incorrect type for 16-bit CBufRet type being used.
  - The solution is to move RefreshCache() and FixOverloadNames() calls
to after we actually know the m_LowPrecisionMode, so that the correct
    types may be constructed.

Rename hlsl::OP::SetMinPrecision to InitWithMinPrecision to make clear
what's being done.
Added validation tests to verify the fixes.
Fixed validation test that produced invalid DXIL op function signature.
Fix HLModule not setting min-precision mode when loading from metadata.

Fixes #5879
2023-11-01 12:32:06 -07:00
..
dxc Fix module loading and validation issues (#5880) 2023-11-01 12:32:06 -07:00
llvm [bug] Fix crash when lowering multi-dimension groupshared variable (#5895) 2023-10-23 11:00:36 -07:00
llvm-c [NFC] Remove SAL annotations from internal APIs (#5639) 2023-09-14 08:59:49 -05:00
miniz [NFC] Clang-format DXC sources (#5602) 2023-09-19 07:49:22 -05:00