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

Unified Diff: src/gpu/GrProcessor.cpp

Issue 1870893002: Implement texel buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_texelfetch
Patch Set: GrBuffer(Access) into include/gpu 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
« no previous file with comments | « src/gpu/GrFragmentProcessor.cpp ('k') | src/gpu/gl/GrGLBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
+ 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;
}
« no previous file with comments | « src/gpu/GrFragmentProcessor.cpp ('k') | src/gpu/gl/GrGLBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698