82 if (host_format != device_format) {
83 if (host_format == TextureFormat::SFLOAT_16_16_16 &&
84 device_format == TextureFormat::SFLOAT_16_16_16_16)
88 if (host_format == TextureFormat::SFLOAT_32_32_32 &&
89 device_format == TextureFormat::SFLOAT_32_32_32_32)
97 switch (device_format) {
98 case TextureFormat::SFLOAT_32_32_32_32:
99 case TextureFormat::SFLOAT_32_32:
100 case TextureFormat::SFLOAT_32:
101 case TextureFormat::SFLOAT_32_DEPTH:
104 case TextureFormat::SFLOAT_32_DEPTH_UINT_8:
107 case TextureFormat::SFLOAT_16_16_16_16:
108 case TextureFormat::SFLOAT_16_16:
109 case TextureFormat::SFLOAT_16:
110 case TextureFormat::SFLOAT_16_16_16:
113 case TextureFormat::SRGBA_8_8_8_8:
114 case TextureFormat::UNORM_8_8_8_8:
115 case TextureFormat::UNORM_8_8:
116 case TextureFormat::UNORM_8:
119 case TextureFormat::SNORM_8_8_8_8:
120 case TextureFormat::SNORM_8_8_8:
121 case TextureFormat::SNORM_8_8:
122 case TextureFormat::SNORM_8:
125 case TextureFormat::UNORM_16_16_16_16:
126 case TextureFormat::UNORM_16_16:
127 case TextureFormat::UNORM_16:
130 case TextureFormat::SNORM_16_16_16_16:
131 case TextureFormat::SNORM_16_16_16:
132 case TextureFormat::SNORM_16_16:
133 case TextureFormat::SNORM_16:
136 case TextureFormat::UFLOAT_11_11_10:
139 case TextureFormat::SRGB_DXT1:
140 case TextureFormat::SRGB_DXT3:
141 case TextureFormat::SRGB_DXT5:
142 case TextureFormat::SNORM_DXT1:
143 case TextureFormat::SNORM_DXT3:
144 case TextureFormat::SNORM_DXT5:
150 case TextureFormat::SFLOAT_32_32_32:
152 case TextureFormat::UINT_8_8_8_8:
153 case TextureFormat::SINT_8_8_8_8:
154 case TextureFormat::UINT_16_16_16_16:
155 case TextureFormat::SINT_16_16_16_16:
156 case TextureFormat::UINT_32_32_32_32:
157 case TextureFormat::SINT_32_32_32_32:
158 case TextureFormat::UINT_8_8:
159 case TextureFormat::SINT_8_8:
160 case TextureFormat::UINT_16_16:
161 case TextureFormat::SINT_16_16:
162 case TextureFormat::UINT_32_32:
163 case TextureFormat::SINT_32_32:
164 case TextureFormat::UINT_8:
165 case TextureFormat::SINT_8:
166 case TextureFormat::UINT_16:
167 case TextureFormat::SINT_16:
168 case TextureFormat::UINT_32:
169 case TextureFormat::SINT_32:
170 case TextureFormat::UNORM_10_10_10_2:
171 case TextureFormat::UINT_10_10_10_2:
172 case TextureFormat::UINT_8_8_8:
173 case TextureFormat::SINT_8_8_8:
174 case TextureFormat::UNORM_8_8_8:
175 case TextureFormat::UINT_16_16_16:
176 case TextureFormat::SINT_16_16_16:
177 case TextureFormat::UNORM_16_16_16:
178 case TextureFormat::UINT_32_32_32:
179 case TextureFormat::SINT_32_32_32:
180 case TextureFormat::SRGBA_8_8_8:
181 case TextureFormat::UFLOAT_9_9_9_EXP_5:
182 case TextureFormat::UNORM_16_DEPTH:
194 switch (device_format) {
195 case TextureFormat::SINT_32_32_32_32:
196 case TextureFormat::SINT_32_32:
197 case TextureFormat::SINT_32:
200 case TextureFormat::SINT_16_16_16_16:
201 case TextureFormat::SINT_16_16:
202 case TextureFormat::SINT_16:
205 case TextureFormat::SINT_8_8_8_8:
206 case TextureFormat::SINT_8_8:
207 case TextureFormat::SINT_8:
210 case TextureFormat::UINT_8_8_8_8:
211 case TextureFormat::UNORM_8_8_8_8:
212 case TextureFormat::UINT_16_16_16_16:
213 case TextureFormat::SFLOAT_16_16_16_16:
214 case TextureFormat::UNORM_16_16_16_16:
215 case TextureFormat::UINT_32_32_32_32:
216 case TextureFormat::SFLOAT_32_32_32_32:
217 case TextureFormat::UINT_8_8:
218 case TextureFormat::UNORM_8_8:
219 case TextureFormat::UINT_16_16:
220 case TextureFormat::SFLOAT_16_16:
221 case TextureFormat::UINT_32_32:
222 case TextureFormat::SFLOAT_32_32:
223 case TextureFormat::UNORM_16_16:
224 case TextureFormat::UINT_8:
225 case TextureFormat::UNORM_8:
226 case TextureFormat::UINT_16:
227 case TextureFormat::SFLOAT_16:
228 case TextureFormat::UNORM_16:
229 case TextureFormat::UINT_32:
230 case TextureFormat::SFLOAT_32:
231 case TextureFormat::UNORM_10_10_10_2:
232 case TextureFormat::UINT_10_10_10_2:
233 case TextureFormat::UFLOAT_11_11_10:
234 case TextureFormat::SFLOAT_32_DEPTH_UINT_8:
235 case TextureFormat::SRGBA_8_8_8_8:
236 case TextureFormat::SNORM_8_8_8_8:
237 case TextureFormat::SNORM_16_16_16_16:
238 case TextureFormat::UINT_8_8_8:
239 case TextureFormat::SINT_8_8_8:
240 case TextureFormat::UNORM_8_8_8:
241 case TextureFormat::SNORM_8_8_8:
242 case TextureFormat::UINT_16_16_16:
243 case TextureFormat::SINT_16_16_16:
244 case TextureFormat::SFLOAT_16_16_16:
245 case TextureFormat::UNORM_16_16_16:
246 case TextureFormat::SNORM_16_16_16:
247 case TextureFormat::UINT_32_32_32:
248 case TextureFormat::SINT_32_32_32:
249 case TextureFormat::SFLOAT_32_32_32:
250 case TextureFormat::SNORM_8_8:
251 case TextureFormat::SNORM_16_16:
252 case TextureFormat::SNORM_8:
253 case TextureFormat::SNORM_16:
254 case TextureFormat::SRGB_DXT1:
255 case TextureFormat::SRGB_DXT3:
256 case TextureFormat::SRGB_DXT5:
257 case TextureFormat::SNORM_DXT1:
258 case TextureFormat::SNORM_DXT3:
259 case TextureFormat::SNORM_DXT5:
260 case TextureFormat::SRGBA_8_8_8:
261 case TextureFormat::UFLOAT_9_9_9_EXP_5:
262 case TextureFormat::SFLOAT_32_DEPTH:
263 case TextureFormat::UNORM_16_DEPTH:
275 switch (device_format) {
276 case TextureFormat::UINT_32_32_32_32:
277 case TextureFormat::UINT_32_32:
278 case TextureFormat::UINT_32:
281 case TextureFormat::UINT_16_16_16_16:
282 case TextureFormat::UINT_16_16:
283 case TextureFormat::UINT_16:
284 case TextureFormat::UINT_16_16_16:
287 case TextureFormat::UINT_8_8_8_8:
288 case TextureFormat::UINT_8_8:
289 case TextureFormat::UINT_8:
292 case TextureFormat::SFLOAT_32_DEPTH:
293 case TextureFormat::SFLOAT_32_DEPTH_UINT_8:
296 case TextureFormat::SINT_8_8_8_8:
297 case TextureFormat::UNORM_8_8_8_8:
298 case TextureFormat::SINT_16_16_16_16:
299 case TextureFormat::SFLOAT_16_16_16_16:
300 case TextureFormat::UNORM_16_16_16_16:
301 case TextureFormat::SINT_32_32_32_32:
302 case TextureFormat::SFLOAT_32_32_32_32:
303 case TextureFormat::SINT_8_8:
304 case TextureFormat::UNORM_8_8:
305 case TextureFormat::SINT_16_16:
306 case TextureFormat::SFLOAT_16_16:
307 case TextureFormat::UNORM_16_16:
308 case TextureFormat::SINT_32_32:
309 case TextureFormat::SFLOAT_32_32:
310 case TextureFormat::SINT_8:
311 case TextureFormat::UNORM_8:
312 case TextureFormat::SINT_16:
313 case TextureFormat::SFLOAT_16:
314 case TextureFormat::UNORM_16:
315 case TextureFormat::SINT_32:
316 case TextureFormat::SFLOAT_32:
317 case TextureFormat::UNORM_10_10_10_2:
318 case TextureFormat::UINT_10_10_10_2:
319 case TextureFormat::UFLOAT_11_11_10:
320 case TextureFormat::SRGBA_8_8_8_8:
321 case TextureFormat::SNORM_8_8_8_8:
322 case TextureFormat::SNORM_16_16_16_16:
323 case TextureFormat::UINT_8_8_8:
324 case TextureFormat::SINT_8_8_8:
325 case TextureFormat::UNORM_8_8_8:
326 case TextureFormat::SNORM_8_8_8:
327 case TextureFormat::SINT_16_16_16:
328 case TextureFormat::SFLOAT_16_16_16:
329 case TextureFormat::UNORM_16_16_16:
330 case TextureFormat::SNORM_16_16_16:
331 case TextureFormat::UINT_32_32_32:
332 case TextureFormat::SINT_32_32_32:
333 case TextureFormat::SFLOAT_32_32_32:
334 case TextureFormat::SNORM_8_8:
335 case TextureFormat::SNORM_16_16:
336 case TextureFormat::SNORM_8:
337 case TextureFormat::SNORM_16:
338 case TextureFormat::SRGB_DXT1:
339 case TextureFormat::SRGB_DXT3:
340 case TextureFormat::SRGB_DXT5:
341 case TextureFormat::SNORM_DXT1:
342 case TextureFormat::SNORM_DXT3:
343 case TextureFormat::SNORM_DXT5:
344 case TextureFormat::SRGBA_8_8_8:
345 case TextureFormat::UFLOAT_9_9_9_EXP_5:
346 case TextureFormat::UNORM_16_DEPTH:
358 switch (device_format) {
359 case TextureFormat::SFLOAT_16_16_16_16:
360 case TextureFormat::SFLOAT_16_16:
361 case TextureFormat::SFLOAT_16:
364 case TextureFormat::UINT_8_8_8_8:
365 case TextureFormat::SINT_8_8_8_8:
366 case TextureFormat::UNORM_8_8_8_8:
367 case TextureFormat::UINT_16_16_16_16:
368 case TextureFormat::SINT_16_16_16_16:
369 case TextureFormat::UNORM_16_16_16_16:
370 case TextureFormat::UINT_32_32_32_32:
371 case TextureFormat::SINT_32_32_32_32:
372 case TextureFormat::SFLOAT_32_32_32_32:
373 case TextureFormat::UINT_8_8:
374 case TextureFormat::SINT_8_8:
375 case TextureFormat::UNORM_8_8:
376 case TextureFormat::UINT_16_16:
377 case TextureFormat::SINT_16_16:
378 case TextureFormat::UNORM_16_16:
379 case TextureFormat::UINT_32_32:
380 case TextureFormat::SINT_32_32:
381 case TextureFormat::SFLOAT_32_32:
382 case TextureFormat::UINT_8:
383 case TextureFormat::SINT_8:
384 case TextureFormat::UNORM_8:
385 case TextureFormat::UINT_16:
386 case TextureFormat::SINT_16:
387 case TextureFormat::UNORM_16:
388 case TextureFormat::UINT_32:
389 case TextureFormat::SINT_32:
390 case TextureFormat::SFLOAT_32:
391 case TextureFormat::UNORM_10_10_10_2:
392 case TextureFormat::UINT_10_10_10_2:
393 case TextureFormat::UFLOAT_11_11_10:
394 case TextureFormat::SFLOAT_32_DEPTH_UINT_8:
395 case TextureFormat::SRGBA_8_8_8_8:
396 case TextureFormat::SNORM_8_8_8_8:
397 case TextureFormat::SNORM_16_16_16_16:
398 case TextureFormat::UINT_8_8_8:
399 case TextureFormat::SINT_8_8_8:
400 case TextureFormat::UNORM_8_8_8:
401 case TextureFormat::SNORM_8_8_8:
402 case TextureFormat::UINT_16_16_16:
403 case TextureFormat::SINT_16_16_16:
404 case TextureFormat::SFLOAT_16_16_16:
405 case TextureFormat::UNORM_16_16_16:
406 case TextureFormat::SNORM_16_16_16:
407 case TextureFormat::UINT_32_32_32:
408 case TextureFormat::SINT_32_32_32:
409 case TextureFormat::SFLOAT_32_32_32:
410 case TextureFormat::SNORM_8_8:
411 case TextureFormat::SNORM_16_16:
412 case TextureFormat::SNORM_8:
413 case TextureFormat::SNORM_16:
414 case TextureFormat::SRGB_DXT1:
415 case TextureFormat::SRGB_DXT3:
416 case TextureFormat::SRGB_DXT5:
417 case TextureFormat::SNORM_DXT1:
418 case TextureFormat::SNORM_DXT3:
419 case TextureFormat::SNORM_DXT5:
420 case TextureFormat::SRGBA_8_8_8:
421 case TextureFormat::UFLOAT_9_9_9_EXP_5:
422 case TextureFormat::SFLOAT_32_DEPTH:
423 case TextureFormat::UNORM_16_DEPTH:
435 switch (device_format) {
436 case TextureFormat::UINT_8_8_8_8:
437 case TextureFormat::UNORM_8_8_8_8:
438 case TextureFormat::UINT_8_8:
439 case TextureFormat::UNORM_8_8:
440 case TextureFormat::UINT_8:
441 case TextureFormat::UNORM_8:
442 case TextureFormat::SRGBA_8_8_8_8:
445 case TextureFormat::SFLOAT_16_16_16_16:
446 case TextureFormat::SFLOAT_16_16:
447 case TextureFormat::SFLOAT_16:
450 case TextureFormat::SINT_8_8_8_8:
451 case TextureFormat::UINT_16_16_16_16:
452 case TextureFormat::SINT_16_16_16_16:
453 case TextureFormat::UNORM_16_16_16_16:
454 case TextureFormat::UINT_32_32_32_32:
455 case TextureFormat::SINT_32_32_32_32:
456 case TextureFormat::SFLOAT_32_32_32_32:
457 case TextureFormat::SINT_8_8:
458 case TextureFormat::UINT_16_16:
459 case TextureFormat::SINT_16_16:
460 case TextureFormat::UNORM_16_16:
461 case TextureFormat::UINT_32_32:
462 case TextureFormat::SINT_32_32:
463 case TextureFormat::SFLOAT_32_32:
464 case TextureFormat::SINT_8:
465 case TextureFormat::UINT_16:
466 case TextureFormat::SINT_16:
467 case TextureFormat::UNORM_16:
468 case TextureFormat::UINT_32:
469 case TextureFormat::SINT_32:
470 case TextureFormat::SFLOAT_32:
471 case TextureFormat::UNORM_10_10_10_2:
472 case TextureFormat::UINT_10_10_10_2:
473 case TextureFormat::UFLOAT_11_11_10:
474 case TextureFormat::SFLOAT_32_DEPTH_UINT_8:
475 case TextureFormat::SNORM_8_8_8_8:
476 case TextureFormat::SNORM_16_16_16_16:
477 case TextureFormat::UINT_8_8_8:
478 case TextureFormat::SINT_8_8_8:
479 case TextureFormat::UNORM_8_8_8:
480 case TextureFormat::SNORM_8_8_8:
481 case TextureFormat::UINT_16_16_16:
482 case TextureFormat::SINT_16_16_16:
483 case TextureFormat::SFLOAT_16_16_16:
484 case TextureFormat::UNORM_16_16_16:
485 case TextureFormat::SNORM_16_16_16:
486 case TextureFormat::UINT_32_32_32:
487 case TextureFormat::SINT_32_32_32:
488 case TextureFormat::SFLOAT_32_32_32:
489 case TextureFormat::SNORM_8_8:
490 case TextureFormat::SNORM_16_16:
491 case TextureFormat::SNORM_8:
492 case TextureFormat::SNORM_16:
493 case TextureFormat::SRGB_DXT1:
494 case TextureFormat::SRGB_DXT3:
495 case TextureFormat::SRGB_DXT5:
496 case TextureFormat::SNORM_DXT1:
497 case TextureFormat::SNORM_DXT3:
498 case TextureFormat::SNORM_DXT5:
499 case TextureFormat::SRGBA_8_8_8:
500 case TextureFormat::UFLOAT_9_9_9_EXP_5:
501 case TextureFormat::SFLOAT_32_DEPTH:
502 case TextureFormat::UNORM_16_DEPTH:
514 switch (device_format) {
515 case TextureFormat::SFLOAT_32_DEPTH_UINT_8:
518 case TextureFormat::SFLOAT_32_32_32_32:
519 case TextureFormat::SFLOAT_32_32:
520 case TextureFormat::SFLOAT_32:
521 case TextureFormat::SFLOAT_16_16_16_16:
522 case TextureFormat::SFLOAT_16_16:
523 case TextureFormat::SFLOAT_16:
524 case TextureFormat::SFLOAT_16_16_16:
525 case TextureFormat::UNORM_8_8_8_8:
526 case TextureFormat::UNORM_8_8:
527 case TextureFormat::UNORM_8:
528 case TextureFormat::SNORM_8_8_8_8:
529 case TextureFormat::SNORM_8_8_8:
530 case TextureFormat::SNORM_8_8:
531 case TextureFormat::SNORM_8:
532 case TextureFormat::UNORM_16_16_16_16:
533 case TextureFormat::UNORM_16_16:
534 case TextureFormat::UNORM_16:
535 case TextureFormat::SNORM_16_16_16_16:
536 case TextureFormat::SNORM_16_16_16:
537 case TextureFormat::SNORM_16_16:
538 case TextureFormat::SNORM_16:
539 case TextureFormat::SRGBA_8_8_8_8:
540 case TextureFormat::SFLOAT_32_DEPTH:
541 case TextureFormat::UFLOAT_11_11_10:
542 case TextureFormat::SRGB_DXT1:
543 case TextureFormat::SRGB_DXT3:
544 case TextureFormat::SRGB_DXT5:
545 case TextureFormat::SNORM_DXT1:
546 case TextureFormat::SNORM_DXT3:
547 case TextureFormat::SNORM_DXT5:
550 case TextureFormat::SFLOAT_32_32_32:
552 case TextureFormat::UINT_8_8_8_8:
553 case TextureFormat::SINT_8_8_8_8:
554 case TextureFormat::UINT_16_16_16_16:
555 case TextureFormat::SINT_16_16_16_16:
556 case TextureFormat::UINT_32_32_32_32:
557 case TextureFormat::SINT_32_32_32_32:
558 case TextureFormat::UINT_8_8:
559 case TextureFormat::SINT_8_8:
560 case TextureFormat::UINT_16_16:
561 case TextureFormat::SINT_16_16:
562 case TextureFormat::UINT_32_32:
563 case TextureFormat::SINT_32_32:
564 case TextureFormat::UINT_8:
565 case TextureFormat::SINT_8:
566 case TextureFormat::UINT_16:
567 case TextureFormat::SINT_16:
568 case TextureFormat::UINT_32:
569 case TextureFormat::SINT_32:
570 case TextureFormat::UNORM_10_10_10_2:
571 case TextureFormat::UINT_10_10_10_2:
572 case TextureFormat::UINT_8_8_8:
573 case TextureFormat::SINT_8_8_8:
574 case TextureFormat::UNORM_8_8_8:
575 case TextureFormat::UINT_16_16_16:
576 case TextureFormat::SINT_16_16_16:
577 case TextureFormat::UNORM_16_16_16:
578 case TextureFormat::UINT_32_32_32:
579 case TextureFormat::SINT_32_32_32:
580 case TextureFormat::SRGBA_8_8_8:
581 case TextureFormat::UFLOAT_9_9_9_EXP_5:
582 case TextureFormat::UNORM_16_DEPTH:
594 if (device_format == TextureFormat::UFLOAT_11_11_10) {
602 if (
ELEM(device_format, TextureFormat::UNORM_10_10_10_2, TextureFormat::UINT_10_10_10_2)) {
612 switch (host_format) {
636#define CASE_SINGLE(a, b) \
637 case ConversionType::a##_TO_##b: \
638 return ConversionType::b##_TO_##a;
640#define CASE_PAIR(a, b) \
688 float_to_bits.fl = value;
689 return float_to_bits.u;
698 float_to_bits.u = value;
699 return float_to_bits.fl;
726 return value & 0xffff;
731 value = (
value & 0xffffffffffff0000) | (new_value & 0xffff);
735 return (
value >> 16) & 0xffff;
740 value = (
value & 0xffffffff0000ffff) | ((new_value & 0xffff) << 16);
744 return (
value >> 32) & 0xffff;
749 value = (
value & 0xffff0000ffffffff) | ((new_value & 0xffff) << 32);
754 value = (
value & 0xffffffffffff) | ((new_value & 0xffff) << 48);
762 static_assert(std::is_same<InnerType, uint8_t>() || std::is_same<InnerType, uint16_t>());
767 return (1 << (
sizeof(InnerType) * 8 - 1));
772 return (1 << (
sizeof(InnerType) * 8 - 1)) - 1;
777 return ((1 << (
sizeof(InnerType) * 8)) - 1);
782 static_assert(std::is_same<InnerType, uint8_t>() || std::is_same<InnerType, uint16_t>() ||
783 std::is_same<InnerType, uint32_t>());
788 return sizeof(InnerType);
793 return std::numeric_limits<InnerType>::max();
796 static constexpr uint32_t
max()
798 return std::numeric_limits<InnerType>::max();
820 static constexpr uint32_t
max = scalar;
833template<
typename StorageType>
846template<
typename DestinationType,
typename SourceType>
847void convert(DestinationType &dst,
const SourceType &src)
849 static_assert(std::is_same<DestinationType, UI8>() || std::is_same<DestinationType, UI16>() ||
850 std::is_same<DestinationType, UI32>() || std::is_same<DestinationType, I8>() ||
851 std::is_same<DestinationType, I16>() || std::is_same<DestinationType, I32>());
852 static_assert(std::is_same<SourceType, UI8>() || std::is_same<SourceType, UI16>() ||
853 std::is_same<SourceType, UI32>() || std::is_same<SourceType, I8>() ||
854 std::is_same<SourceType, I16>() || std::is_same<SourceType, I32>());
855 static_assert(!std::is_same<DestinationType, SourceType>());
856 dst.value = src.value;
935 uint32_t depth = uint32_t(src.
value * 0xFFFFFF);
936 dst.
value = (depth << 8);
941 uint32_t depth = (src.
value >> 8) & 0xFFFFFF;
945template<
typename DestinationType,
typename SourceType>
950 convert(dst[index], src[index]);
954template<
typename DestinationType,
typename SourceType>
956 const void *src_memory,
964 static_cast<DestinationType *
>(dst_memory), total_components);
968template<
typename DestinationType,
typename SourceType>
974 static_cast<DestinationType *
>(dst_memory), buffer_size);
979 const void *src_memory,
989 memcpy(dst_memory, src_memory, buffer_size *
to_bytesize(device_format));
993 memcpy(dst_memory, src_memory, buffer_size *
to_bytesize(TextureFormat::SFLOAT_32_DEPTH));
1030 dst_memory, src_memory, buffer_size, device_format);
1034 dst_memory, src_memory, buffer_size, device_format);
1039 dst_memory, src_memory, buffer_size, device_format);
1043 dst_memory, src_memory, buffer_size, device_format);
1048 dst_memory, src_memory, buffer_size, device_format);
1052 dst_memory, src_memory, buffer_size, device_format);
1057 dst_memory, src_memory, buffer_size, device_format);
1061 dst_memory, src_memory, buffer_size, device_format);
1066 dst_memory, src_memory, buffer_size, device_format);
1070 dst_memory, src_memory, buffer_size, device_format);
1082 Span<float> src(
static_cast<const float *
>(src_memory), element_len);
1085 constexpr int64_t chunk_size = 4 * 1024 * 1024;
1099 static_cast<float *
>(dst_memory),
1139 const void *src_buffer,
1147 convert_buffer(dst_buffer, src_buffer, buffer_size, device_format, conversion_type);
1151 const void *src_buffer,
1158 host_to_device(host_format, host_texture_format, device_format));
1160 "Data conversion between host_format and device_format isn't supported (yet).");
1161 convert_buffer(dst_buffer, src_buffer, buffer_size, device_format, conversion_type);
#define BLI_assert_unreachable()
#define BLI_assert_msg(a, msg)
MINLINE float max_ff(float a, float b)
MINLINE int clamp_i(int value, int min, int max)
@ GPU_DATA_UINT_24_8_DEPRECATED
@ GPU_DATA_2_10_10_10_REV
unsigned long long int uint64_t
constexpr int64_t size() const
constexpr int64_t size() const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr T * data() const
constexpr Span slice(int64_t start, int64_t size) const
constexpr const T * data() const
constexpr int64_t size() const
void set_g(uint64_t new_value)
void set_r(uint64_t new_value)
void set_a(uint64_t new_value)
void set_b(uint64_t new_value)
ComponentValue< int16_t > I16
ComponentValue< uint16_t > F16
ComponentValue< uint8_t > UI8
constexpr uint32_t MASK_10_BITS
void convert_per_component(void *dst_memory, const void *src_memory, size_t buffer_size, TextureFormat device_format)
ComponentValue< uint32_t > UI32
constexpr uint8_t SHIFT_B
static ConversionType reversed(ConversionType type)
@ B10F_G11F_R11F_TO_FLOAT
@ FLOAT_TO_B10F_G11F_R11F
@ UINT_TO_DEPTH32F_STENCIL8
@ DEPTH32F_STENCIL8_TO_UINT
static ConversionType host_to_device(const eGPUDataFormat host_format, const TextureFormat host_texture_format, const TextureFormat device_format)
static ConversionType type_of_conversion_uint(TextureFormat device_format)
static uint32_t float_to_uint32_t(float value)
void convert(SignedNormalized< StorageType > &dst, const F32 &src)
ComponentValue< uint16_t > UI16
constexpr uint8_t SHIFT_R
static ConversionType type_of_conversion_float(const TextureFormat host_format, const TextureFormat device_format)
constexpr uint8_t SHIFT_G
PixelValue< float3 > FLOAT3
static ConversionType type_of_conversion_uint248(const TextureFormat device_format)
int to_bytesize(const DataFormat format)
static ConversionType type_of_conversion_ubyte(TextureFormat device_format)
ComponentValue< float > F32
void convert_host_to_device(void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, TextureFormat host_texture_format, TextureFormat device_format)
ComponentValue< int32_t > I32
PixelValue< ColorSceneLinear4f< eAlpha::Premultiplied > > FLOAT4
ComponentValue< int8_t > I8
static ConversionType type_of_conversion_r10g10b10a2(TextureFormat device_format)
static void convert_buffer(void *dst_memory, const void *src_memory, size_t buffer_size, TextureFormat device_format, ConversionType type)
int to_component_len(TextureFormat format)
static ConversionType type_of_conversion_r11g11b10(TextureFormat device_format)
uint32_t convert_float_formats(uint32_t value)
static float uint32_t_to_float(uint32_t value)
void convert_per_pixel(void *dst_memory, const void *src_memory, size_t buffer_size)
static ConversionType type_of_conversion_half(TextureFormat device_format)
void convert_device_to_host(void *dst_buffer, const void *src_buffer, size_t buffer_size, eGPUDataFormat host_format, TextureFormat host_texture_format, TextureFormat device_format)
constexpr uint32_t MASK_11_BITS
static ConversionType type_of_conversion_int(TextureFormat device_format)
uint16_t float_to_half(float v)
void half_to_float_array(const uint16_t *src, float *dst, size_t length)
void float_to_half_make_finite_array(const float *src, uint16_t *dst, size_t length)
float half_to_float(uint16_t v)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
#define CASE_PAIR(value_src, value_dst)
static constexpr int32_t scalar()
static constexpr int32_t delta()
static constexpr int32_t max()
static constexpr uint32_t max()
static constexpr size_t used_byte_size()
static constexpr uint32_t scalar()