mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-18 21:20:29 +01:00
turnip: Handle some error paths in allocating CS space from a command buffer.
Fixes some release-build warnings. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
This commit is contained in:
parent
9b156ef57b
commit
296468ef1a
2 changed files with 20 additions and 5 deletions
|
|
@ -561,7 +561,10 @@ r3d_src_common(struct tu_cmd_buffer *cmd,
|
|||
VkResult result = tu_cs_alloc(&cmd->sub_cs,
|
||||
2, /* allocate space for a sampler too */
|
||||
A6XX_TEX_CONST_DWORDS, &texture);
|
||||
assert(result == VK_SUCCESS);
|
||||
if (result != VK_SUCCESS) {
|
||||
cmd->record_result = result;
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(texture.map, tex_const, A6XX_TEX_CONST_DWORDS * 4);
|
||||
|
||||
|
|
|
|||
|
|
@ -1010,7 +1010,10 @@ tu_emit_input_attachments(struct tu_cmd_buffer *cmd,
|
|||
struct tu_cs_memory texture;
|
||||
VkResult result = tu_cs_alloc(&cmd->sub_cs, subpass->input_count * 2,
|
||||
A6XX_TEX_CONST_DWORDS, &texture);
|
||||
assert(result == VK_SUCCESS);
|
||||
if (result != VK_SUCCESS) {
|
||||
cmd->record_result = result;
|
||||
return (struct tu_draw_state) {};
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < subpass->input_count * 2; i++) {
|
||||
uint32_t a = subpass->input_attachments[i / 2].attachment;
|
||||
|
|
@ -1722,7 +1725,10 @@ tu_CmdBindDescriptorSets(VkCommandBuffer commandBuffer,
|
|||
struct tu_cs_memory dynamic_desc_set;
|
||||
VkResult result = tu_cs_alloc(&cmd->sub_cs, layout->dynamic_offset_count,
|
||||
A6XX_TEX_CONST_DWORDS, &dynamic_desc_set);
|
||||
assert(result == VK_SUCCESS);
|
||||
if (result != VK_SUCCESS) {
|
||||
cmd->record_result = result;
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(dynamic_desc_set.map, descriptors_state->dynamic_descriptors,
|
||||
layout->dynamic_offset_count * A6XX_TEX_CONST_DWORDS * 4);
|
||||
|
|
@ -1778,7 +1784,10 @@ void tu_CmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer,
|
|||
VkResult result = tu_cs_alloc(&cmd->sub_cs,
|
||||
DIV_ROUND_UP(layout->size, A6XX_TEX_CONST_DWORDS * 4),
|
||||
A6XX_TEX_CONST_DWORDS, &set_mem);
|
||||
assert(result == VK_SUCCESS);
|
||||
if (result != VK_SUCCESS) {
|
||||
cmd->record_result = result;
|
||||
return;
|
||||
}
|
||||
|
||||
/* preserve previous content if the layout is the same: */
|
||||
if (set->layout == layout)
|
||||
|
|
@ -1814,7 +1823,10 @@ void tu_CmdPushDescriptorSetWithTemplateKHR(
|
|||
VkResult result = tu_cs_alloc(&cmd->sub_cs,
|
||||
DIV_ROUND_UP(layout->size, A6XX_TEX_CONST_DWORDS * 4),
|
||||
A6XX_TEX_CONST_DWORDS, &set_mem);
|
||||
assert(result == VK_SUCCESS);
|
||||
if (result != VK_SUCCESS) {
|
||||
cmd->record_result = result;
|
||||
return;
|
||||
}
|
||||
|
||||
/* preserve previous content if the layout is the same: */
|
||||
if (set->layout == layout)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue