Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/opengl/kis_opengl_image_textures.cpp
Show First 20 Lines • Show All 447 Lines • ▼ Show 20 Line(s) | 440 | { | |||
---|---|---|---|---|---|
448 | KoID colorModelId = m_image->colorSpace()->colorModelId(); | 448 | KoID colorModelId = m_image->colorSpace()->colorModelId(); | ||
449 | KoID colorDepthId = m_image->colorSpace()->colorDepthId(); | 449 | KoID colorDepthId = m_image->colorSpace()->colorDepthId(); | ||
450 | 450 | | |||
451 | KoID destinationColorModelId = RGBAColorModelID; | 451 | KoID destinationColorModelId = RGBAColorModelID; | ||
452 | KoID destinationColorDepthId = Integer8BitsColorDepthID; | 452 | KoID destinationColorDepthId = Integer8BitsColorDepthID; | ||
453 | 453 | | |||
454 | dbgUI << "Choosing texture format:"; | 454 | dbgUI << "Choosing texture format:"; | ||
455 | 455 | | |||
456 | // QT5TODO: T360 | | |||
457 | if (colorModelId == RGBAColorModelID) { | 456 | if (colorModelId == RGBAColorModelID) { | ||
458 | if (colorDepthId == Float16BitsColorDepthID) { | 457 | if (colorDepthId == Float16BitsColorDepthID) { | ||
459 | 458 | | |||
460 | if (ctx->hasExtension("GL_ARB_texture_float")) { | 459 | if (ctx->hasExtension("GL_ARB_texture_float")) { | ||
461 | m_texturesInfo.internalFormat = GL_RGBA16F_ARB; | 460 | m_texturesInfo.internalFormat = GL_RGBA16F_ARB; | ||
462 | dbgUI << "Using ARB half"; | 461 | dbgUI << "Using ARB half"; | ||
463 | } | 462 | } | ||
464 | else if (ctx->hasExtension("GL_ATI_texture_float")) { | 463 | else if (ctx->hasExtension("GL_ATI_texture_float")) { | ||
465 | m_texturesInfo.internalFormat = GL_RGBA_FLOAT16_ATI; | 464 | m_texturesInfo.internalFormat = GL_RGBA_FLOAT16_ATI; | ||
466 | dbgUI << "Using ATI half"; | 465 | dbgUI << "Using ATI half"; | ||
467 | } | 466 | } | ||
468 | 467 | | |||
469 | bool haveBuiltInOpenExr = false; | 468 | bool haveBuiltInOpenExr = false; | ||
470 | #ifdef HAVE_OPENEXR | 469 | #ifdef HAVE_OPENEXR | ||
471 | haveBuiltInOpenExr = true; | 470 | haveBuiltInOpenExr = true; | ||
472 | #endif | 471 | #endif | ||
473 | 472 | | |||
474 | if (haveBuiltInOpenExr && ctx->hasExtension("GLEW_ARB_half_float_pixel")) { | 473 | if (haveBuiltInOpenExr && ctx->hasExtension("GL_ARB_half_float_pixel")) { | ||
475 | m_texturesInfo.type = GL_HALF_FLOAT_ARB; | 474 | m_texturesInfo.type = GL_HALF_FLOAT_ARB; | ||
476 | destinationColorDepthId = Float16BitsColorDepthID; | 475 | destinationColorDepthId = Float16BitsColorDepthID; | ||
477 | dbgUI << "Pixel type half"; | 476 | dbgUI << "Pixel type half"; | ||
478 | } else { | 477 | } else { | ||
479 | m_texturesInfo.type = GL_FLOAT; | 478 | m_texturesInfo.type = GL_FLOAT; | ||
480 | destinationColorDepthId = Float32BitsColorDepthID; | 479 | destinationColorDepthId = Float32BitsColorDepthID; | ||
481 | dbgUI << "Pixel type float"; | 480 | dbgUI << "Pixel type float"; | ||
482 | } | 481 | } | ||
483 | m_texturesInfo.format = GL_RGBA; | 482 | m_texturesInfo.format = GL_RGBA; | ||
484 | } | 483 | } | ||
485 | else if (colorDepthId == Float32BitsColorDepthID) { | 484 | else if (colorDepthId == Float32BitsColorDepthID) { | ||
486 | if (ctx->hasExtension("GLEW_ARB_texture_float")) { | 485 | if (ctx->hasExtension("GL_ARB_texture_float")) { | ||
487 | m_texturesInfo.internalFormat = GL_RGBA32F_ARB; | 486 | m_texturesInfo.internalFormat = GL_RGBA32F_ARB; | ||
488 | dbgUI << "Using ARB float"; | 487 | dbgUI << "Using ARB float"; | ||
489 | } else if (ctx->hasExtension("GLEW_ATI_texture_float")) { | 488 | } else if (ctx->hasExtension("GL_ATI_texture_float")) { | ||
490 | m_texturesInfo.internalFormat = GL_RGBA_FLOAT32_ATI; | 489 | m_texturesInfo.internalFormat = GL_RGBA_FLOAT32_ATI; | ||
491 | dbgUI << "Using ATI float"; | 490 | dbgUI << "Using ATI float"; | ||
492 | } | 491 | } | ||
493 | 492 | | |||
494 | m_texturesInfo.type = GL_FLOAT; | 493 | m_texturesInfo.type = GL_FLOAT; | ||
495 | m_texturesInfo.format = GL_RGBA; | 494 | m_texturesInfo.format = GL_RGBA; | ||
496 | destinationColorDepthId = Float32BitsColorDepthID; | 495 | destinationColorDepthId = Float32BitsColorDepthID; | ||
497 | } | 496 | } | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |