mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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) {
|
bool FloatEmu) {
|
||||||
auto UpdateHelper = [&] (auto& set) {
|
auto UpdateHelper = [&] (auto& set) {
|
||||||
if constexpr (ConstantType == D3D9ConstantType::Float) {
|
if constexpr (ConstantType == D3D9ConstantType::Float) {
|
||||||
auto begin = reinterpret_cast<const Vector4*>(pConstantData);
|
|
||||||
auto end = begin + Count;
|
|
||||||
|
|
||||||
if (!FloatEmu)
|
if (!FloatEmu) {
|
||||||
std::copy(begin, end, &set.fConsts[StartRegister]);
|
size_t size = Count * sizeof(Vector4);
|
||||||
else
|
|
||||||
std::transform(begin, end, &set.fConsts[StartRegister], replaceNaN);
|
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) {
|
else if constexpr (ConstantType == D3D9ConstantType::Int) {
|
||||||
auto begin = reinterpret_cast<const Vector4i*>(pConstantData);
|
size_t size = Count * sizeof(Vector4i);
|
||||||
auto end = begin + Count;
|
|
||||||
|
|
||||||
std::copy(begin, end, &set.iConsts[StartRegister]);
|
std::memcpy(set.iConsts[StartRegister].data, pConstantData, size);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (uint32_t i = 0; i < Count; i++) {
|
for (uint32_t i = 0; i < Count; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user