aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-10-09 15:18:31 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-09 15:18:45 +0000
commit4e7cdd5a0052aa76bed6f80ec325be19e09e6ab1 (patch)
tree4fbe9b12470af000124c1d310dafe21a817c3758
parentc5eb97dd8875accf2b5db5343dace78d0d4c6f79 (diff)
Revert "Disable GL buffer mapping on TSAN/Mac."
This reverts commit c203e65265ccf0dcf426eafa4fae97b2b99cba7d. Reason for revert: <INSERT REASONING HERE> Original change's description: > Disable GL buffer mapping on TSAN/Mac. > > Also reverts 65e706379657d64371012c2e95ccf1354d741145 which disabled buffer mapping in GrResourceProvider::createPatternedIndexBuffer. > > Bug: skia:7058 > Change-Id: I6816abe53251e1cd8e92eae41b8cdbe45218a341 > Reviewed-on: https://skia-review.googlesource.com/50100 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=mtklein@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: Icf0cf40ba4d6e7081971eee2eea0a41033790df7 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7058 Reviewed-on: https://skia-review.googlesource.com/57220 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
-rw-r--r--infra/bots/recipes/test.py3
-rw-r--r--src/gpu/GrResourceProvider.cpp27
-rw-r--r--src/gpu/gl/GrGLCaps.cpp8
-rw-r--r--src/gpu/instanced/GLInstancedRendering.cpp3
-rwxr-xr-xtests/TransferPixelsTest.cpp4
5 files changed, 13 insertions, 32 deletions
diff --git a/infra/bots/recipes/test.py b/infra/bots/recipes/test.py
index dfe9833beb..0ee4ef23a2 100644
--- a/infra/bots/recipes/test.py
+++ b/infra/bots/recipes/test.py
@@ -195,8 +195,7 @@ def dm_flags(api, bot):
configs = [x.replace(old, new) for x in configs]
# We also test non-msaa instanced.
configs.append(new)
- elif 'MacMini7.1' in bot and 'TSAN' not in bot:
- # The TSAN bot disables GL buffer mapping which is required for inst.
+ elif 'MacMini7.1' in bot:
configs.extend([gl_prefix + 'inst'])
# CommandBuffer bot *only* runs the command_buffer config.
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index d68a5e6701..d50bb01f86 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -330,17 +330,13 @@ const GrBuffer* GrResourceProvider::createPatternedIndexBuffer(const uint16_t* p
size_t bufferSize = patternSize * reps * sizeof(uint16_t);
// This is typically used in GrMeshDrawOps, so we assume kNoPendingIO.
- sk_sp<GrBuffer> buffer(this->createBuffer(bufferSize, kIndex_GrBufferType,
- kStatic_GrAccessPattern, kNoPendingIO_Flag));
+ GrBuffer* buffer = this->createBuffer(bufferSize, kIndex_GrBufferType, kStatic_GrAccessPattern,
+ kNoPendingIO_Flag);
if (!buffer) {
return nullptr;
}
- uint16_t* data = (uint16_t*) buffer->map();
- SkAutoTArray<uint16_t> temp;
- if (!data) {
- temp.reset(reps * patternSize);
- data = temp.get();
- }
+
+ SkAutoTArray<uint16_t> data(reps * patternSize);
for (int i = 0; i < reps; ++i) {
int baseIdx = i * patternSize;
uint16_t baseVert = (uint16_t)(i * vertCount);
@@ -348,15 +344,14 @@ const GrBuffer* GrResourceProvider::createPatternedIndexBuffer(const uint16_t* p
data[baseIdx+j] = baseVert + pattern[j];
}
}
- if (temp.get()) {
- if (!buffer->updateData(data, bufferSize)) {
- return nullptr;
- }
- } else {
- buffer->unmap();
+
+ if (!buffer->updateData(data.get(), bufferSize)) {
+ buffer->unref();
+ return nullptr;
}
- this->assignUniqueKeyToResource(key, buffer.get());
- return buffer.release();
+
+ this->assignUniqueKeyToResource(key, buffer);
+ return buffer;
}
static constexpr int kMaxQuads = 1 << 12; // max possible: (1 << 14) - 1;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 94c5f2e184..af04dc7771 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -481,14 +481,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
}
}
-#if defined(__has_feature)
-#if defined(SK_BUILD_FOR_MAC) && __has_feature(thread_sanitizer)
- // See skbug.com/7058
- fMapBufferType = kNone_MapBufferType;
- fMapBufferFlags = kNone_MapFlags;
-#endif
-#endif
-
// We found that the Galaxy J5 with an Adreno 306 running 6.0.1 has a bug where
// GL_INVALID_OPERATION thrown by glDrawArrays when using a buffer that was mapped. The same bug
// did not reproduce on a Nexus7 2013 with a 320 running Android M with driver 127.0. It's
diff --git a/src/gpu/instanced/GLInstancedRendering.cpp b/src/gpu/instanced/GLInstancedRendering.cpp
index 9d43d05860..b2eb9ebb7a 100644
--- a/src/gpu/instanced/GLInstancedRendering.cpp
+++ b/src/gpu/instanced/GLInstancedRendering.cpp
@@ -37,8 +37,7 @@ GrCaps::InstancedSupport GLInstancedRendering::CheckSupport(const GrGLCaps& glCa
// This method is only intended to be used for initializing fInstancedSupport in the caps.
SkASSERT(GrCaps::InstancedSupport::kNone == glCaps.instancedSupport());
if (!glCaps.vertexArrayObjectSupport() ||
- (!glCaps.drawIndirectSupport() && !glCaps.drawInstancedSupport()) ||
- GrGLCaps::kNone_MapBufferType == glCaps.mapBufferType()) {
+ (!glCaps.drawIndirectSupport() && !glCaps.drawInstancedSupport())) {
return GrCaps::InstancedSupport::kNone;
}
return InstanceProcessor::CheckSupport(*glCaps.shaderCaps(), glCaps);
diff --git a/tests/TransferPixelsTest.cpp b/tests/TransferPixelsTest.cpp
index b59495f0f5..722707ae9b 100755
--- a/tests/TransferPixelsTest.cpp
+++ b/tests/TransferPixelsTest.cpp
@@ -64,10 +64,6 @@ bool does_full_buffer_contain_correct_values(GrColor* srcBuffer,
void basic_transfer_test(skiatest::Reporter* reporter, GrContext* context, GrPixelConfig config,
GrSurfaceOrigin origin, bool renderTarget) {
- if (GrCaps::kNone_MapFlags == context->caps()->mapBufferFlags()) {
- return;
- }
-
// set up the data
const int kTextureWidth = 16;
const int kTextureHeight = 16;