[DXBC] Cleanup: kSysConst_*_Vec/Comp > LoadSystemConstant

This commit is contained in:
Triang3l
2021-05-16 17:43:18 +03:00
parent ff23b1d9f9
commit 9f8a432479
5 changed files with 308 additions and 569 deletions

View File

@@ -101,13 +101,9 @@ void DxbcShaderTranslator::ExportToMemory() {
uint32_t control_temp = PushSystemTemp();
// Safety check if the shared memory is bound as UAV.
system_constants_used_ |= 1ull << kSysConst_Flags_Index;
a_.OpUBFE(dxbc::Dest::R(control_temp, 0b0001), dxbc::Src::LU(1),
dxbc::Src::LU(kSysFlag_SharedMemoryIsUAV_Shift),
dxbc::Src::CB(cbuffer_index_system_constants_,
uint32_t(CbufferRegister::kSystemConstants),
kSysConst_Flags_Vec)
.Select(kSysConst_Flags_Comp));
LoadFlagsSystemConstant());
// Open the `if` with the uniform condition for the shared memory buffer being
// bound as a UAV (more fine-grained checks are vector and likely divergent).
a_.OpIf(true, dxbc::Src::R(control_temp, dxbc::Src::kXXXX));