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

Unified Diff: src/gpu/GrProcessor.cpp

Issue 1870893002: Implement texel buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_texelfetch
Patch Set: Created 4 years, 8 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: src/gpu/GrProcessor.cpp
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index fdfbbb571358101462019474a83f9f738f4a05d7..0d3f8d916684d8c3766795ebd8e313d3020cd044 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -106,6 +106,11 @@ void GrProcessor::addTextureAccess(const GrTextureAccess* access) {
this->addGpuResource(access->getProgramTexture());
}
+void GrProcessor::addBufferAccess(const GrBufferAccess* access) {
Chris Dalton 2016/04/08 00:56:43 Is there a kosher way to get a hold of a caps obje
bsalomon 2016/04/11 16:51:38 Not really. I wouldn't bend over backwards for tha
+ fBufferAccesses.push_back(access);
+ this->addGpuResource(access->getProgramBuffer());
+}
+
void* GrProcessor::operator new(size_t size) {
return MemoryPoolAccessor().pool()->allocate(size);
}
@@ -114,8 +119,8 @@ void GrProcessor::operator delete(void* target) {
return MemoryPoolAccessor().pool()->release(target);
}
-bool GrProcessor::hasSameTextureAccesses(const GrProcessor& that) const {
- if (this->numTextures() != that.numTextures()) {
+bool GrProcessor::hasSameSamplers(const GrProcessor& that) const {
+ if (this->numTextures() != that.numTextures() || this->numBuffers() != that.numBuffers()) {
return false;
}
for (int i = 0; i < this->numTextures(); ++i) {
@@ -123,6 +128,11 @@ bool GrProcessor::hasSameTextureAccesses(const GrProcessor& that) const {
return false;
}
}
+ for (int i = 0; i < this->numBuffers(); ++i) {
+ if (this->bufferAccess(i) != that.bufferAccess(i)) {
+ return false;
+ }
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698