Home | History | Annotate | Download | only in functional

Lines Matching full:textureformat

67 using tcu::TextureFormat;
134 static inline bool isFormatTypeUnsignedInteger (TextureFormat::ChannelType type)
136 return type == TextureFormat::UNSIGNED_INT8 ||
137 type == TextureFormat::UNSIGNED_INT16 ||
138 type == TextureFormat::UNSIGNED_INT32;
141 static inline bool isFormatTypeSignedInteger (TextureFormat::ChannelType type)
143 return type == TextureFormat::SIGNED_INT8 ||
144 type == TextureFormat::SIGNED_INT16 ||
145 type == TextureFormat::SIGNED_INT32;
148 static inline bool isFormatTypeInteger (TextureFormat::ChannelType type)
153 static inline bool isFormatTypeUnorm (TextureFormat::ChannelType type)
155 return type == TextureFormat::UNORM_INT8 ||
156 type == TextureFormat::UNORM_INT16 ||
157 type == TextureFormat::UNORM_INT32;
160 static inline bool isFormatTypeSnorm (TextureFormat::ChannelType type)
162 return type == TextureFormat::SNORM_INT8 ||
163 type == TextureFormat::SNORM_INT16 ||
164 type == TextureFormat::SNORM_INT32;
167 static inline bool isFormatSupportedForTextureBuffer (const TextureFormat& format)
171 case TextureFormat::RGB:
172 return format.type == TextureFormat::FLOAT ||
173 format.type == TextureFormat::SIGNED_INT32 ||
174 format.type == TextureFormat::UNSIGNED_INT32;
177 case TextureFormat::R:
178 case TextureFormat::RG:
179 case TextureFormat::RGBA:
180 return format.type == TextureFormat::UNORM_INT8 ||
181 format.type == TextureFormat::HALF_FLOAT ||
182 format.type == TextureFormat::FLOAT ||
183 format.type == TextureFormat::SIGNED_INT8 ||
184 format.type == TextureFormat::SIGNED_INT16 ||
185 format.type == TextureFormat::SIGNED_INT32 ||
186 format.type == TextureFormat::UNSIGNED_INT8 ||
187 format.type == TextureFormat::UNSIGNED_INT16 ||
188 format.type == TextureFormat::UNSIGNED_INT32;
195 static inline string getShaderImageFormatQualifier (const TextureFormat& format)
202 case TextureFormat::R: orderPart = "r"; break;
203 case TextureFormat::RGBA: orderPart = "rgba"; break;
211 case TextureFormat::FLOAT: typePart = "32f"; break;
212 case TextureFormat::HALF_FLOAT: typePart = "16f"; break;
214 case TextureFormat::UNSIGNED_INT32: typePart = "32ui"; break;
215 case TextureFormat::UNSIGNED_INT16: typePart = "16ui"; break;
216 case TextureFormat::UNSIGNED_INT8: typePart = "8ui"; break;
218 case TextureFormat::SIGNED_INT32: typePart = "32i"; break;
219 case TextureFormat::SIGNED_INT16: typePart = "16i"; break;
220 case TextureFormat::SIGNED_INT8: typePart = "8i"; break;
222 case TextureFormat::UNORM_INT16: typePart = "16"; break;
223 case TextureFormat::UNORM_INT8: typePart = "8"; break;
225 case TextureFormat::SNORM_INT16: typePart = "16_snorm"; break;
226 case TextureFormat::SNORM_INT8: typePart = "8_snorm"; break;
236 static inline string getShaderSamplerOrImageType (TextureFormat::ChannelType formatType, TextureType textureType, bool isSampler)
252 static inline string getShaderImageType (TextureFormat::ChannelType formatType, TextureType imageType)
257 static inline string getShaderSamplerType (TextureFormat::ChannelType formatType, TextureType imageType)
293 static inline tcu::Texture1D* newOneLevelTexture1D (const tcu::TextureFormat& format, int w)
300 static inline tcu::Texture2D* newOneLevelTexture2D (const tcu::TextureFormat& format, int w, int h)
307 static inline tcu::TextureCube* newOneLevelTextureCube (const tcu::TextureFormat& format, int size)
315 static inline tcu::Texture3D* newOneLevelTexture3D (const tcu::TextureFormat& format, int w, int h, int d)
322 static inline tcu::Texture2DArray* newOneLevelTexture2DArray (const tcu::TextureFormat& format, int w, int h, int d)
573 LayeredImage (TextureType type, const TextureFormat& format, int w, int h, int d);
577 const TextureFormat& getFormat (void) const { return m_format; }
607 const TextureFormat m_format;
617 LayeredImage::LayeredImage (TextureType type, const TextureFormat& format, int w, int h, int d)
703 const TextureFormat format = glu::mapGLInternalFormat(internalFormat);
825 const TextureFormat& textureFormat,
829 DE_ASSERT(isFormatTypeInteger(textureFormat.type));
839 tcu::TextureLevel resultSlice (textureFormat, textureSize.x(), textureSize.y());
882 const TextureFormat& textureFormat,
886 DE_ASSERT(!isFormatTypeInteger(textureFormat.type));
902 "precision highp " + getShaderSamplerType(textureFormat.type, textureType) + ";\n"
904 "uniform highp " + getShaderSamplerType(textureFormat.type, textureType) + " u_texture;\n"
964 tcu::TextureLevel resultSlice (textureFormat, textureSize.x(), textureSize.y());
1010 switch (textureFormat.order)
1012 case TextureFormat::R: resultSliceAccess.setPixel(Vec4(clrData[0]), x, y); break;
1013 case TextureFormat::RGBA: resultSliceAccess.setPixel(Vec4(clrData[0], clrData[1], clrData[2], clrData[3]), x, y); break;
1033 const TextureFormat& textureFormat,
1037 tcu::TextureLevel result (textureFormat, imageSize, 1);
1039 const int dataSize = imageSize * textureFormat.getPixelSize();
1058 const TextureFormat& textureFormat,
1063 return readBufferTextureWithMappingAndVerify(renderCtx, glLog, bufferGL, textureFormat, imageSize.x(), verifyLayer);
1065 return isFormatTypeInteger(textureFormat.type) ? readIntegerTextureViaFBOAndVerify (renderCtx, glLog, textureGL, textureType, textureFormat, imageSize, verifyLayer)
1066 : readFloatOrNormTextureWithLookupsAndVerify (renderCtx, glLog, textureGL, textureType, textureFormat, imageSize, verifyLayer);
1113 ImageStoreCase (Context& context, const char* name, const char* description, const TextureFormat& format, TextureType textureType, deUint32 caseFlags = 0)
1125 const TextureFormat m_format;
1278 ImageLoadAndStoreCase (Context& context, const char* name, const char* description, const TextureFormat& format, TextureType textureType, deUint32 caseFlags = 0)
1288 TextureFormat& textureFormat, const TextureFormat& imageFormat, TextureType textureType, deUint32 caseFlags = 0)
1290 , m_textureFormat (textureFormat)
1296 DE_ASSERT(textureFormat.getPixelSize() == imageFormat.getPixelSize());
1303 template <TextureFormat::ChannelType ImageFormatType, typename TcuFloatType, typename TcuFloatStorageType>
1304 static void replaceBadFloatReinterpretValues (LayeredImage& image, const TextureFormat& imageFormat);
1306 const TextureFormat m_textureFormat;
1307 const TextureFormat m_imageFormat;
1313 template <TextureFormat::ChannelType ImageFormatType, typename TcuFloatType, typename TcuFloatTypeStorageType>
1314 void ImageLoadAndStoreCase::replaceBadFloatReinterpretValues (LayeredImage& image, const TextureFormat& imageFormat)
1318 const int imageNumChannels = imageFormat.order == tcu::TextureFormat::R ? 1
1319 : imageFormat.order == tcu::TextureFormat::RGBA ? 4
1396 if (m_imageFormat.type == TextureFormat::HALF_FLOAT && m_textureFormat.type != TextureFormat::HALF_FLOAT)
1397 replaceBadFloatReinterpretValues<TextureFormat::HALF_FLOAT, tcu::Float16, deUint16>(reference, m_imageFormat);
1398 else if (m_imageFormat.type == TextureFormat::FLOAT && m_textureFormat.type != TextureFormat::FLOAT)
1399 replaceBadFloatReinterpretValues<TextureFormat::FLOAT, tcu::Float32, deUint32>(reference, m_imageFormat);
1594 BinaryAtomicOperationCase (Context& context, const char* name, const char* description, const TextureFormat& format, TextureType imageType, AtomicOperation operation, AtomicOperationCaseType caseType)
1601 DE_ASSERT(m_format == TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32) ||
1602 m_format == TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT32) ||
1603 (m_format == TextureFormat(TextureFormat::R, TextureFormat::FLOAT) && m_operation == ATOMIC_OPERATION_EXCHANGE));
1623 const TextureFormat m_format;
2101 AtomicCompSwapCase (Context& context, const char* name, const char* description, const TextureFormat& format, TextureType imageType, AtomicOperationCaseType caseType)
2107 DE_ASSERT(m_format == TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32) ||
2108 m_format == TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT32));
2125 const TextureFormat m_format;
2507 CoherenceCase (Context& context, const char* name, const char* description, const TextureFormat& format, TextureType imageType, Qualifier qualifier)
2518 DE_ASSERT(m_format == TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32) ||
2519 m_format == TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT32) ||
2520 m_format == TextureFormat(TextureFormat::R, TextureFormat::FLOAT));
2534 const TextureFormat m_format;
2716 DE_ASSERT(resultSlice.getFormat() == TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32));
2752 ImageSizeCase (Context& context, const char* name, const char* description, const TextureFormat& format, TextureType imageType, const IVec3& size, ImageAccess imageAccess)
2765 const TextureFormat m_format;
2868 if (readIntegerTextureViaFBOAndVerify(renderCtx, glLog, *shaderOutResultTexture, TEXTURETYPE_2D, TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32),
2973 LayeredImage src(TEXTURETYPE_2D, TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32), 1, 1, 1);
3133 if (readIntegerTextureViaFBOAndVerify(renderCtx, glLog, *texture, TEXTURETYPE_2D, TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32),
3168 static const TextureFormat formats[] =
3170 TextureFormat(TextureFormat::RGBA, TextureFormat::FLOAT),
3171 TextureFormat(TextureFormat::RGBA, TextureFormat::HALF_FLOAT),
3172 TextureFormat(TextureFormat::R, TextureFormat::FLOAT),
3174 TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT32),
3175 TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT16),
3176 TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT8),
3177 TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32),
3179 TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT32),
3180 TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT16),
3181 TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT8),
3182 TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT32),
3184 TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8),
3186 TextureFormat(TextureFormat::RGBA, TextureFormat::SNORM_INT8)
3210 const TextureFormat& format = formats[formatNdx];
3228 if (format.order == TextureFormat::R)
3238 if (format.type == TextureFormat::FLOAT && operation != ATOMIC_OPERATION_EXCHANGE)
3270 qualifierGroup->addChild(new ImageLoadAndStoreCase(m_context, "restrict", "", TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT32), imageType, ImageLoadAndStoreCase::CASEFLAG_RESTRICT_IMAGES));
3277 const TextureFormat& texFmt = formats[texFmtNdx];
3278 const TextureFormat& imgFmt = formats[imgFmtNdx];
3327 imageSizeGroup->addChild(new ImageSizeCase(m_context, caseName.c_str(), "", TextureFormat(TextureFormat::RGBA, TextureFormat::FLOAT), imageType, imageSize, imageAccess));