Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3775)

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index b4628a0b0735a2810c760d9044a84b2f0bb8768b..7ef54448b6182b75e13c2295d96cb7d5258334c3 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -17,6 +17,7 @@
#include <sstream>
#include <string>
#include "base/bind.h"
+#include "base/compiler_specific.h"
#include "base/numerics/safe_math.h"
#include "gpu/command_buffer/client/buffer_tracker.h"
#include "gpu/command_buffer/client/gpu_control.h"
@@ -1239,6 +1240,14 @@ void GLES2Implementation::BufferDataHelper(
if (!ValidateSize("glBufferData", size))
return;
+#if defined(MEMORY_SANITIZER) && !defined(OS_NACL)
+ // Do not upload uninitialized data. Even if it's not a bug, it can cause a
+ // bogus MSan report during a readback later. This is because MSan doesn't
+ // understand shared memory and would assume we were reading back the same
+ // unintialized data.
+ if (data) __msan_check_mem_is_initialized(data, size);
+#endif
+
GLuint buffer_id;
if (GetBoundPixelTransferBuffer(target, "glBufferData", &buffer_id)) {
if (!buffer_id) {
« no previous file with comments | « gpu/command_buffer/client/gles2_cmd_helper_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698