Various GLES state reconstruction fixes#2260
Merged
pmuetschard merged 6 commits intogoogle:masterfrom Oct 2, 2018
Merged
Conversation
Member
Author
|
Removing the
Please advice on what do about this. |
ben-clayton
approved these changes
Oct 2, 2018
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] |
Member
Author
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this comment.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes to make the state comparison quieter: