[GPU] Fix min/max blend operations to properly apply factors

Applies factors before the MIN/MAX operation - in FSI/ROV via runtime
blending, in FBO/RTV by pre-multiplying shader output when dstFactor is
ONE only, as we don't have access to dest to provide full support as we
do in the FSI/ROV paths.
This commit is contained in:
Herman S.
2025-12-16 23:54:09 +09:00
parent 966d8f0925
commit 067641668f
6 changed files with 716 additions and 164 deletions

View File

@@ -114,7 +114,7 @@ class DxbcShaderTranslator : public ShaderTranslator {
// If anything in this is structure is changed in a way not compatible with
// the previous layout, invalidate the pipeline storages by increasing this
// version number (0xYYYYMMDD)!
static constexpr uint32_t kVersion = 0x20220720;
static constexpr uint32_t kVersion = 0x20251216;
enum class DepthStencilMode : uint32_t {
kNoModifiers,
@@ -179,6 +179,12 @@ class DxbcShaderTranslator : public ShaderTranslator {
uint32_t dynamic_addressable_register_count : 8;
// Non-ROV - depth / stencil output mode.
DepthStencilMode depth_stencil_mode : 2;
// For host render targets with MIN/MAX blend op - the source blend factor
// to pre-multiply the shader output by (since D3D12 MIN/MAX ignores blend
// factors, but Xbox 360 applies them). kOne means no pre-multiply.
// Only RT0 is supported for now.
xenos::BlendFactor rt0_blend_rgb_factor_for_premult : 5;
xenos::BlendFactor rt0_blend_a_factor_for_premult : 5;
} pixel;
explicit Modification(uint64_t modification_value = 0)