diff options
author | Iago Toral Quiroga <[email protected]> | 2017-03-22 10:15:59 +0100 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2017-03-24 09:39:44 +0100 |
commit | 129fd5813190909ad0ce7086e969b69c4807f21e (patch) | |
tree | c00699eb53cb1bb65483de4b7bd7c885f13a499a /src/intel | |
parent | ddb2bb3ed4c6ebff38be5acb0566894eec0c66ae (diff) |
anv/query: handle out of host memory without crashing in compute_query_result()
We don't need to make the caller (CmdCopyQueryPoolResults) aware of the
problem since compute_query_result() only emits state. The caller is also
expected to hit OOM in this scenario right after calling this function, but
it is already handling it safely.
Fixes:
dEQP-VK.api.out_of_host_memory.cmd_copy_query_pool_results
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/genX_query.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_query.c b/src/intel/vulkan/genX_query.c index b1ed4d3854a..3610665b6e8 100644 --- a/src/intel/vulkan/genX_query.c +++ b/src/intel/vulkan/genX_query.c @@ -627,6 +627,11 @@ compute_query_result(struct anv_batch *batch, uint32_t dst_reg, /* FIXME: We need to clamp the result for 32 bit. */ uint32_t *dw = anv_batch_emitn(batch, 5, GENX(MI_MATH)); + if (!dw) { + anv_batch_set_error(batch, VK_ERROR_OUT_OF_HOST_MEMORY); + return; + } + dw[1] = alu(OPCODE_LOAD, OPERAND_SRCA, OPERAND_R1); dw[2] = alu(OPCODE_LOAD, OPERAND_SRCB, OPERAND_R0); dw[3] = alu(OPCODE_SUB, 0, 0); |