FUCK YOUUUUUUUUUUUUUUUUUU

This commit is contained in:
lizzie
2026-01-25 00:59:04 +00:00
committed by crueter
parent de9d2f9edf
commit a51874a92b
2 changed files with 10 additions and 8 deletions

View File

@@ -116,11 +116,13 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, DynamicFe
// We sparsely store the bits for each of them, so if they clash we don't deal
// with the fixed pipeline taking in invalid vertices! :)
const auto& attrs = regs.vertex_attrib_format;
attribute_types[0] = attribute_types[1] = attribute_types[2] = attribute_types[3] = 0;
attribute_types[0] = 0;
attribute_types[1] = 0;
attribute_types[2] = 0;
static_assert(Maxwell::NumVertexAttributes == 32);
for (size_t i = 0; i < Maxwell::NumVertexAttributes; ++i) {
u32 const mask = attrs[i].constant != 0 ? 0 : 0x07; // non-constant equates invalid
u32 const type = size_t(attrs[i].type.Value());
u32 const type = u32(attrs[i].type.Value());
attribute_types[0] |= u64((type >> 0) & 1) << i;
attribute_types[1] |= u64((type >> 1) & 1) << i;
attribute_types[2] |= u64((type >> 2) & 1) << i;

View File

@@ -225,10 +225,10 @@ struct FixedPipelineState {
u32 point_size;
std::array<u16, Maxwell::NumViewports> viewport_swizzles;
union {
std::array<u32, 3> attribute_types; // Used with VK_EXT_vertex_input_dynamic_state
u64 enabled_divisors;
};
// TODO: this has to be trivially constructuible and both are mutually exclusive
std::array<u64, 3> attribute_types; // Used with VK_EXT_vertex_input_dynamic_state
u64 enabled_divisors;
DynamicState dynamic_state;
std::array<BlendingAttachment, Maxwell::NumRenderTargets> attachments;
@@ -277,9 +277,9 @@ struct FixedPipelineState {
}
u32 DynamicAttributeType(size_t i) const noexcept {
return (((attribute_types[0] >> i) & 1) << 0)
return u32((((attribute_types[0] >> i) & 1) << 0)
| (((attribute_types[1] >> i) & 1) << 1)
| (((attribute_types[2] >> i) & 1) << 2);
| (((attribute_types[2] >> i) & 1) << 2));
}
};
static_assert(std::has_unique_object_representations_v<FixedPipelineState>);