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

Side by Side Diff: include/gpu/GrTypesPriv.h

Issue 1784023002: Add sampler precision to GrTextureAccess (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_verttex
Patch Set: rebase Created 4 years, 9 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 | « include/gpu/GrTextureAccess.h ('k') | src/gpu/GrTextureAccess.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrTypesPriv_DEFINED 8 #ifndef GrTypesPriv_DEFINED
9 #define GrTypesPriv_DEFINED 9 #define GrTypesPriv_DEFINED
10 10
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 static inline bool GrSLTypeIsSamplerType(GrSLType type) { 198 static inline bool GrSLTypeIsSamplerType(GrSLType type) {
199 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount)); 199 SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
200 return type >= kSampler2D_GrSLType && type <= kSampler2DRect_GrSLType; 200 return type >= kSampler2D_GrSLType && type <= kSampler2DRect_GrSLType;
201 201
202 GR_STATIC_ASSERT(8 == kSampler2D_GrSLType); 202 GR_STATIC_ASSERT(8 == kSampler2D_GrSLType);
203 GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType); 203 GR_STATIC_ASSERT(9 == kSamplerExternal_GrSLType);
204 GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType); 204 GR_STATIC_ASSERT(10 == kSampler2DRect_GrSLType);
205 } 205 }
206 206
207 static inline bool GrSLTypeAcceptsPrecision(GrSLType type) {
208 return GrSLTypeIsNumeric(type) || GrSLTypeIsSamplerType(type);
209 }
210
207 ////////////////////////////////////////////////////////////////////////////// 211 //////////////////////////////////////////////////////////////////////////////
208 212
209 /** 213 /**
210 * Types used to describe format of vertices in arrays. 214 * Types used to describe format of vertices in arrays.
211 */ 215 */
212 enum GrVertexAttribType { 216 enum GrVertexAttribType {
213 kFloat_GrVertexAttribType = 0, 217 kFloat_GrVertexAttribType = 0,
214 kVec2f_GrVertexAttribType, 218 kVec2f_GrVertexAttribType,
215 kVec3f_GrVertexAttribType, 219 kVec3f_GrVertexAttribType,
216 kVec4f_GrVertexAttribType, 220 kVec4f_GrVertexAttribType,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // Takes a pointer to a GrCaps, and will suppress prints if required 415 // Takes a pointer to a GrCaps, and will suppress prints if required
412 #define GrCapsDebugf(caps, ...) \ 416 #define GrCapsDebugf(caps, ...) \
413 if (!caps->suppressPrints()) { \ 417 if (!caps->suppressPrints()) { \
414 SkDebugf(__VA_ARGS__); \ 418 SkDebugf(__VA_ARGS__); \
415 } 419 }
416 #else 420 #else
417 #define GrCapsDebugf(caps, ...) 421 #define GrCapsDebugf(caps, ...)
418 #endif 422 #endif
419 423
420 #endif 424 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTextureAccess.h ('k') | src/gpu/GrTextureAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698