Convert BPMemory to BitField and enum class

Additional changes:
- For TevStageCombiner's ColorCombiner and AlphaCombiner, op/comparison and scale/compare_mode have been split as there are different meanings and enums if bias is set to compare.  (Shift has also been renamed to scale)
- In TexMode0, min_filter has been split into min_mip and min_filter.
- In TexImage1, image_type is now cache_manually_managed.
- The unused bit in GenMode is now exposed.
- LPSize's lineaspect is now named adjust_for_aspect_ratio.
This commit is contained in:
Pokechu22
2021-02-10 18:11:31 -08:00
parent db8ced7e4e
commit 70f9fc4e75
33 changed files with 1553 additions and 1236 deletions

View File

@ -66,7 +66,7 @@ static void GetD3DRasterizerDesc(D3D12_RASTERIZER_DESC* desc, const Rasterizatio
{D3D12_CULL_MODE_NONE, D3D12_CULL_MODE_BACK, D3D12_CULL_MODE_FRONT, D3D12_CULL_MODE_FRONT}};
desc->FillMode = D3D12_FILL_MODE_SOLID;
desc->CullMode = cull_modes[rs_state.cullmode];
desc->CullMode = cull_modes[u32(rs_state.cullmode.Value())];
desc->MultisampleEnable = fb_state.samples > 1;
}
@ -80,7 +80,7 @@ static void GetD3DDepthDesc(D3D12_DEPTH_STENCIL_DESC* desc, const DepthState& st
D3D12_COMPARISON_FUNC_ALWAYS}};
desc->DepthEnable = state.testenable;
desc->DepthFunc = compare_funcs[state.func];
desc->DepthFunc = compare_funcs[u32(state.func.Value())];
desc->DepthWriteMask =
state.updateenable ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO;
}
@ -135,24 +135,24 @@ static void GetD3DBlendDesc(D3D12_BLEND_DESC* desc, const BlendingState& state)
rtblend->BlendOpAlpha = state.subtractAlpha ? D3D12_BLEND_OP_REV_SUBTRACT : D3D12_BLEND_OP_ADD;
if (state.usedualsrc)
{
rtblend->SrcBlend = src_dual_src_factors[state.srcfactor];
rtblend->SrcBlendAlpha = src_dual_src_factors[state.srcfactoralpha];
rtblend->DestBlend = dst_dual_src_factors[state.dstfactor];
rtblend->DestBlendAlpha = dst_dual_src_factors[state.dstfactoralpha];
rtblend->SrcBlend = src_dual_src_factors[u32(state.srcfactor.Value())];
rtblend->SrcBlendAlpha = src_dual_src_factors[u32(state.srcfactoralpha.Value())];
rtblend->DestBlend = dst_dual_src_factors[u32(state.dstfactor.Value())];
rtblend->DestBlendAlpha = dst_dual_src_factors[u32(state.dstfactoralpha.Value())];
}
else
{
rtblend->SrcBlend = src_factors[state.srcfactor];
rtblend->SrcBlendAlpha = src_factors[state.srcfactoralpha];
rtblend->DestBlend = dst_factors[state.dstfactor];
rtblend->DestBlendAlpha = dst_factors[state.dstfactoralpha];
rtblend->SrcBlend = src_factors[u32(state.srcfactor.Value())];
rtblend->SrcBlendAlpha = src_factors[u32(state.srcfactoralpha.Value())];
rtblend->DestBlend = dst_factors[u32(state.dstfactor.Value())];
rtblend->DestBlendAlpha = dst_factors[u32(state.dstfactoralpha.Value())];
}
}
else
{
rtblend->LogicOpEnable = state.logicopenable;
if (state.logicopenable)
rtblend->LogicOp = logic_ops[state.logicmode];
rtblend->LogicOp = logic_ops[u32(state.logicmode.Value())];
}
}