diff options
author | 2016-04-19 15:24:29 -0700 | |
---|---|---|
committer | 2016-04-19 15:24:29 -0700 | |
commit | b800248c73c75b02ab808c5bdb53e19e6abc3adc (patch) | |
tree | 7f81a22be8bb794768bb6e65972c31e846a05365 /src/gpu/vk/GrVkGLSLSampler.h | |
parent | 45b61a1c4c0be896e7b12fd1405abfece799114f (diff) |
Revert of Refactor how we store and use samplers in Ganesh (patchset #7 id:120001 of https://codereview.chromium.org/1885863004/ )
Reason for revert:
breaking bots
Original issue's description:
> Refactor how we store and use samplers in Ganesh
>
> The main goal of this refactorization is to allow Vulkan to use separate
> sampler and texture objects in the shader and descriptor sets and combine
> them into a sampler2d in the shader where needed.
>
> A large part of this is separating how we store samplers and uniforms in the
> UniformHandler. We no longer need to store handles to samplers besides when
> we are initially emitting code. After we emit code all we ever do is loop over
> all samplers and do some processor independent work on them, so we have no need
> for direct access to individual samplers.
>
> In the GLProgram all we ever do is set the sampler uniforms in the ctor and never
> touch them again, so no need to save sampler info there. The texture access on
> program reuse just assume that they come in the same order as we set the texture
> units for the samplers
>
> For Vulkan, it is a similar story. We create the descriptor set layouts with the samplers,
> then when we get new textures, we just assume they come in in the same order as we
> set the samplers on the descriptor sets. Thus no need to save direct vulkan info.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1885863004
>
> Committed: https://skia.googlesource.com/skia/+/45b61a1c4c0be896e7b12fd1405abfece799114f
TBR=bsalomon@google.com,jvanverth@google.com,cdalton@nvidia.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1896013003
Diffstat (limited to 'src/gpu/vk/GrVkGLSLSampler.h')
-rw-r--r-- | src/gpu/vk/GrVkGLSLSampler.h | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/gpu/vk/GrVkGLSLSampler.h b/src/gpu/vk/GrVkGLSLSampler.h deleted file mode 100644 index 4bfacaed48..0000000000 --- a/src/gpu/vk/GrVkGLSLSampler.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -* Copyright 2016 Google Inc. -* -* Use of this source code is governed by a BSD-style license that can be -* found in the LICENSE file. -*/ - -#ifndef GrVkGLSLSampler_DEFINED -#define GrVkGLSLSampler_DEFINED - -#include "glsl/GrGLSLSampler.h" - -#include "glsl/GrGLSLShaderVar.h" - -class GrVkGLSLSampler : public GrGLSLSampler { -public: - GrVkGLSLSampler(uint32_t visibility, - GrPixelConfig config, - GrSLType type, - GrSLPrecision precision, - const char* name, - uint32_t binding, - uint32_t set) : INHERITED(visibility, config), fBinding(binding) { - SkASSERT(GrSLTypeIsSamplerType(type)); - fShaderVar.setType(type); - fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier); - fShaderVar.setPrecision(precision); - fShaderVar.accessName()->set(name); - SkString layoutQualifier; - layoutQualifier.appendf("set=%d, binding=%d", set, binding); - fShaderVar.setLayoutQualifier(layoutQualifier.c_str()); - } - - GrSLType type() const override { return fShaderVar.getType(); } - uint32_t binding() const { return fBinding; } - - const char* onGetSamplerNameForTexture2D() const override { return fShaderVar.c_str(); } - const char* getSamplerNameForTexelFetch() const override { return fShaderVar.c_str(); } - -private: - GrGLSLShaderVar fShaderVar; - uint32_t fBinding; - - friend class GrVkUniformHandler; - - typedef GrGLSLSampler INHERITED; -}; - -#endif |