vulkan: delay pipeline layout destroy until all referent pipelines gone
bug: https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=51867
Works around
bug: 155664177
Change-Id: I1955c01daff9115d4e6a10f4104f11679822eb73
diff --git a/registry/vulkan/xml/cereal/decoder.py b/registry/vulkan/xml/cereal/decoder.py
index 071e440..733d05d 100644
--- a/registry/vulkan/xml/cereal/decoder.py
+++ b/registry/vulkan/xml/cereal/decoder.py
@@ -251,9 +251,16 @@
def emit_global_state_wrapped_call(api, cgen):
customParams = ["&m_pool"] + list(map(lambda p: p.paramName, api.parameters))
+
+ if api.name in driver_workarounds_global_lock_apis:
+ cgen.stmt("m_state->lock()")
+
cgen.vkApiCall(api, customPrefix="m_state->on_", \
customParameters=customParams)
+ if api.name in driver_workarounds_global_lock_apis:
+ cgen.stmt("m_state->unlock()")
+
def emit_decode_parameters_writeback(typeInfo, api, cgen, autobox=True):
decodingParams = DecodingParameters(api)
@@ -536,6 +543,16 @@
# VK_GOOGLE_create_resources_with_requirements
"vkCreateImageWithRequirementsGOOGLE" : emit_global_state_wrapped_decoding,
"vkCreateBufferWithRequirementsGOOGLE" : emit_global_state_wrapped_decoding,
+
+ # Driver workarounds for drivers that don't let one
+ # use pipeline layouts past the life of a graphics pipeline
+ "vkCreatePipelineLayout" : emit_global_state_wrapped_decoding,
+ "vkDestroyPipelineLayout" : emit_global_state_wrapped_decoding,
+
+ "vkCreateGraphicsPipelines" : emit_global_state_wrapped_decoding,
+ "vkCreateComputePipelines" : emit_global_state_wrapped_decoding,
+ # TODO: vkCreateRayTracingPipelinesKHR
+ "vkDestroyPipeline" : emit_global_state_wrapped_decoding,
}
class VulkanDecoder(VulkanWrapperGenerator):