-
Notifications
You must be signed in to change notification settings - Fork 327
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
Various GLES state reconstruction fixes #2260
Conversation
Removing the
Please advice on what do about this. |
gapis/api/gles/state_builder.go
Outdated
if reflect.DeepEqual(oldData, newData) { | ||
return // The pool IDs are different, but the actual data matches exactly. | ||
if l := len(d); l > 1 { | ||
last := d[l-2] |
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.
How come -2?
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 last element is the field in the struct that is different (usually the pool id), whereas the penultimate is the actual slice struct itself. I've added a comment.
|
||
func init() { | ||
// Don't compare RefIDs. | ||
compare.Register(func(c compare.Comparator, a, b RefID) { |
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 need to change now, but we should probably avoid creating these global comparison functions - I've found they hid differences that you might want to find under different circumstances. The compare package needs a little bit of work to expose this, but we should probably be passing the custom rules down with each compare.
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.
Agreed.
The programs need to reflect the link state, which may be different than the serialized state. This was done by creating temporary shaders, link the program, delete the temporaries and attach the ones from the state. This change simplifies this by: - creating the programs before the shaders - using the same shader ids for the temporaries as was serialized - attaching the shaders to the programs after creating the shaders This has the benefit of the rebuilt state matching the serialized state exactly (not just semantically) and no temporary shader IDs have to be allocated.
`make<bool>(arena)` should return `false` (the zero value), but returns `true` for any non-null arena, because the template expands to `bool(arena)`, instead of `bool()` as pointers can be coerced to bools. This adds the special no-arg case, forcing it to ignore the arena.
`eglMakeCurrent` resets the scissor and viewport box of the context, but only does so the very first time the context is made current. We currently were doing it every time the context is made current. This change moves the detection of whether the reset is needed from the extras into the API definition. It is impossible to detect in the spy whether the context was just made current for the very first time. Note that the replay's `bindRenderer` now no longer will ever be asked to reset the viewport because: 1. For non-MEC replays, we can just rely on the OS's context `makeCurrent` call to do it for us (all of them do). This now works, because the replay no longer creates dummy surfaces. 2. For MEC replays, the state reconstruction emits calls to set the viewport/scissor to the expected values.
Fixes to make the state comparison quieter: