-
Notifications
You must be signed in to change notification settings - Fork 326
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
Added subcommands to resource view. #779
Conversation
gapis/api/cmd_extras.go
Outdated
@@ -60,6 +61,20 @@ func (e *CmdExtras) Add(es ...CmdExtra) { | |||
} | |||
} | |||
|
|||
// CloneFromOrPanic clones on or more CmdExtras to the list of CmdExtras, | |||
// if there was an error, a panic is raised | |||
func (e *CmdExtras) CloneFromOrPanic(es ...CmdExtra) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've used MustXXX()
for the no-error form of XXX()
methods elsewhere
@@ -312,7 +312,7 @@ func cutCommandBuffer(ctx context.Context, id api.CmdID, | |||
// idx[3] is the secondary command buffer index inside a vkCmdExecuteCommands | |||
// idx[4] is the secondary command inside the secondary command-buffer | |||
submitCopy := cb.VkQueueSubmit(a.Queue, a.SubmitCount, a.PSubmits, a.Fence, a.Result) | |||
submitCopy.Extras().Add(a.Extras().All()...) | |||
submitCopy.Extras().CloneFromOrPanic(a.Extras().All()...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just: submitCopy := deep.MustClone(a).(*VkQueueSubmit)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason is that we use Add(a.Extras().All()....) A lot elsewhere, when we are not cloning an atom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gapis/resolve/state.go
Outdated
s, err := capture.NewState(ctx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
for _, cmd := range cmds { | ||
log.W(ctx, "State: %+v", cmd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I missed that one.
LGTM |
91aafb0
to
887c422
Compare
@@ -60,6 +61,20 @@ func (e *CmdExtras) Add(es ...CmdExtra) { | |||
} | |||
} | |||
|
|||
// MustClone clones on or more CmdExtras to the list of CmdExtras, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one or more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to submit as-is, or by adding the deep.MustClone
method.
This allows us to get textures from subcommands.
887c422
to
0020561
Compare
Fix ETC converter initialisation Image Format conversion in AGI done by the converters that are registered in init time of Go Packages. There are details about this but simply init function in go packages runs before main when the packages are loaded. Recently #651 moved ETC conversion to its own packages similar to ASTC but different from ASTC, image creation remained in the parent package. As all the conversion functions called via register map that has registered during the init, this causes no function from the etc package, which ended up with it's not being loaded therefore no converter registered. This is a workaround that just create translator functions to reflect the image create functions in the parent package and uses those functions in Vulkan/resources to ensure the package is initialised. This is suboptimal and only a workaround. I am creating another PR with a refactor of the image formats. This is only a workaround until the other one can be merged.
This allows us to get textures from subcommands.