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

Side by Side Diff: src/gpu/vk/GrVkGLSLSampler.h

Issue 1885863004: Refactor how we store and use samplers in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unneeded assert 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 unified diff | Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLXferProcessor.h ('k') | src/gpu/vk/GrVkPipelineStateBuilder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrVkGLSLSampler_DEFINED
9 #define GrVkGLSLSampler_DEFINED
10
11 #include "glsl/GrGLSLSampler.h"
12
13 #include "glsl/GrGLSLShaderVar.h"
14
15 class GrVkGLSLSampler : public GrGLSLSampler {
16 public:
17 GrVkGLSLSampler(uint32_t visibility,
18 GrPixelConfig config,
19 GrSLType type,
20 GrSLPrecision precision,
21 const char* name,
22 uint32_t binding,
23 uint32_t set) : INHERITED(visibility, config), fBinding(bind ing) {
24 SkASSERT(GrSLTypeIsSamplerType(type));
25 fShaderVar.setType(type);
26 fShaderVar.setTypeModifier(GrGLSLShaderVar::kUniform_TypeModifier);
27 fShaderVar.setPrecision(precision);
28 fShaderVar.accessName()->set(name);
29 SkString layoutQualifier;
30 layoutQualifier.appendf("set=%d, binding=%d", set, binding);
31 fShaderVar.setLayoutQualifier(layoutQualifier.c_str());
32 }
33
34 GrSLType type() const override { return fShaderVar.getType(); }
35 uint32_t binding() const { return fBinding; }
36
37 const char* onGetSamplerNameForTexture2D() const override { return fShaderVa r.c_str(); }
38 const char* getSamplerNameForTexelFetch() const override { return fShaderVar .c_str(); }
39
40 private:
41 GrGLSLShaderVar fShaderVar;
42 uint32_t fBinding;
43
44 friend class GrVkUniformHandler;
45
46 typedef GrGLSLSampler INHERITED;
47 };
48
49 #endif
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLXferProcessor.h ('k') | src/gpu/vk/GrVkPipelineStateBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698