case Graphics::Format::R64G64B64A64_SINT:
case Graphics::Format::R64G64B64A64_SFLOAT:
case Graphics::Format::B10G11R11_UFLOAT_PACK32:
+ case Graphics::Format::R11G11B10_UFLOAT_PACK32:
case Graphics::Format::E5B9G9R9_UFLOAT_PACK32:
case Graphics::Format::D16_UNORM:
case Graphics::Format::X8_D24_UNORM_PACK32:
glFormat = 0;
break;
}
+ case Graphics::Format::R11G11B10_UFLOAT_PACK32:
+ {
+ glFormat = GL_RGB;
+ pixelDataType = GL_FLOAT;
+ break;
+ }
case Graphics::Format::R4G4_UNORM_PACK8:
case Graphics::Format::A1R5G5B5_UNORM_PACK16:
{
case Graphics::Format::R16G16B16A16_SFLOAT:
case Graphics::Format::R32G32B32A32_SFLOAT:
+ case Graphics::Format::R11G11B10_UFLOAT_PACK32:
{
glInternalFormat = GL_R11F_G11F_B10F;
break;
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
tet_infoline("UtcDaliPixelHasAlpha");
- TestPixelEnumSize(59);
+ TestPixelEnumSize(60);
DALI_TEST_CHECK(Pixel::HasAlpha(Pixel::INVALID) == false); // For completeness
DALI_TEST_CHECK(Pixel::HasAlpha(Pixel::DEPTH_FLOAT) == false);
DALI_TEST_CHECK(Pixel::HasAlpha(Pixel::DEPTH_STENCIL) == false);
+ DALI_TEST_CHECK(Pixel::HasAlpha(Pixel::R11G11B10F) == false);
+
END_TEST;
}
tet_infoline("UtcDaliPixelGetBytesPerPixel");
// Be sure that the number of cases tested below is correct:
- TestPixelEnumSize(59);
+ TestPixelEnumSize(60);
DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::INVALID) == 0); // For completeness
DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR) == 0);
DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR) == 0);
- DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::RGB16F) == 12);
- DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::RGB32F) == 24);
+ DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::RGB16F) == 6);
+ DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::RGB32F) == 12);
DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::DEPTH_UNSIGNED_INT) == 4);
DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::DEPTH_FLOAT) == 4);
DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::DEPTH_STENCIL) == 4);
-
+ DALI_TEST_CHECK(Pixel::GetBytesPerPixel(Pixel::R11G11B10F) == 4);
END_TEST;
}
int bitMask = 0;
// Be sure that the number of cases tested below is correct:
- TestPixelEnumSize(59);
+ TestPixelEnumSize(60);
Pixel::GetAlphaOffsetAndMask(Pixel::INVALID, byteOffset, bitMask); // For completeness
DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
Pixel::GetAlphaOffsetAndMask(Pixel::DEPTH_STENCIL, byteOffset, bitMask);
DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
+ Pixel::GetAlphaOffsetAndMask(Pixel::R11G11B10F, byteOffset, bitMask);
+ DALI_TEST_CHECK(byteOffset == 0 && bitMask == 0);
END_TEST;
}
Dali::Integration::ConvertToGlFormat(Pixel::Format::DEPTH_STENCIL, pixelDataType, internalFormat);
DALI_TEST_CHECK(pixelDataType == GL_UNSIGNED_INT_24_8);
DALI_TEST_CHECK(internalFormat == GL_DEPTH_STENCIL);
+
+ Dali::Integration::ConvertToGlFormat(Pixel::Format::R11G11B10F, pixelDataType, internalFormat);
+ DALI_TEST_CHECK(pixelDataType == GL_FLOAT);
+ DALI_TEST_CHECK(internalFormat == GL_R11F_G11F_B10F);
END_TEST;
}
Pixel::BGRA8888,
Pixel::DEPTH_UNSIGNED_INT,
Pixel::DEPTH_FLOAT,
- Pixel::DEPTH_STENCIL};
+ Pixel::DEPTH_STENCIL,
+ Pixel::RGB16F,
+ Pixel::RGB32F,
+ Pixel::R11G11B10F,
+ };
for(auto format : formats)
{
- tet_infoline("Creating a Texure with an alpha channel");
+ tet_infoline("Creating a Texure with a new or recent format");
Texture texture = CreateTexture(TextureType::TEXTURE_2D, format, width, height);
application.SendNotification();
R64G64B64A64_UINT,
R64G64B64A64_SINT,
R64G64B64A64_SFLOAT,
+ R11G11B10_UFLOAT_PACK32,
B10G11R11_UFLOAT_PACK32,
E5B9G9R9_UFLOAT_PACK32,
D16_UNORM,
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
internalFormat = GL_RGB;
break;
}
+ case R11G11B10F:
+ {
+ DALI_LOG_INFO(Debug::Filter::gImage, Debug::Verbose, "Using GLES 3.0 GLES 3.0 floating point format.\n");
+ pixelDataType = GL_FLOAT;
+ internalFormat = GL_R11F_G11F_B10F;
+ break;
+ }
// GLES 3.0 depth and stencil formats
case Pixel::DEPTH_UNSIGNED_INT:
return Graphics::Format::R16G16B16_SFLOAT;
case Pixel::RGB32F:
return Graphics::Format::R32G32B32_SFLOAT;
+ case Pixel::R11G11B10F:
+ return Graphics::Format::R11G11B10_UFLOAT_PACK32;
}
return Graphics::Format::UNDEFINED;
}
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
case DEPTH_UNSIGNED_INT:
case DEPTH_FLOAT:
case DEPTH_STENCIL:
+ case R11G11B10F:
case INVALID:
{
return false;
case DEPTH_UNSIGNED_INT:
case DEPTH_FLOAT:
case DEPTH_STENCIL:
+ case R11G11B10F:
{
return 4;
}
case RGB16F:
{
- return 12;
+ return 6;
}
case RGB32F:
{
- return 24;
+ return 12;
}
case COMPRESSED_R11_EAC:
case DEPTH_UNSIGNED_INT:
case DEPTH_FLOAT:
case DEPTH_STENCIL:
+ case R11G11B10F:
case INVALID:
{
DALI_LOG_ERROR("Pixel formats are not compatible with simple masking-out of per-pixel alpha.\n");
#define DALI_PIXEL_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
DEPTH_UNSIGNED_INT, ///< Unsigned int depth format 32-bit. @SINCE_1_9.9
DEPTH_FLOAT, ///< Float depth format 32-bit. @SINCE_1_9.9
- DEPTH_STENCIL ///< Depth stencil 32-bit, 24 bit for depth, 8 bit for stencil. @SINCE_1_9.9
+ DEPTH_STENCIL, ///< Depth stencil 32-bit, 24 bit for depth, 8 bit for stencil. @SINCE_1_9.9
+
+ R11G11B10F ///< Packed 32-bit, 11-11-10 unsigned floating point.
///! Update LAST_VALID_PIXEL_FORMAT below if you add an enum value here.
};
*
* Sync it to the last value above.
*/
-const Format LAST_VALID_PIXEL_FORMAT = DEPTH_STENCIL;
+const Format LAST_VALID_PIXEL_FORMAT = R11G11B10F;
/**
* @brief Whether specified pixel format contains an alpha value.