1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05:52:11 +01:00

[d3d9] Compute vertex extent in BindInputLayout

This commit is contained in:
Philip Rebohle 2022-08-07 16:46:46 +02:00
parent bb8a87196f
commit 64169316e6
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -6206,6 +6206,7 @@ namespace dxvk {
DxvkVertexBinding binding;
binding.binding = attrib.binding;
binding.extent = attrib.offset + lookupFormatInfo(attrib.format)->elementSize;
uint32_t instanceData = cStreamFreq[binding.binding % caps::MaxStreams];
if (instanceData & D3DSTREAMSOURCE_INSTANCEDATA) {
@ -6217,19 +6218,12 @@ namespace dxvk {
binding.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
}
// Check if the binding was already defined.
bool bindingDefined = false;
for (uint32_t j = 0; j < i; j++) {
uint32_t bindingId = attrList.at(j).binding;
if (binding.binding == bindingId) {
bindingDefined = true;
}
}
if (!bindingDefined)
if (bindMask & (1u << binding.binding)) {
bindList.at(binding.binding).extent = std::max(
bindList.at(binding.binding).extent, binding.extent);
} else {
bindList.at(binding.binding) = binding;
}
attrMask |= 1u << i;
bindMask |= 1u << binding.binding;