1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 22:08:59 +01:00

[dxvk] Use vertex extent from vertex binding info

Computing this at runtime is fairly expensive, so try to avoid.
This commit is contained in:
Philip Rebohle 2022-08-07 16:48:05 +02:00
parent 6bcb0a0d61
commit 88bdf2b592
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -2371,20 +2371,18 @@ namespace dxvk {
m_state.gp.state.ilBindings[i] = DxvkIlBinding(
bindings[i].binding, 0, bindings[i].inputRate,
bindings[i].fetchRate);
m_state.vi.vertexExtents[bindings[i].binding] = 0;
m_state.vi.vertexExtents[i] = bindings[i].extent;
}
for (uint32_t i = bindingCount; i < m_state.gp.state.il.bindingCount(); i++)
for (uint32_t i = bindingCount; i < m_state.gp.state.il.bindingCount(); i++) {
m_state.gp.state.ilBindings[i] = DxvkIlBinding();
m_state.vi.vertexExtents[i] = 0;
}
for (uint32_t i = 0; i < attributeCount; i++) {
m_state.gp.state.ilAttributes[i] = DxvkIlAttribute(
attributes[i].location, attributes[i].binding,
attributes[i].format, attributes[i].offset);
uint32_t extent = attributes[i].offset + lookupFormatInfo(attributes[i].format)->elementSize;
m_state.vi.vertexExtents[attributes[i].binding] = std::max(extent,
m_state.vi.vertexExtents[attributes[i].binding]);
}
for (uint32_t i = attributeCount; i < m_state.gp.state.il.attributeCount(); i++)
@ -5137,7 +5135,7 @@ namespace dxvk {
if (strides[i]) {
// Dynamic strides are only allowed if the stride is not smaller
// than highest attribute offset + format size for given binding
newDynamicStrides &= strides[i] >= m_state.vi.vertexExtents[binding];
newDynamicStrides &= strides[i] >= m_state.vi.vertexExtents[i];
}
if (m_vbTracked.set(binding))