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 Stadia Support. #2732

Merged
merged 1 commit into from
May 22, 2019
Merged

Add Stadia Support. #2732

merged 1 commit into from
May 22, 2019

Conversation

AWoloszyn
Copy link
Contributor

No description provided.

@AWoloszyn AWoloszyn requested review from pmuetschard, ben-clayton and pau-baiget and removed request for ben-clayton April 29, 2019 13:27
cmd/gapis/main.go Outdated Show resolved Hide resolved
core/os/device/ggp/BUILD.bazel Outdated Show resolved Hide resolved
core/os/device/ggp/device.go Outdated Show resolved Hide resolved
core/os/device/ggp/device.go Show resolved Hide resolved
core/os/device/ggp/device.go Outdated Show resolved Hide resolved
core/os/device/ggp/device.go Outdated Show resolved Hide resolved
core/os/device/ggp/device.go Outdated Show resolved Hide resolved
gapis/trace/manager.go Outdated Show resolved Hide resolved
@AWoloszyn
Copy link
Contributor Author

@ben-clayton I have responded to all comments. Thanks!

Copy link
Contributor

@ben-clayton ben-clayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, mostly nits.

core/os/device/abi.go Outdated Show resolved Hide resolved
core/os/device/ggp/device.go Show resolved Hide resolved
core/os/device/ggp/device.go Show resolved Hide resolved
@AWoloszyn AWoloszyn force-pushed the stadia branch 2 times, most recently from 6bf30fc to 55ee76a Compare April 30, 2019 13:20
Copy link
Contributor

@hevrard hevrard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly typos and small comments, fix as you see fit.

cmd/gapis/main.go Outdated Show resolved Hide resolved
core/os/device/ggp/doc.go Outdated Show resolved Hide resolved
core/os/device/ggp/parse.go Outdated Show resolved Hide resolved
core/os/device/ggp/parse.go Outdated Show resolved Hide resolved
return ret, nil
}

// ParseListOutput parses the output from ggp xxx list command.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ggp xxx list -s gives the output as JSON, would it be better to use this and a proper JSON parser?

If we stick with plain text, maybe add a small example of the kind of text that is parsed? e.g.

blablabla
header1    header2    header3
=======    =======    =======
value1     value2     value3

Copy link
Contributor Author

@AWoloszyn AWoloszyn May 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the example, there is a good reason (for now) that we support this option. We can remove in the future. I can elaborate offline if you would like.

gapis/api/vulkan/ggp/vulkan_ggp.api Outdated Show resolved Hide resolved
gapis/api/vulkan/state_rebuilder.go Outdated Show resolved Hide resolved
gapis/trace/desktop/ggp_trace.go Outdated Show resolved Hide resolved
gapis/trace/desktop/ggp_trace.go Outdated Show resolved Hide resolved
// corresponding return value. One special case only used internally is:
// "package=/", which returns proj="/", pkg="", app="".
func parsePackageURI(ctx context.Context, uri string) (proj, pkg, app string, err error) {
re := regexp.MustCompile(`package=(\/$|[a-zA-Z0-9\_\-\s]+\/)?([a-z0-9\_\-\s]+)?(\:[a-zA-Z0-9\s\_\-]+$)?`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: not sure regexp is the most maintainable approach here, but I guess it does the job.
Another approach would be to tokenize the URI using ['/', '=', ':'] as delimiters and analyse the resulting split.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allowable tokens are fairly well-defined, so I think the regex is okay at the moment. If we run into issues, we can split it out more carefully.

@AWoloszyn
Copy link
Contributor Author

Updated from comments.

@AWoloszyn
Copy link
Contributor Author

@pmuetschard @hevrard Would either of you be able to review/approve this? I would like to avoid waiting too much longer, and having to rebase.

Copy link
Contributor

@ben-clayton ben-clayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a bunch of unaddressed comments from @hevrard

var lastErrorPrinted time.Time

for {
if err := func() error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole closure looks pointless.

Isn't it the same as:

		configs, err := getConfigs(ctx)
		if err != nil {
			return err
		}
		if err := scanDevices(ctx, configs); err != nil {
			if time.Since(lastErrorPrinted).Seconds() > printScanErrorsEveryNSeconds {
				log.E(ctx, "Couldn't scan devices: %v", err)
				lastErrorPrinted = time.Now()
			}
		} else {
			lastErrorPrinted = time.Time{}
		}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Done.

gapis/api/templates/vulkan_gfx_api_extras.tmpl Outdated Show resolved Hide resolved
@@ -393,6 +397,10 @@ bool Vulkan::replayCreateVkDeviceImpl(Stack* stack, size_val physicalDevice,
xcbInfo.window = info->window;
}
break;
case gapir::SurfaceType::Ggp:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is off, which is quite confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still off compared to L391.

@AWoloszyn
Copy link
Contributor Author

Thanks, I will update. They got themselves buried I guess.

Copy link
Contributor

@ben-clayton ben-clayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits to do with indenting still, but LGTM.
Clicking approve - let you decide whether I'm still +2 worthy. 😉

@@ -368,7 +369,10 @@ bool Vulkan::replayCreateVkDeviceImpl(Stack* stack, size_val physicalDevice,
case VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR:
target = gapir::SurfaceType::Xcb;
break;
case VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR:
case VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more weird indenting.

@@ -379,22 +383,27 @@ bool Vulkan::replayCreateVkDeviceImpl(Stack* stack, size_val physicalDevice,
switch (target) {
#if TARGET_OS == GAPID_OS_ANDROID
case gapir::SurfaceType::Android:
createInfo = &androidInfo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more weird indenting

@@ -393,6 +397,10 @@ bool Vulkan::replayCreateVkDeviceImpl(Stack* stack, size_val physicalDevice,
xcbInfo.window = info->window;
}
break;
case gapir::SurfaceType::Ggp:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still off compared to L391.

@AWoloszyn
Copy link
Contributor Author

Fixed formatting, will merge once builds go green.

Copy link
Contributor

@hevrard hevrard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to comment on the indentation but you had pushed in between!
lgtm

@AWoloszyn AWoloszyn merged commit 83f0e5d into google:master May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants