mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
gfxstream: Update codegen for aemu -> gfxstream stream interface
Bug: b/403363880
Test: cd hardware/google/gfxstream
mma
Test: cd hardware/google/gfxstream
mkdir build && cd build
cmake .. -G Ninja
ninja
Test: meson setup \
-Ddefault_library=static \
-Dgfxstream-build=host \
build
meson compile -C build
Test: cd <emu master dev repo>
cd external/qemu
python android/build/python/cmake.py --gfxstream
Test: cd <emu main next repo>
prebuilts/bazel/linux-x86_64/bazel test \
--platforms=@//build/bazel/platforms:linux_x64 \
@gfxstream//...
Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35323>
This commit is contained in:
parent
3df2a0c061
commit
c0c10744fd
4 changed files with 16 additions and 12 deletions
|
|
@ -821,7 +821,7 @@ class CodeGen(object):
|
|||
if variant == "guest":
|
||||
streamNamespace = "gfxstream::aemu"
|
||||
else:
|
||||
streamNamespace = "android::base"
|
||||
streamNamespace = "gfxstream"
|
||||
|
||||
if direction == "read":
|
||||
self.stmt("memcpy((%s*)&%s, %s, %s)" %
|
||||
|
|
|
|||
|
|
@ -16,11 +16,15 @@ from dataclasses import dataclass
|
|||
|
||||
decoder_snapshot_decl_preamble = """
|
||||
|
||||
namespace gfxstream {
|
||||
class Stream;
|
||||
} // namespace gfxstream
|
||||
|
||||
namespace gfxstream {
|
||||
namespace base {
|
||||
class BumpPool;
|
||||
} // namespace base {
|
||||
} // namespace gfxstream {
|
||||
} // namespace base
|
||||
} // namespace gfxstream
|
||||
|
||||
namespace gfxstream {
|
||||
namespace vk {
|
||||
|
|
@ -32,8 +36,8 @@ class VkDecoderSnapshot {
|
|||
|
||||
void clear();
|
||||
|
||||
void saveReplayBuffers(android::base::Stream* stream);
|
||||
static void loadReplayBuffers(android::base::Stream* stream, std::vector<uint64_t>* outHandleBuffer, std::vector<uint8_t>* outDecoderBuffer);
|
||||
void saveReplayBuffers(gfxstream::Stream* stream);
|
||||
static void loadReplayBuffers(gfxstream::Stream* stream, std::vector<uint64_t>* outHandleBuffer, std::vector<uint8_t>* outDecoderBuffer);
|
||||
|
||||
VkSnapshotApiCallInfo* createApiCallInfo();
|
||||
void destroyApiCallInfoIfUnused(VkSnapshotApiCallInfo* info);
|
||||
|
|
@ -66,12 +70,12 @@ class VkDecoderSnapshot::Impl {
|
|||
mReconstruction.clear();
|
||||
}
|
||||
|
||||
void saveReplayBuffers(android::base::Stream* stream) {
|
||||
void saveReplayBuffers(gfxstream::Stream* stream) {
|
||||
std::lock_guard<std::mutex> lock(mReconstructionMutex);
|
||||
mReconstruction.saveReplayBuffers(stream);
|
||||
}
|
||||
|
||||
static void loadReplayBuffers(android::base::Stream* stream, std::vector<uint64_t>* outHandleBuffer, std::vector<uint8_t>* outDecoderBuffer) {
|
||||
static void loadReplayBuffers(gfxstream::Stream* stream, std::vector<uint64_t>* outHandleBuffer, std::vector<uint8_t>* outDecoderBuffer) {
|
||||
VkReconstruction::loadReplayBuffers(stream, outHandleBuffer, outDecoderBuffer);
|
||||
}
|
||||
|
||||
|
|
@ -99,12 +103,12 @@ void VkDecoderSnapshot::clear() {
|
|||
mImpl->clear();
|
||||
}
|
||||
|
||||
void VkDecoderSnapshot::saveReplayBuffers(android::base::Stream* stream) {
|
||||
void VkDecoderSnapshot::saveReplayBuffers(gfxstream::Stream* stream) {
|
||||
mImpl->saveReplayBuffers(stream);
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void VkDecoderSnapshot::loadReplayBuffers(android::base::Stream* stream, std::vector<uint64_t>* outHandleBuffer, std::vector<uint8_t>* outDecoderBuffer) {
|
||||
void VkDecoderSnapshot::loadReplayBuffers(gfxstream::Stream* stream, std::vector<uint64_t>* outHandleBuffer, std::vector<uint8_t>* outDecoderBuffer) {
|
||||
VkDecoderSnapshot::Impl::loadReplayBuffers(stream, outHandleBuffer, outDecoderBuffer);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class VulkanReservedMarshalingCodegen(VulkanTypeIterator):
|
|||
if self.variant == "guest":
|
||||
streamNamespace = "gfxstream::aemu"
|
||||
else:
|
||||
streamNamespace = "android::base"
|
||||
streamNamespace = "gfxstream"
|
||||
if self.direction == "write":
|
||||
self.cgen.stmt("%s::Stream::%s((uint8_t*)*%s)" % (streamNamespace, streamMethod, varname))
|
||||
else:
|
||||
|
|
@ -976,7 +976,7 @@ class VulkanReservedMarshaling(VulkanWrapperGenerator):
|
|||
if self.variant == "guest":
|
||||
streamNamespace = "gfxstream::aemu"
|
||||
else:
|
||||
streamNamespace = "android::base"
|
||||
streamNamespace = "gfxstream"
|
||||
|
||||
if direction == "write":
|
||||
cgen.stmt("memcpy(*%s, &%s, sizeof(uint32_t));" % (self.ptrVarName, sizeVar))
|
||||
|
|
|
|||
|
|
@ -394,7 +394,7 @@ class IOStream;
|
|||
#include "goldfish_vk_private_defs.h"
|
||||
|
||||
#include "%s.h"
|
||||
#include "aemu/base/files/StreamSerializing.h"
|
||||
#include "gfxstream/host/stream_utils.h"
|
||||
""" % VULKAN_STREAM_TYPE
|
||||
|
||||
poolInclude = f"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue