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

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

Issue 705183002: Mesa ES 3.0 requires sized internal formats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 #include "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 GrGLenum externalType = 0x0;// suprress warning 561 GrGLenum externalType = 0x0;// suprress warning
562 562
563 // glTexStorage requires sized internal formats on both desktop and ES. ES2 requires an unsized 563 // glTexStorage requires sized internal formats on both desktop and ES. ES2 requires an unsized
564 // format for glTexImage, unlike ES3 and desktop. However, we allow the driv er to decide the 564 // format for glTexImage, unlike ES3 and desktop. However, we allow the driv er to decide the
565 // size of the internal format whenever possible and so only use a sized int ernal format when 565 // size of the internal format whenever possible and so only use a sized int ernal format when
566 // using texture storage. 566 // using texture storage.
567 bool useSizedFormat = useTexStorage; 567 bool useSizedFormat = useTexStorage;
568 // At least some versions of the ES3 drivers for NVIDIA and IMG won't accept GL_RED in 568 // At least some versions of the ES3 drivers for NVIDIA and IMG won't accept GL_RED in
569 // glTexImage2D for the internal format but will accept GL_R8. 569 // glTexImage2D for the internal format but will accept GL_R8.
570 if (kNVIDIA_GrGLVendor == this->glContext().vendor() || 570 if (kNVIDIA_GrGLVendor == this->glContext().vendor() ||
571 kImagination_GrGLVendor == this->glContext().vendor()) { 571 kImagination_GrGLVendor == this->glContext().vendor() ||
572 this->glContext().isMesa()) {
572 if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_ GL_VER(3, 0) && 573 if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_ GL_VER(3, 0) &&
573 kAlpha_8_GrPixelConfig == dataConfig) { 574 kAlpha_8_GrPixelConfig == dataConfig) {
574 useSizedFormat = true; 575 useSizedFormat = true;
575 } 576 }
576 } 577 }
577 if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat, 578 if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat,
578 &externalFormat, &externalType)) { 579 &externalFormat, &externalType)) {
579 return false; 580 return false;
580 } 581 }
581 582
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after
2556 this->setVertexArrayID(gpu, 0); 2557 this->setVertexArrayID(gpu, 0);
2557 } 2558 }
2558 int attrCount = gpu->glCaps().maxVertexAttributes(); 2559 int attrCount = gpu->glCaps().maxVertexAttributes();
2559 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2560 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2560 fDefaultVertexArrayAttribState.resize(attrCount); 2561 fDefaultVertexArrayAttribState.resize(attrCount);
2561 } 2562 }
2562 attribState = &fDefaultVertexArrayAttribState; 2563 attribState = &fDefaultVertexArrayAttribState;
2563 } 2564 }
2564 return attribState; 2565 return attribState;
2565 } 2566 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698