summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_query.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/vulkan/genX_query.c')
-rw-r--r--src/intel/vulkan/genX_query.c5
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);