mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
anv: fix calculation of buffer size in case dynamic size is used
VK spec got clarification about the pSizes parameter. Fixes set of new tests: dEQP-VK.pipeline.extended_dynamic_state*with_offset* v2: move offset subtract to be part of size calculation (Jason) CC: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3871 Fixes:b9a05447a1("anv: dynamic vertex input binding stride and size support") Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7439> (cherry picked from commit5998a6543a)
This commit is contained in:
parent
1622143115
commit
5bbaec9d46
2 changed files with 16 additions and 5 deletions
|
|
@ -247,7 +247,7 @@
|
|||
"description": "anv: fix calculation of buffer size in case dynamic size is used",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "b9a05447a1976101c04a02f5588c51de0b0f6573"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3348,8 +3348,14 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
|
|||
if (buffer) {
|
||||
uint32_t stride = dynamic_stride ?
|
||||
cmd_buffer->state.vertex_bindings[vb].stride : pipeline->vb[vb].stride;
|
||||
uint32_t size = dynamic_size ?
|
||||
cmd_buffer->state.vertex_bindings[vb].size : buffer->size;
|
||||
/* From the Vulkan spec (vkCmdBindVertexBuffers2EXT):
|
||||
*
|
||||
* "If pname:pSizes is not NULL then pname:pSizes[i] specifies
|
||||
* the bound size of the vertex buffer starting from the corresponding
|
||||
* elements of pname:pBuffers[i] plus pname:pOffsets[i]."
|
||||
*/
|
||||
UNUSED uint32_t size = dynamic_size ?
|
||||
cmd_buffer->state.vertex_bindings[vb].size : buffer->size - offset;
|
||||
|
||||
state = (struct GENX(VERTEX_BUFFER_STATE)) {
|
||||
.VertexBufferIndex = vb,
|
||||
|
|
@ -3365,9 +3371,14 @@ genX(cmd_buffer_flush_state)(struct anv_cmd_buffer *cmd_buffer)
|
|||
.NullVertexBuffer = offset >= buffer->size,
|
||||
|
||||
#if GEN_GEN >= 8
|
||||
.BufferSize = size - offset
|
||||
.BufferSize = size,
|
||||
#else
|
||||
.EndAddress = anv_address_add(buffer->address, size - 1),
|
||||
/* XXX: to handle dynamic offset for older gens we might want
|
||||
* to modify Endaddress, but there are issues when doing so:
|
||||
*
|
||||
* https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7439
|
||||
*/
|
||||
.EndAddress = anv_address_add(buffer->address, buffer->size - 1),
|
||||
#endif
|
||||
};
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue