aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessor.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-07-12 14:53:49 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-13 00:45:54 +0000
commit662ea4baba570d2f21a7b33d268204e9bdfa7fb9 (patch)
tree71da861d0d9b8f014e7f09f89b122480e067e8c0 /src/gpu/GrProcessor.h
parent13ac194dbf9968d356e580b85420f1314f453a10 (diff)
Remove texel buffer support.
Change-Id: Ia6f21afe714208979a5bc384e436b28ea2b9a297 Reviewed-on: https://skia-review.googlesource.com/141051 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrProcessor.h')
-rw-r--r--src/gpu/GrProcessor.h72
1 files changed, 3 insertions, 69 deletions
diff --git a/src/gpu/GrProcessor.h b/src/gpu/GrProcessor.h
index f8b336d9fb..696ed0a96d 100644
--- a/src/gpu/GrProcessor.h
+++ b/src/gpu/GrProcessor.h
@@ -197,7 +197,6 @@ private:
class GrResourceIOProcessor : public GrProcessor {
public:
class TextureSampler;
- class BufferAccess;
int numTextureSamplers() const { return fTextureSamplers.count(); }
@@ -205,12 +204,6 @@ public:
numTextureSamplers(). */
const TextureSampler& textureSampler(int index) const { return *fTextureSamplers[index]; }
- int numBuffers() const { return fBufferAccesses.count(); }
-
- /** Returns the access pattern for the buffer at index. index must be valid according to
- numBuffers(). */
- const BufferAccess& bufferAccess(int index) const { return *fBufferAccesses[index]; }
-
bool instantiate(GrResourceProvider* resourceProvider) const;
protected:
@@ -219,13 +212,12 @@ protected:
/**
* Subclasses call these from their constructor to register sampler sources. The processor
* subclass manages the lifetime of the objects (these functions only store pointers). The
- * TextureSampler and/or BufferAccess instances are typically member fields of the GrProcessor
- * subclass. These must only be called from the constructor because GrProcessors are immutable.
+ * TextureSampler instances are typically member fields of the GrProcessor subclass. These must
+ * only be called from the constructor because GrProcessors are immutable.
*/
void addTextureSampler(const TextureSampler*);
- void addBufferAccess(const BufferAccess*);
- bool hasSameSamplersAndAccesses(const GrResourceIOProcessor&) const;
+ bool hasSameSamplers(const GrResourceIOProcessor&) const;
// These methods can be used by derived classes that also derive from GrProgramElement.
void addPendingIOs() const;
@@ -234,7 +226,6 @@ protected:
private:
SkSTArray<4, const TextureSampler*, true> fTextureSamplers;
- SkSTArray<1, const BufferAccess*, true> fBufferAccesses;
typedef GrProcessor INHERITED;
};
@@ -310,61 +301,4 @@ private:
GrShaderFlags fVisibility;
};
-/**
- * Used to represent a texel buffer that will be read in a GrResourceIOProcessor. It holds a
- * GrBuffer along with an associated offset and texel config.
- */
-class GrResourceIOProcessor::BufferAccess {
-public:
- BufferAccess() = default;
- BufferAccess(GrPixelConfig texelConfig, GrBuffer* buffer,
- GrShaderFlags visibility = kFragment_GrShaderFlag) {
- this->reset(texelConfig, buffer, visibility);
- }
- /**
- * This copy constructor is used by GrFragmentProcessor::clone() implementations. The copy
- * always takes a new ref on the buffer proxy as the new fragment processor will not yet be
- * in pending execution state.
- */
- explicit BufferAccess(const BufferAccess& that) {
- this->reset(that.fTexelConfig, that.fBuffer.get(), that.fVisibility);
- }
-
- BufferAccess& operator=(const BufferAccess&) = delete;
-
- /**
- * Must be initialized before adding to a GrProcessor's buffer access list.
- */
- void reset(GrPixelConfig texelConfig, GrBuffer* buffer,
- GrShaderFlags visibility = kFragment_GrShaderFlag) {
- fTexelConfig = texelConfig;
- fBuffer.set(SkRef(buffer), kRead_GrIOType);
- fVisibility = visibility;
- }
-
- bool operator==(const BufferAccess& that) const {
- return fTexelConfig == that.fTexelConfig &&
- this->buffer() == that.buffer() &&
- fVisibility == that.fVisibility;
- }
-
- bool operator!=(const BufferAccess& that) const { return !(*this == that); }
-
- GrPixelConfig texelConfig() const { return fTexelConfig; }
- GrBuffer* buffer() const { return fBuffer.get(); }
- GrShaderFlags visibility() const { return fVisibility; }
-
- /**
- * For internal use by GrProcessor.
- */
- const GrGpuResourceRef* programBuffer() const { return &fBuffer;}
-
-private:
- GrPixelConfig fTexelConfig;
- GrTGpuResourceRef<GrBuffer> fBuffer;
- GrShaderFlags fVisibility;
-
- typedef SkNoncopyable INHERITED;
-};
-
#endif