mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 02:52:10 +01:00
[d3d9] respect Vector4 alignment in UpdateStateConstants
This commit is contained in:
parent
1ed6edf096
commit
77d80acf75
@ -245,19 +245,21 @@ namespace dxvk {
|
||||
bool FloatEmu) {
|
||||
auto UpdateHelper = [&] (auto& set) {
|
||||
if constexpr (ConstantType == D3D9ConstantType::Float) {
|
||||
auto begin = reinterpret_cast<const Vector4*>(pConstantData);
|
||||
auto end = begin + Count;
|
||||
|
||||
if (!FloatEmu)
|
||||
std::copy(begin, end, &set.fConsts[StartRegister]);
|
||||
else
|
||||
std::transform(begin, end, &set.fConsts[StartRegister], replaceNaN);
|
||||
if (!FloatEmu) {
|
||||
size_t size = Count * sizeof(Vector4);
|
||||
|
||||
std::memcpy(set.fConsts[StartRegister].data, pConstantData, size);
|
||||
}
|
||||
else {
|
||||
for (UINT i = 0; i < Count; i++)
|
||||
set.fConsts[StartRegister + i] = replaceNaN(pConstantData + (i * 4));
|
||||
}
|
||||
}
|
||||
else if constexpr (ConstantType == D3D9ConstantType::Int) {
|
||||
auto begin = reinterpret_cast<const Vector4i*>(pConstantData);
|
||||
auto end = begin + Count;
|
||||
size_t size = Count * sizeof(Vector4i);
|
||||
|
||||
std::copy(begin, end, &set.iConsts[StartRegister]);
|
||||
std::memcpy(set.iConsts[StartRegister].data, pConstantData, size);
|
||||
}
|
||||
else {
|
||||
for (uint32_t i = 0; i < Count; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user