Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for rendering during replay to the surface #2112

Merged
merged 12 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cmd/gapir/cc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "gapir/cc/resource_in_memory_cache.h"
#include "gapir/cc/resource_requester.h"
#include "gapir/cc/server.h"
#include "gapir/cc/surface.h"

#include "core/cc/crash_handler.h"
#include "core/cc/debugger.h"
Expand Down Expand Up @@ -129,6 +130,17 @@ const char* pipeName() {
#endif
}

void android_process(struct android_app* app, int32_t cmd) {
switch (cmd) {
case APP_CMD_INIT_WINDOW: {
gapir::android_window = app->window;
__android_log_print(ANDROID_LOG_DEBUG, "GAPIR", "Received window: %p\n",
gapir::android_window);
break;
}
}
}

// Main function for android
void android_main(struct android_app* app) {
MemoryManager memoryManager(memorySizes);
Expand Down Expand Up @@ -156,6 +168,8 @@ void android_main(struct android_app* app) {
GAPID_ERROR("Chmod failed!");
}

app->onAppCmd = android_process;

bool alive = true;
while (alive) {
int ident;
Expand Down
8 changes: 5 additions & 3 deletions cmd/gapit/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ type (
DeviceFlags
}
ReportFlags struct {
Gapis GapisFlags
Gapir GapirFlags
Out string `help:"output report path"`
Gapis GapisFlags
Gapir GapirFlags
Out string `help:"output report path"`
DisplayToSurface bool `help:"display the frames rendered in the replay back to the surface"`
CommandFilterFlags
}
VideoFlags struct {
Expand Down Expand Up @@ -235,6 +236,7 @@ type (
Max struct {
Overdraw int `help:"the amount of overdraw to map to white in the output"`
}
DisplayToSurface bool `help:"display the frames rendered in the replay back to the surface"`
CommandFilterFlags
}
UnpackFlags struct {
Expand Down
3 changes: 2 additions & 1 deletion cmd/gapit/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ func (verb *reportVerb) Run(ctx context.Context, flags flag.FlagSet) error {
}
commands := boxedCommands.(*service.Commands).List

boxedReport, err := client.Get(ctx, capturePath.Report(device, filter).Path())
boxedReport, err := client.Get(ctx, capturePath.Report(device, filter,
verb.DisplayToSurface).Path())
if err != nil {
return log.Err(ctx, err, "Failed to acquire the capture's report")
}
Expand Down
1 change: 1 addition & 0 deletions cmd/gapit/screenshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func (verb *screenshotVerb) getSingleFrame(ctx context.Context, cmd *path.Comman
&service.ReplaySettings{
Device: device,
DisableReplayOptimization: verb.NoOpt,
DisplayToSurface: verb.DisplayToSurface,
},
cmd, attachment, settings, nil)
if err != nil {
Expand Down
18 changes: 18 additions & 0 deletions core/vulkan/vk_virtual_swapchain/cc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ cc_library(
],
)

cc_library(
name = "headers",
srcs = glob([
"*.h",
]),
copts = cc_copts() + select({
"//tools/build:linux": ["-DVK_USE_PLATFORM_XCB_KHR"],
"//tools/build:darwin": [],
"//tools/build:windows": ["-DVK_USE_PLATFORM_WIN32_KHR"],
# Android
"//conditions:default": ["-DVK_USE_PLATFORM_ANDROID_KHR"],
}),
visibility = ["//visibility:public"],
deps = [
"//core/vulkan/cc/include/vulkan",
],
)

cc_dynamic_library(
name = "libVkLayer_VirtualSwapchain",
visibility = ["//visibility:public"],
Expand Down
Loading