Introduce Gfxstream Features to decouple Gfxstream from AEMU
... which will allow building Gfxstream from a fixed version of AEMU for the purposes of packaging. Reviewed-by: Aaron Ruby <aruby@blackberry.com> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
@@ -62,12 +62,15 @@ public:
|
||||
Impl() : m_logCalls(android::base::getEnvironmentVariable("ANDROID_EMU_VK_LOG_CALLS") == "1"),
|
||||
m_vk(vkDispatch()),
|
||||
m_state(VkDecoderGlobalState::get()),
|
||||
m_vkStream(nullptr, m_state->getFeatures()),
|
||||
m_vkMemReadingStream(nullptr, m_state->getFeatures()),
|
||||
m_boxedHandleUnwrapMapping(m_state),
|
||||
m_boxedHandleCreateMapping(m_state),
|
||||
m_boxedHandleDestroyMapping(m_state),
|
||||
m_boxedHandleUnwrapAndDeleteMapping(m_state),
|
||||
m_boxedHandleUnwrapAndDeletePreserveBoxedMapping(m_state),
|
||||
m_prevSeqno(std::nullopt) {}
|
||||
m_prevSeqno(std::nullopt),
|
||||
m_queueSubmitWithCommandsEnabled(m_state->getFeatures().VulkanQueueSubmitWithCommands.enabled) {}
|
||||
%s* stream() { return &m_vkStream; }
|
||||
VulkanMemReadingStream* readStream() { return &m_vkMemReadingStream; }
|
||||
|
||||
@@ -83,8 +86,8 @@ private:
|
||||
bool m_forSnapshotLoad = false;
|
||||
VulkanDispatch* m_vk;
|
||||
VkDecoderGlobalState* m_state;
|
||||
%s m_vkStream { nullptr };
|
||||
VulkanMemReadingStream m_vkMemReadingStream { nullptr };
|
||||
%s m_vkStream;
|
||||
VulkanMemReadingStream m_vkMemReadingStream;
|
||||
BoxedHandleUnwrapMapping m_boxedHandleUnwrapMapping;
|
||||
BoxedHandleCreateMapping m_boxedHandleCreateMapping;
|
||||
BoxedHandleDestroyMapping m_boxedHandleDestroyMapping;
|
||||
@@ -92,6 +95,7 @@ private:
|
||||
android::base::BumpPool m_pool;
|
||||
BoxedHandleUnwrapAndDeletePreserveBoxedMapping m_boxedHandleUnwrapAndDeletePreserveBoxedMapping;
|
||||
std::optional<uint32_t> m_prevSeqno;
|
||||
bool m_queueSubmitWithCommandsEnabled = false;
|
||||
};
|
||||
|
||||
VkDecoder::VkDecoder() :
|
||||
@@ -441,7 +445,7 @@ def emit_pool_free(cgen):
|
||||
cgen.stmt("%s->clearPool()" % READ_STREAM)
|
||||
|
||||
def emit_seqno_incr(api, cgen):
|
||||
cgen.stmt("if (queueSubmitWithCommandsEnabled) seqnoPtr->fetch_add(1, std::memory_order_seq_cst)")
|
||||
cgen.stmt("if (m_queueSubmitWithCommandsEnabled) seqnoPtr->fetch_add(1, std::memory_order_seq_cst)")
|
||||
|
||||
def emit_snapshot(typeInfo, api, cgen):
|
||||
|
||||
@@ -802,7 +806,6 @@ size_t VkDecoder::Impl::decode(void* buf, size_t len, IOStream* ioStream,
|
||||
self.cgen.stmt("auto* healthMonitor = context.healthMonitor")
|
||||
self.cgen.stmt("auto& metricsLogger = *context.metricsLogger")
|
||||
self.cgen.stmt("if (len < 8) return 0")
|
||||
self.cgen.stmt("bool queueSubmitWithCommandsEnabled = feature_is_enabled(kFeature_VulkanQueueSubmitWithCommands)")
|
||||
self.cgen.stmt("unsigned char *ptr = (unsigned char *)buf")
|
||||
self.cgen.stmt("const unsigned char* const end = (const unsigned char*)buf + len")
|
||||
|
||||
@@ -850,7 +853,7 @@ size_t VkDecoder::Impl::decode(void* buf, size_t len, IOStream* ioStream,
|
||||
std::atomic<uint32_t>* seqnoPtr = processResources ?
|
||||
processResources->getSequenceNumberPtr() : nullptr;
|
||||
|
||||
if (queueSubmitWithCommandsEnabled && ((opcode >= OP_vkFirst && opcode < OP_vkLast) || (opcode >= OP_vkFirst_old && opcode < OP_vkLast_old))) {
|
||||
if (m_queueSubmitWithCommandsEnabled && ((opcode >= OP_vkFirst && opcode < OP_vkLast) || (opcode >= OP_vkFirst_old && opcode < OP_vkLast_old))) {
|
||||
uint32_t seqno;
|
||||
memcpy(&seqno, *readStreamPtrPtr, sizeof(uint32_t)); *readStreamPtrPtr += sizeof(uint32_t);
|
||||
if (healthMonitor) executionData->insert({{"seqno", std::to_string(seqno)}});
|
||||
|
||||
Reference in New Issue
Block a user