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

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 1110553003: Remove legacy NVPR support (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 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/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLPathProcessor.h » ('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 2012 Google Inc. 2 * Copyright 2012 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 8
9 #include "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 10
11 #include "GrGLContext.h" 11 #include "GrGLContext.h"
12 #include "SkTSearch.h" 12 #include "SkTSearch.h"
13 #include "SkTSort.h" 13 #include "SkTSort.h"
14 14
15 GrGLCaps::GrGLCaps() { 15 GrGLCaps::GrGLCaps() {
16 this->reset(); 16 this->reset();
17 } 17 }
18 18
19 void GrGLCaps::reset() { 19 void GrGLCaps::reset() {
20 INHERITED::reset(); 20 INHERITED::reset();
21 21
22 fVerifiedColorConfigs.reset(); 22 fVerifiedColorConfigs.reset();
23 fStencilFormats.reset(); 23 fStencilFormats.reset();
24 fStencilVerifiedColorConfigs.reset(); 24 fStencilVerifiedColorConfigs.reset();
25 fMSFBOType = kNone_MSFBOType; 25 fMSFBOType = kNone_MSFBOType;
26 fInvalidateFBType = kNone_InvalidateFBType; 26 fInvalidateFBType = kNone_InvalidateFBType;
27 fLATCAlias = kLATC_LATCAlias; 27 fLATCAlias = kLATC_LATCAlias;
28 fNvprSupport = kNone_NvprSupport;
29 fMapBufferType = kNone_MapBufferType; 28 fMapBufferType = kNone_MapBufferType;
30 fMaxFragmentUniformVectors = 0; 29 fMaxFragmentUniformVectors = 0;
31 fMaxVertexAttributes = 0; 30 fMaxVertexAttributes = 0;
32 fMaxFragmentTextureUnits = 0; 31 fMaxFragmentTextureUnits = 0;
33 fMaxFixedFunctionTextureCoords = 0;
34 fRGBA8RenderbufferSupport = false; 32 fRGBA8RenderbufferSupport = false;
35 fBGRAIsInternalFormat = false; 33 fBGRAIsInternalFormat = false;
36 fTextureSwizzleSupport = false; 34 fTextureSwizzleSupport = false;
37 fUnpackRowLengthSupport = false; 35 fUnpackRowLengthSupport = false;
38 fUnpackFlipYSupport = false; 36 fUnpackFlipYSupport = false;
39 fPackRowLengthSupport = false; 37 fPackRowLengthSupport = false;
40 fPackFlipYSupport = false; 38 fPackFlipYSupport = false;
41 fTextureUsageSupport = false; 39 fTextureUsageSupport = false;
42 fTexStorageSupport = false; 40 fTexStorageSupport = false;
43 fTextureRedSupport = false; 41 fTextureRedSupport = false;
(...skipping 18 matching lines...) Expand all
62 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() { 60 GrGLCaps::GrGLCaps(const GrGLCaps& caps) : GrDrawTargetCaps() {
63 *this = caps; 61 *this = caps;
64 } 62 }
65 63
66 GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) { 64 GrGLCaps& GrGLCaps::operator= (const GrGLCaps& caps) {
67 INHERITED::operator=(caps); 65 INHERITED::operator=(caps);
68 fVerifiedColorConfigs = caps.fVerifiedColorConfigs; 66 fVerifiedColorConfigs = caps.fVerifiedColorConfigs;
69 fStencilFormats = caps.fStencilFormats; 67 fStencilFormats = caps.fStencilFormats;
70 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs; 68 fStencilVerifiedColorConfigs = caps.fStencilVerifiedColorConfigs;
71 fLATCAlias = caps.fLATCAlias; 69 fLATCAlias = caps.fLATCAlias;
72 fNvprSupport = caps.fNvprSupport;
73 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors; 70 fMaxFragmentUniformVectors = caps.fMaxFragmentUniformVectors;
74 fMaxVertexAttributes = caps.fMaxVertexAttributes; 71 fMaxVertexAttributes = caps.fMaxVertexAttributes;
75 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits; 72 fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits;
76 fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords;
77 fMSFBOType = caps.fMSFBOType; 73 fMSFBOType = caps.fMSFBOType;
78 fInvalidateFBType = caps.fInvalidateFBType; 74 fInvalidateFBType = caps.fInvalidateFBType;
79 fMapBufferType = caps.fMapBufferType; 75 fMapBufferType = caps.fMapBufferType;
80 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport; 76 fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport;
81 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat; 77 fBGRAIsInternalFormat = caps.fBGRAIsInternalFormat;
82 fTextureSwizzleSupport = caps.fTextureSwizzleSupport; 78 fTextureSwizzleSupport = caps.fTextureSwizzleSupport;
83 fUnpackRowLengthSupport = caps.fUnpackRowLengthSupport; 79 fUnpackRowLengthSupport = caps.fUnpackRowLengthSupport;
84 fUnpackFlipYSupport = caps.fUnpackFlipYSupport; 80 fUnpackFlipYSupport = caps.fUnpackFlipYSupport;
85 fPackRowLengthSupport = caps.fPackRowLengthSupport; 81 fPackRowLengthSupport = caps.fPackRowLengthSupport;
86 fPackFlipYSupport = caps.fPackFlipYSupport; 82 fPackFlipYSupport = caps.fPackFlipYSupport;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } else { 121 } else {
126 SkASSERT(kGL_GrGLStandard == standard); 122 SkASSERT(kGL_GrGLStandard == standard);
127 GrGLint max; 123 GrGLint max;
128 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max); 124 GR_GL_GetIntegerv(gli, GR_GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max);
129 fMaxFragmentUniformVectors = max / 4; 125 fMaxFragmentUniformVectors = max / 4;
130 if (version >= GR_GL_VER(3, 2)) { 126 if (version >= GR_GL_VER(3, 2)) {
131 GrGLint profileMask; 127 GrGLint profileMask;
132 GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask); 128 GR_GL_GetIntegerv(gli, GR_GL_CONTEXT_PROFILE_MASK, &profileMask);
133 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_B IT); 129 fIsCoreProfile = SkToBool(profileMask & GR_GL_CONTEXT_CORE_PROFILE_B IT);
134 } 130 }
135 if (!fIsCoreProfile) {
136 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_COORDS, &fMaxFixedFunctionT extureCoords);
137 // Sanity check
138 SkASSERT(fMaxFixedFunctionTextureCoords > 0 && fMaxFixedFunctionText ureCoords < 128);
139 }
140 } 131 }
141 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes); 132 GR_GL_GetIntegerv(gli, GR_GL_MAX_VERTEX_ATTRIBS, &fMaxVertexAttributes);
142 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn its); 133 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_IMAGE_UNITS, &fMaxFragmentTextureUn its);
143 134
144 if (kGL_GrGLStandard == standard) { 135 if (kGL_GrGLStandard == standard) {
145 fRGBA8RenderbufferSupport = true; 136 fRGBA8RenderbufferSupport = true;
146 } else { 137 } else {
147 fRGBA8RenderbufferSupport = version >= GR_GL_VER(3,0) || 138 fRGBA8RenderbufferSupport = version >= GR_GL_VER(3,0) ||
148 ctxInfo.hasExtension("GL_OES_rgb8_rgba8") || 139 ctxInfo.hasExtension("GL_OES_rgb8_rgba8") ||
149 ctxInfo.hasExtension("GL_ARM_rgba8"); 140 ctxInfo.hasExtension("GL_ARM_rgba8");
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureSize); 341 GR_GL_GetIntegerv(gli, GR_GL_MAX_TEXTURE_SIZE, &fMaxTextureSize);
351 GR_GL_GetIntegerv(gli, GR_GL_MAX_RENDERBUFFER_SIZE, &fMaxRenderTargetSize); 342 GR_GL_GetIntegerv(gli, GR_GL_MAX_RENDERBUFFER_SIZE, &fMaxRenderTargetSize);
352 // Our render targets are always created with textures as the color 343 // Our render targets are always created with textures as the color
353 // attachment, hence this min: 344 // attachment, hence this min:
354 fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize); 345 fMaxRenderTargetSize = SkTMin(fMaxTextureSize, fMaxRenderTargetSize);
355 346
356 fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering"); 347 fPathRenderingSupport = ctxInfo.hasExtension("GL_NV_path_rendering");
357 348
358 if (fPathRenderingSupport) { 349 if (fPathRenderingSupport) {
359 if (kGL_GrGLStandard == standard) { 350 if (kGL_GrGLStandard == standard) {
360 // We need one of the two possible texturing methods: using fixed fu nction pipeline 351 // We only support v1.3+ of GL_NV_path_rendering which allows us to
361 // (PathTexGen, texcoords, ...) or using the newer NVPR API additio ns that support 352 // set individual fragment inputs with ProgramPathFragmentInputGen. The API
362 // setting individual fragment inputs with ProgramPathFragmentInputG en. The API 353 // additions are detected by checking the existence of the function.
363 // additions are detected by checking the existence of the function. Eventually we may
364 // choose to remove the fixed function codepath.
365 // Set fMaxFixedFunctionTextureCoords = 0 here if you want to force
366 // ProgramPathFragmentInputGen usage on desktop.
367 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac cess") && 354 fPathRenderingSupport = ctxInfo.hasExtension("GL_EXT_direct_state_ac cess") &&
368 (fMaxFixedFunctionTextureCoords > 0 || 355 ((ctxInfo.version() >= GR_GL_VER(4,3) ||
369 ((ctxInfo.version() >= GR_GL_VER(4,3) || 356 ctxInfo.hasExtension("GL_ARB_program_interface_query")) &&
370 ctxInfo.hasExtension("GL_ARB_program_interface_query")) && 357 gli->fFunctions.fProgramPathFragmentInputGen);
371 gli->fFunctions.fProgramPathFragmentInputGen));
372 if (fPathRenderingSupport) {
373 fNvprSupport = gli->fFunctions.fProgramPathFragmentInputGen ? kN ormal_NvprSupport :
374 kL egacy_NvprSupport;
375 }
376 } else { 358 } else {
377 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1); 359 fPathRenderingSupport = ctxInfo.version() >= GR_GL_VER(3,1);
378 fNvprSupport = fPathRenderingSupport ? kNormal_NvprSupport : kNone_N vprSupport;
379 } 360 }
380 } else {
381 fNvprSupport = kNone_NvprSupport;
382 } 361 }
383 362
384 fFBMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sampl es"); 363 fFBMixedSamplesSupport = ctxInfo.hasExtension("GL_NV_framebuffer_mixed_sampl es");
385 364
386 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker"); 365 fGpuTracingSupport = ctxInfo.hasExtension("GL_EXT_debug_marker");
387 366
388 // For now these two are equivalent but we could have dst read in shader via some other method 367 // For now these two are equivalent but we could have dst read in shader via some other method
389 fDstReadInShaderSupport = fFBFetchSupport; 368 fDstReadInShaderSupport = fFBFetchSupport;
390 369
391 // Disable scratch texture reuse on Mali and Adreno devices 370 // Disable scratch texture reuse on Mali and Adreno devices
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 GR_STATIC_ASSERT(3 == kChromium_MapBufferType); 1011 GR_STATIC_ASSERT(3 == kChromium_MapBufferType);
1033 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMapBufferTypeStr) == kLast_MapBufferType + 1); 1012 GR_STATIC_ASSERT(SK_ARRAY_COUNT(kMapBufferTypeStr) == kLast_MapBufferType + 1);
1034 1013
1035 r.appendf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO")); 1014 r.appendf("Core Profile: %s\n", (fIsCoreProfile ? "YES" : "NO"));
1036 r.appendf("MSAA Type: %s\n", kMSFBOExtStr[fMSFBOType]); 1015 r.appendf("MSAA Type: %s\n", kMSFBOExtStr[fMSFBOType]);
1037 r.appendf("FB Fetch Support: %s\n", (fFBFetchSupport ? "YES" : "NO")); 1016 r.appendf("FB Fetch Support: %s\n", (fFBFetchSupport ? "YES" : "NO"));
1038 r.appendf("Invalidate FB Type: %s\n", kInvalidateFBTypeStr[fInvalidateFBType ]); 1017 r.appendf("Invalidate FB Type: %s\n", kInvalidateFBTypeStr[fInvalidateFBType ]);
1039 r.appendf("Map Buffer Type: %s\n", kMapBufferTypeStr[fMapBufferType]); 1018 r.appendf("Map Buffer Type: %s\n", kMapBufferTypeStr[fMapBufferType]);
1040 r.appendf("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors); 1019 r.appendf("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors);
1041 r.appendf("Max FS Texture Units: %d\n", fMaxFragmentTextureUnits); 1020 r.appendf("Max FS Texture Units: %d\n", fMaxFragmentTextureUnits);
1042 if (!fIsCoreProfile) {
1043 r.appendf("Max Fixed Function Texture Coords: %d\n", fMaxFixedFunctionTe xtureCoords);
1044 }
1045 r.appendf("Max Vertex Attributes: %d\n", fMaxVertexAttributes); 1021 r.appendf("Max Vertex Attributes: %d\n", fMaxVertexAttributes);
1046 r.appendf("Support RGBA8 Render Buffer: %s\n", (fRGBA8RenderbufferSupport ? "YES": "NO")); 1022 r.appendf("Support RGBA8 Render Buffer: %s\n", (fRGBA8RenderbufferSupport ? "YES": "NO"));
1047 r.appendf("BGRA is an internal format: %s\n", (fBGRAIsInternalFormat ? "YES" : "NO")); 1023 r.appendf("BGRA is an internal format: %s\n", (fBGRAIsInternalFormat ? "YES" : "NO"));
1048 r.appendf("Support texture swizzle: %s\n", (fTextureSwizzleSupport ? "YES": "NO")); 1024 r.appendf("Support texture swizzle: %s\n", (fTextureSwizzleSupport ? "YES": "NO"));
1049 r.appendf("Unpack Row length support: %s\n", (fUnpackRowLengthSupport ? "YES ": "NO")); 1025 r.appendf("Unpack Row length support: %s\n", (fUnpackRowLengthSupport ? "YES ": "NO"));
1050 r.appendf("Unpack Flip Y support: %s\n", (fUnpackFlipYSupport ? "YES": "NO") ); 1026 r.appendf("Unpack Flip Y support: %s\n", (fUnpackFlipYSupport ? "YES": "NO") );
1051 r.appendf("Pack Row length support: %s\n", (fPackRowLengthSupport ? "YES": " NO")); 1027 r.appendf("Pack Row length support: %s\n", (fPackRowLengthSupport ? "YES": " NO"));
1052 r.appendf("Pack Flip Y support: %s\n", (fPackFlipYSupport ? "YES": "NO")); 1028 r.appendf("Pack Flip Y support: %s\n", (fPackFlipYSupport ? "YES": "NO"));
1053 1029
1054 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO" )); 1030 r.appendf("Texture Usage support: %s\n", (fTextureUsageSupport ? "YES": "NO" ));
1055 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO" )); 1031 r.appendf("Texture Storage support: %s\n", (fTexStorageSupport ? "YES": "NO" ));
1056 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO")); 1032 r.appendf("GL_R support: %s\n", (fTextureRedSupport ? "YES": "NO"));
1057 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO")); 1033 r.appendf("GL_ARB_imaging support: %s\n", (fImagingSupport ? "YES": "NO"));
1058 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 1034 r.appendf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
1059 r.appendf("Fragment coord conventions support: %s\n", 1035 r.appendf("Fragment coord conventions support: %s\n",
1060 (fFragCoordsConventionSupport ? "YES": "NO")); 1036 (fFragCoordsConventionSupport ? "YES": "NO"));
1061 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO")); 1037 r.appendf("Vertex array object support: %s\n", (fVertexArrayObjectSupport ? "YES": "NO"));
1062 r.appendf("Use non-VBO for dynamic data: %s\n", 1038 r.appendf("Use non-VBO for dynamic data: %s\n",
1063 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); 1039 (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO"));
1064 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO ")); 1040 r.appendf("Full screen clear is free: %s\n", (fFullClearIsFree ? "YES" : "NO "));
1065 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO")); 1041 r.appendf("Drops tile on zero divide: %s\n", (fDropsTileOnZeroDivide ? "YES" : "NO"));
1066 return r; 1042 return r;
1067 } 1043 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLPathProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698