mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-10 05:08:31 +09:00
[Feat] (DirectVulkan, MG_Impl): occlusion queries via Vulkan query pools
GL_SAMPLES_PASSED / GL_ANY_SAMPLES_PASSED(_CONSERVATIVE) now work: every app draw between Begin/EndQuery is wrapped in a slot of a host-reset occlusion query pool (precise counts when occlusionQueryPrecise is granted), and the result flush ends any active render pass before submitting, waits, sums the slots and recycles them. ANY_* targets report the boolean form; GL_QUERY_COUNTER_BITS and GL_CURRENT_QUERY answer for the occlusion targets, and deleting an active query releases its slot. Draw-time depth/stencil state also honors attachment absence: a framebuffer without a depth (stencil) attachment behaves as if that test always passes, even when a packed depth-stencil image is attached through only one half (verify_partial_attachments.*).
This commit is contained in:
@@ -220,6 +220,11 @@ namespace MobileGL {
|
||||
// and leave the query readable later.
|
||||
Bool (*GetQueryResult64)(BackendQueryHandle query, Bool wait, Uint64* outNanoseconds);
|
||||
void (*DeleteBackendQuery)(BackendQueryHandle query);
|
||||
// GL_SAMPLES_PASSED occlusion queries (optional; null = unsupported,
|
||||
// the frontend then rejects the target). Results/deletion flow through
|
||||
// GetQueryResult64 / DeleteBackendQuery like timer queries.
|
||||
BackendQueryHandle (*BeginOcclusionQuery)();
|
||||
void (*EndOcclusionQuery)(BackendQueryHandle query);
|
||||
Int64 (*GetGpuTimestampNs)(); // glGetInteger64v(GL_TIMESTAMP); 0 if unsupported
|
||||
};
|
||||
struct GlobalBackendFunctionsTable {
|
||||
|
||||
Reference in New Issue
Block a user