summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authordyen <dyen@chromium.org>2016-01-11 17:42:17 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-12 01:43:08 +0000
commitbcd5048b5d3efa23b6742e8482c29c6dec82171d (patch)
treeaac9698871000ccc9a012f6afd647de54b3afdce /gpu
parent55b3b326b591e5f176d4b7c753818f1328ff9b2b (diff)
downloadchromium_src-bcd5048b5d3efa23b6742e8482c29c6dec82171d.zip
chromium_src-bcd5048b5d3efa23b6742e8482c29c6dec82171d.tar.gz
chromium_src-bcd5048b5d3efa23b6742e8482c29c6dec82171d.tar.bz2
Fixed an issue with verifying resource sync tokens.
The address of resource sync tokens were being stored in an array before passing these addresses to VerifySyncTokensCHROMIUM(). There were 2 problems with this: 1. We were storing the resource adress on the stack and not pushed the one pushed into the TransferableResourceArray which is a std::vector. 2. Even if we stored the address of the item within the vector, the address could change as we push more items. This could either be solved by storing the address within the vector while simultaneously reserving the maximum amount of space used which guarantees the address will not move, or storing the indexes and getting the address after the vector is stable. I have opted for the second option here. I also fixed a small issue in VerifySyncTokensCHROMIUM() so that it now handles invalid sync tokens being passed to be verified. R=piman@chromium.org BUG=514815 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1577103002 Cr-Commit-Position: refs/heads/master@{#368765}
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 20ce878..1ae946d 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -5638,7 +5638,7 @@ void GLES2Implementation::VerifySyncTokensCHROMIUM(GLbyte **sync_tokens,
SyncToken sync_token;
memcpy(&sync_token, sync_tokens[i], sizeof(sync_token));
- if (!sync_token.verified_flush()) {
+ if (sync_token.HasData() && !sync_token.verified_flush()) {
if (!gpu_control_->CanWaitUnverifiedSyncToken(&sync_token)) {
SetGLError(GL_INVALID_VALUE, "glVerifySyncTokensCHROMIUM",
"Cannot verify sync token using this context.");
@@ -5661,11 +5661,13 @@ void GLES2Implementation::VerifySyncTokensCHROMIUM(GLbyte **sync_tokens,
// We can automatically mark everything as verified now.
for (GLsizei i = 0; i < count; ++i) {
- SyncToken sync_token;
- memcpy(&sync_token, sync_tokens[i], sizeof(sync_token));
- if (!sync_token.verified_flush()) {
- sync_token.SetVerifyFlush();
- memcpy(sync_tokens[i], &sync_token, sizeof(sync_token));
+ if (sync_tokens[i]) {
+ SyncToken sync_token;
+ memcpy(&sync_token, sync_tokens[i], sizeof(sync_token));
+ if (sync_token.HasData() && !sync_token.verified_flush()) {
+ sync_token.SetVerifyFlush();
+ memcpy(sync_tokens[i], &sync_token, sizeof(sync_token));
+ }
}
}
}