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

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

Issue 1148243002: Add RGBA half float texture format. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLDefines.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
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 if (kGL_GrGLStandard == standard) { 476 if (kGL_GrGLStandard == standard) {
477 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = true; 477 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = true;
478 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kYes_MSAA] = true; 478 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kYes_MSAA] = true;
479 } else { 479 } else {
480 if (ctxInfo.hasExtension("GL_EXT_color_buffer_float")) { 480 if (ctxInfo.hasExtension("GL_EXT_color_buffer_float")) {
481 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = true ; 481 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = true ;
482 } else { 482 } else {
483 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = fals e; 483 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kNo_MSAA] = fals e;
484 } 484 }
485 // for now we don't support floating point MSAA on ES 485 // for now we don't support floating point MSAA on ES
486 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; 486 fConfigRenderSupport[kRGBA_float_GrPixelConfig][kYes_MSAA] = false;
487 } 487 }
488 } 488 }
489 489
490 if (this->isConfigTexturable(kAlpha_half_GrPixelConfig)) { 490 if (this->isConfigTexturable(kAlpha_half_GrPixelConfig)) {
491 if (kGL_GrGLStandard == standard) { 491 if (kGL_GrGLStandard == standard) {
492 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true; 492 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true;
493 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = true; 493 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = true;
494 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) { 494 } else if (ctxInfo.version() >= GR_GL_VER(3,0)) {
495 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true; 495 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true;
496 // for now we don't support floating point MSAA on ES 496 // for now we don't support floating point MSAA on ES
497 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; 497 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false;
498 } else { 498 } else {
499 if (ctxInfo.hasExtension("GL_EXT_color_buffer_half_float") && fTextu reRedSupport) { 499 if (ctxInfo.hasExtension("GL_EXT_color_buffer_half_float") && fTextu reRedSupport) {
500 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true ; 500 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = true ;
501 } else { 501 } else {
502 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = fals e; 502 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kNo_MSAA] = fals e;
503 } 503 }
504 // for now we don't support floating point MSAA on ES 504 // for now we don't support floating point MSAA on ES
505 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false; 505 fConfigRenderSupport[kAlpha_half_GrPixelConfig][kYes_MSAA] = false;
506 } 506 }
507 } 507 }
508 508
509 if (this->isConfigTexturable(kRGBA_half_GrPixelConfig)) {
510 if (kGL_GrGLStandard == standard) {
511 fConfigRenderSupport[kRGBA_half_GrPixelConfig][kNo_MSAA] = true;
512 fConfigRenderSupport[kRGBA_half_GrPixelConfig][kYes_MSAA] = true;
513 } else if (ctxInfo.version() >= GR_GL_VER(3, 0)) {
514 fConfigRenderSupport[kRGBA_half_GrPixelConfig][kNo_MSAA] = true;
515 // for now we don't support floating point MSAA on ES
516 fConfigRenderSupport[kRGBA_half_GrPixelConfig][kYes_MSAA] = false;
517 } else {
518 if (ctxInfo.hasExtension("GL_EXT_color_buffer_half_float")) {
519 fConfigRenderSupport[kRGBA_half_GrPixelConfig][kNo_MSAA] = true;
520 } else {
521 fConfigRenderSupport[kRGBA_half_GrPixelConfig][kNo_MSAA] = false ;
522 }
523 // for now we don't support floating point MSAA on ES
524 fConfigRenderSupport[kRGBA_half_GrPixelConfig][kYes_MSAA] = false;
525 }
526 }
527
509 // If we don't support MSAA then undo any places above where we set a config as renderable with 528 // If we don't support MSAA then undo any places above where we set a config as renderable with
510 // msaa. 529 // msaa.
511 if (kNone_MSFBOType == fMSFBOType) { 530 if (kNone_MSFBOType == fMSFBOType) {
512 for (int i = 0; i < kGrPixelConfigCnt; ++i) { 531 for (int i = 0; i < kGrPixelConfigCnt; ++i) {
513 fConfigRenderSupport[i][kYes_MSAA] = false; 532 fConfigRenderSupport[i][kYes_MSAA] = false;
514 } 533 }
515 } 534 }
516 } 535 }
517 536
518 void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G rGLInterface* gli) { 537 void GrGLCaps::initConfigTexturableTable(const GrGLContextInfo& ctxInfo, const G rGLInterface* gli) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 // filtering modes are not supported. This is for simplicity, but a more 675 // filtering modes are not supported. This is for simplicity, but a more
657 // granular approach is possible. Coincidentally, 16-bit floating point tex tures became part of 676 // granular approach is possible. Coincidentally, 16-bit floating point tex tures became part of
658 // the standard in ES3.1 / OGL 3.1, hence the shorthand 677 // the standard in ES3.1 / OGL 3.1, hence the shorthand
659 bool hasHalfFPTextures = version >= GR_GL_VER(3, 1); 678 bool hasHalfFPTextures = version >= GR_GL_VER(3, 1);
660 if (!hasHalfFPTextures) { 679 if (!hasHalfFPTextures) {
661 hasHalfFPTextures = ctxInfo.hasExtension("GL_ARB_texture_float") || 680 hasHalfFPTextures = ctxInfo.hasExtension("GL_ARB_texture_float") ||
662 (ctxInfo.hasExtension("GL_OES_texture_half_float_lin ear") && 681 (ctxInfo.hasExtension("GL_OES_texture_half_float_lin ear") &&
663 ctxInfo.hasExtension("GL_OES_texture_half_float")); 682 ctxInfo.hasExtension("GL_OES_texture_half_float"));
664 } 683 }
665 fConfigTextureSupport[kAlpha_half_GrPixelConfig] = hasHalfFPTextures; 684 fConfigTextureSupport[kAlpha_half_GrPixelConfig] = hasHalfFPTextures;
685 fConfigTextureSupport[kRGBA_half_GrPixelConfig] = hasHalfFPTextures;
666 } 686 }
667 687
668 bool GrGLCaps::doReadPixelsSupported(const GrGLInterface* intf, 688 bool GrGLCaps::doReadPixelsSupported(const GrGLInterface* intf,
669 GrGLenum format, 689 GrGLenum format,
670 GrGLenum type) const { 690 GrGLenum type) const {
671 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) { 691 if (GR_GL_RGBA == format && GR_GL_UNSIGNED_BYTE == type) {
672 // ES 2 guarantees this format is supported 692 // ES 2 guarantees this format is supported
673 return true; 693 return true;
674 } 694 }
675 695
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 if (fGeometryShaderSupport) { 1172 if (fGeometryShaderSupport) {
1153 for (int p = 0; p < kGrSLPrecisionCount; ++p) { 1173 for (int p = 0; p < kGrSLPrecisionCount; ++p) {
1154 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p]; 1174 fFloatPrecisions[kGeometry_GrShaderType][p] = fFloatPrecisions[kVert ex_GrShaderType][p];
1155 } 1175 }
1156 } 1176 }
1157 } 1177 }
1158 1178
1159 1179
1160 1180
1161 1181
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698