aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessor.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-11-15 14:28:33 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-15 20:06:12 +0000
commit559f556d9d70ef9d1202e436a56d48364b279ac6 (patch)
tree0371c13e6ed17e351066f1be46f4053e72c63365 /src/gpu/GrProcessor.h
parent33d17cbb003975fff895954435183756f9893c17 (diff)
Remove support for image load/store
This isn't used and has become a maintenance burden. Change-Id: I5f3af8f91e5c4f073fe4ea30e0a7f1f61efeea47 Reviewed-on: https://skia-review.googlesource.com/70640 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.h74
1 files changed, 1 insertions, 73 deletions
diff --git a/src/gpu/GrProcessor.h b/src/gpu/GrProcessor.h
index cd11ac4ac2..cafc713a62 100644
--- a/src/gpu/GrProcessor.h
+++ b/src/gpu/GrProcessor.h
@@ -227,7 +227,6 @@ class GrResourceIOProcessor : public GrProcessor {
public:
class TextureSampler;
class BufferAccess;
- class ImageStorageAccess;
int numTextureSamplers() const { return fTextureSamplers.count(); }
@@ -241,14 +240,6 @@ public:
numBuffers(). */
const BufferAccess& bufferAccess(int index) const { return *fBufferAccesses[index]; }
- int numImageStorages() const { return fImageStorageAccesses.count(); }
-
- /** Returns the access object for the image at index. index must be valid according to
- numImages(). */
- const ImageStorageAccess& imageStorageAccess(int index) const {
- return *fImageStorageAccesses[index];
- }
-
bool instantiate(GrResourceProvider* resourceProvider) const;
protected:
@@ -256,14 +247,13 @@ protected:
: INHERITED(classID) {}
/**
- * Subclasses call these from their constructor to register sampler/image sources. The processor
+ * 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.
*/
void addTextureSampler(const TextureSampler*);
void addBufferAccess(const BufferAccess*);
- void addImageStorageAccess(const ImageStorageAccess*);
bool hasSameSamplersAndAccesses(const GrResourceIOProcessor&) const;
@@ -275,7 +265,6 @@ protected:
private:
SkSTArray<4, const TextureSampler*, true> fTextureSamplers;
SkSTArray<1, const BufferAccess*, true> fBufferAccesses;
- SkSTArray<1, const ImageStorageAccess*, true> fImageStorageAccesses;
typedef GrProcessor INHERITED;
};
@@ -408,65 +397,4 @@ private:
typedef SkNoncopyable INHERITED;
};
-/**
- * This is used by a GrProcessor to access a texture using image load/store in its shader code.
- * ImageStorageAccesses don't perform any coord manipulation to account for texture origin.
- * Currently the format of the load/store data in the shader is inferred from the texture config,
- * though it could be made explicit.
- */
-class GrResourceIOProcessor::ImageStorageAccess {
-public:
- ImageStorageAccess(sk_sp<GrTextureProxy>, GrIOType, GrSLMemoryModel, GrSLRestrict,
- GrShaderFlags visibility = kFragment_GrShaderFlag);
- /**
- * This copy constructor is used by GrFragmentProcessor::clone() implementations. The copy
- * always takes a new ref on the surface proxy as the new fragment processor will not yet be
- * in pending execution state.
- */
- explicit ImageStorageAccess(const ImageStorageAccess& that)
- : fProxyRef(sk_ref_sp(that.fProxyRef.get()), that.fProxyRef.ioType())
- , fVisibility(that.fVisibility)
- , fFormat(that.fFormat)
- , fMemoryModel(that.fMemoryModel)
- , fRestrict(that.fRestrict) {}
-
- ImageStorageAccess& operator=(const ImageStorageAccess&) = delete;
-
- bool operator==(const ImageStorageAccess& that) const {
- return this->proxy() == that.proxy() && fVisibility == that.fVisibility;
- }
-
- bool operator!=(const ImageStorageAccess& that) const { return !(*this == that); }
-
- GrTextureProxy* proxy() const { return fProxyRef.get()->asTextureProxy(); }
- GrShaderFlags visibility() const { return fVisibility; }
- GrIOType ioType() const { return fProxyRef.ioType(); }
- GrImageStorageFormat format() const { return fFormat; }
- GrSLMemoryModel memoryModel() const { return fMemoryModel; }
- GrSLRestrict restrict() const { return fRestrict; }
-
- // 'instantiate' should only ever be called at flush time.
- bool instantiate(GrResourceProvider* resourceProvider) const {
- return SkToBool(fProxyRef.get()->instantiate(resourceProvider));
- }
- // 'peekTexture' should only ever be called after a successful 'instantiate' call
- GrTexture* peekTexture() const {
- SkASSERT(fProxyRef.get()->priv().peekTexture());
- return fProxyRef.get()->priv().peekTexture();
- }
-
- /**
- * For internal use by GrProcessor.
- */
- const GrSurfaceProxyRef* programProxy() const { return &fProxyRef; }
-
-private:
- GrSurfaceProxyRef fProxyRef;
- GrShaderFlags fVisibility;
- GrImageStorageFormat fFormat;
- GrSLMemoryModel fMemoryModel;
- GrSLRestrict fRestrict;
- typedef SkNoncopyable INHERITED;
-};
-
#endif