mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader/ir: Periodically flush buffers when tracing blocks.
Avoids overflowing the output buffer for the trace in cases where the output is too long, which raises an exception.
This commit is contained in:
parent
b0ca3627bf
commit
80b2a2eb55
Notes:
Henri Verbeet
2024-08-12 14:31:29 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/990
@ -3831,10 +3831,15 @@ static void vsir_cfg_compute_dominators(struct vsir_cfg *cfg)
|
|||||||
{
|
{
|
||||||
struct vsir_block *block2 = &cfg->blocks[j];
|
struct vsir_block *block2 = &cfg->blocks[j];
|
||||||
|
|
||||||
if (block2->label == 0)
|
if (block2->label == 0 || !vsir_block_dominates(block, block2))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (vsir_block_dominates(block, block2))
|
if (cfg->debug_buffer.content_size > 512)
|
||||||
|
{
|
||||||
|
TRACE("%s...\n", cfg->debug_buffer.buffer);
|
||||||
|
vkd3d_string_buffer_clear(&cfg->debug_buffer);
|
||||||
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, "Block %u dominates: ...", block->label);
|
||||||
|
}
|
||||||
vkd3d_string_buffer_printf(&cfg->debug_buffer, " %u", block2->label);
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, " %u", block2->label);
|
||||||
}
|
}
|
||||||
TRACE("%s\n", cfg->debug_buffer.buffer);
|
TRACE("%s\n", cfg->debug_buffer.buffer);
|
||||||
@ -3927,7 +3932,16 @@ static enum vkd3d_result vsir_cfg_compute_loops(struct vsir_cfg *cfg)
|
|||||||
vkd3d_string_buffer_printf(&cfg->debug_buffer, "Back edge %u -> %u with loop:", block->label, header->label);
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, "Back edge %u -> %u with loop:", block->label, header->label);
|
||||||
|
|
||||||
for (k = 0; k < loop->count; ++k)
|
for (k = 0; k < loop->count; ++k)
|
||||||
|
{
|
||||||
|
if (cfg->debug_buffer.content_size > 512)
|
||||||
|
{
|
||||||
|
TRACE("%s...\n", cfg->debug_buffer.buffer);
|
||||||
|
vkd3d_string_buffer_clear(&cfg->debug_buffer);
|
||||||
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, "Back edge %u -> %u with loop: ...",
|
||||||
|
block->label, header->label);
|
||||||
|
}
|
||||||
vkd3d_string_buffer_printf(&cfg->debug_buffer, " %u", loop->blocks[k]->label);
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, " %u", loop->blocks[k]->label);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("%s\n", cfg->debug_buffer.buffer);
|
TRACE("%s\n", cfg->debug_buffer.buffer);
|
||||||
vkd3d_string_buffer_clear(&cfg->debug_buffer);
|
vkd3d_string_buffer_clear(&cfg->debug_buffer);
|
||||||
@ -4150,7 +4164,15 @@ static enum vkd3d_result vsir_cfg_sort_nodes(struct vsir_cfg *cfg)
|
|||||||
vkd3d_string_buffer_printf(&cfg->debug_buffer, "Block order:");
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, "Block order:");
|
||||||
|
|
||||||
for (i = 0; i < cfg->order.count; ++i)
|
for (i = 0; i < cfg->order.count; ++i)
|
||||||
|
{
|
||||||
|
if (cfg->debug_buffer.content_size > 512)
|
||||||
|
{
|
||||||
|
TRACE("%s...\n", cfg->debug_buffer.buffer);
|
||||||
|
vkd3d_string_buffer_clear(&cfg->debug_buffer);
|
||||||
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, "Block order: ...");
|
||||||
|
}
|
||||||
vkd3d_string_buffer_printf(&cfg->debug_buffer, " %u", cfg->order.blocks[i]->label);
|
vkd3d_string_buffer_printf(&cfg->debug_buffer, " %u", cfg->order.blocks[i]->label);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE("%s\n", cfg->debug_buffer.buffer);
|
TRACE("%s\n", cfg->debug_buffer.buffer);
|
||||||
vkd3d_string_buffer_clear(&cfg->debug_buffer);
|
vkd3d_string_buffer_clear(&cfg->debug_buffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user