};
}
+static void
+emit_query_mi_flush_availability(struct anv_cmd_buffer *cmd_buffer,
+ struct anv_address addr,
+ bool available)
+{
+ anv_batch_emit(&cmd_buffer->batch, GENX(MI_FLUSH_DW), flush) {
+ flush.PostSyncOperation = WriteImmediateData;
+ flush.Address = addr;
+ flush.ImmediateData = available;
+ }
+}
+
VkResult genX(CreateQueryPool)(
VkDevice _device,
const VkQueryPoolCreateInfo* pCreateInfo,
break;
#endif
+ case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR:
+ uint64s_per_slot = 1;
+ break;
default:
assert(!"Invalid query type");
}
pool->type == VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT ||
pool->type == VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR ||
pool->type == VK_QUERY_TYPE_PERFORMANCE_QUERY_INTEL ||
- pool->type == VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT);
+ pool->type == VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT ||
+ pool->type == VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR);
if (vk_device_is_lost(&device->vk))
return VK_ERROR_DEVICE_LOST;
break;
}
+ case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR:
+ if (!write_results)
+ break;
+ const uint32_t *query_data = query_slot(pool, firstQuery + i);
+ uint32_t result = available ? *query_data : 0;
+ cpu_write_query_result(pData, flags, idx, result);
+ break;
+
default:
unreachable("invalid pool type");
}
emit_query_mi_availability(&b, anv_query_address(pool, firstQuery + i), false);
break;
}
-
+ case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR:
+ for (uint32_t i = 0; i < queryCount; i++)
+ emit_query_mi_flush_availability(cmd_buffer, anv_query_address(pool, firstQuery + i), false);
+ break;
default:
unreachable("Unsupported query type");
}
emit_perf_intel_query(cmd_buffer, pool, &b, query_addr, false);
break;
}
-
+ case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR:
+ emit_query_mi_flush_availability(cmd_buffer, query_addr, false);
+ break;
default:
unreachable("");
}
emit_query_mi_availability(&b, query_addr, true);
break;
}
+ case VK_QUERY_TYPE_RESULT_STATUS_ONLY_KHR:
+ emit_query_mi_flush_availability(cmd_buffer, query_addr, true);
+ break;
default:
unreachable("");