Fix model track-group movement and RGB destination-alpha blending
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace mt_host {
|
||||
// PORT: the recorded back buffer is X8R8G8B8 and GPU shadow targets are R5G6B5.
|
||||
// Their destination alpha is always 1, even when Vulkan storage has an alpha
|
||||
// channel. Reading that storage alpha makes DESTALPHA particles darken the scene.
|
||||
inline std::uint8_t d3d_blend_for_rgb_target(std::uint8_t factor) {
|
||||
switch (factor) {
|
||||
case 7: return 2; // DESTALPHA -> ONE
|
||||
case 8: return 1; // INVDESTALPHA -> ZERO
|
||||
case 11: return 1; // SRCALPHASAT -> min(As, 1 - Ad) = ZERO (RGB)
|
||||
default: return factor;
|
||||
}
|
||||
}
|
||||
} // namespace mt_host
|
||||
Reference in New Issue
Block a user