ReactOS 0.4.17-dev-923-g4c9a150
texture.c
Go to the documentation of this file.
1/*
2 * Copyright 2020 Ziqing Hui for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include "wine/debug.h"
20
21#define COBJMACROS
22
23#include "d3d10_1.h"
24#include "d3dx10.h"
25#include "wincodec.h"
26#include "dxhelpers.h"
27
29
31
32static const struct
33{
36}
38{
39 { &GUID_ContainerFormatBmp, D3DX10_IFF_BMP },
40 { &GUID_ContainerFormatJpeg, D3DX10_IFF_JPG },
41 { &GUID_ContainerFormatPng, D3DX10_IFF_PNG },
42 { &GUID_ContainerFormatDds, D3DX10_IFF_DDS },
43 { &GUID_ContainerFormatTiff, D3DX10_IFF_TIFF },
44 { &GUID_ContainerFormatGif, D3DX10_IFF_GIF },
45 { &GUID_ContainerFormatWmp, D3DX10_IFF_WMP },
46};
47
48static const struct
49{
50 const GUID *wic_guid;
52}
54{
55 { &GUID_WICPixelFormatBlackWhite, DXGI_FORMAT_R1_UNORM },
56 { &GUID_WICPixelFormat8bppAlpha, DXGI_FORMAT_A8_UNORM },
57 { &GUID_WICPixelFormat8bppGray, DXGI_FORMAT_R8_UNORM },
58 { &GUID_WICPixelFormat16bppGray, DXGI_FORMAT_R16_UNORM },
59 { &GUID_WICPixelFormat16bppGrayHalf, DXGI_FORMAT_R16_FLOAT },
60 { &GUID_WICPixelFormat32bppGrayFloat, DXGI_FORMAT_R32_FLOAT },
61 { &GUID_WICPixelFormat16bppBGR565, DXGI_FORMAT_B5G6R5_UNORM },
62 { &GUID_WICPixelFormat16bppBGRA5551, DXGI_FORMAT_B5G5R5A1_UNORM },
63 { &GUID_WICPixelFormat32bppBGR, DXGI_FORMAT_B8G8R8X8_UNORM },
64 { &GUID_WICPixelFormat32bppBGRA, DXGI_FORMAT_B8G8R8A8_UNORM },
65 { &GUID_WICPixelFormat32bppRGBA, DXGI_FORMAT_R8G8B8A8_UNORM },
66 { &GUID_WICPixelFormat32bppRGBA1010102, DXGI_FORMAT_R10G10B10A2_UNORM },
67 { &GUID_WICPixelFormat32bppRGBA1010102XR, DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM },
68 { &GUID_WICPixelFormat64bppRGBA, DXGI_FORMAT_R16G16B16A16_UNORM },
69 { &GUID_WICPixelFormat64bppRGBAHalf, DXGI_FORMAT_R16G16B16A16_FLOAT },
70 { &GUID_WICPixelFormat96bppRGBFloat, DXGI_FORMAT_R32G32B32_FLOAT },
71 { &GUID_WICPixelFormat128bppRGBAFloat, DXGI_FORMAT_R32G32B32A32_FLOAT }
72};
73
75{
76 unsigned int i;
77
78 for (i = 0; i < ARRAY_SIZE(file_formats); ++i)
79 {
80 if (IsEqualGUID(file_formats[i].wic_container_guid, container_format))
82 }
84}
85
87{
88 unsigned int i;
89
90 for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); ++i)
91 {
93 return wic_pixel_formats[i].wic_guid;
94 }
95
96 return NULL;
97}
98
100{
101 switch (wic_dimension)
102 {
103 case WICDdsTexture1D:
105 case WICDdsTexture2D:
108 case WICDdsTexture3D:
110 default:
112 }
113}
114
116{
117 switch (format)
118 {
123 return 128;
128 return 96;
143 case DXGI_FORMAT_Y416:
144 case DXGI_FORMAT_Y210:
145 case DXGI_FORMAT_Y216:
146 return 64;
182 case DXGI_FORMAT_AYUV:
183 case DXGI_FORMAT_Y410:
184 case DXGI_FORMAT_YUY2:
185 return 32;
186 case DXGI_FORMAT_P010:
187 case DXGI_FORMAT_P016:
188 return 24;
203 case DXGI_FORMAT_A8P8:
205 return 16;
206 case DXGI_FORMAT_NV12:
208 case DXGI_FORMAT_NV11:
209 return 12;
216 case DXGI_FORMAT_AI44:
217 case DXGI_FORMAT_IA44:
218 case DXGI_FORMAT_P8:
234 return 8;
241 return 4;
243 return 1;
244 default:
245 return 0;
246 }
247}
248
250{
251 static const struct
252 {
255 }
256 format_map[] =
257 {
267 };
268
269 unsigned int i;
270
271 for (i = 0; i < ARRAY_SIZE(format_map); ++i)
272 {
273 if (format == format_map[i].src)
274 return format_map[i].dst;
275 }
276 return format;
277}
278
279HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info,
281{
282 WCHAR *buffer;
283 int str_len;
284 HRESULT hr;
285
286 TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_a(src_file), pump, info, result);
287
288 if (!src_file)
289 return E_FAIL;
290
291 str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0);
292 if (!str_len)
294
295 buffer = malloc(str_len * sizeof(*buffer));
296 if (!buffer)
297 return E_OUTOFMEMORY;
298
299 MultiByteToWideChar(CP_ACP, 0, src_file, -1, buffer, str_len);
301
302 free(buffer);
303
304 return hr;
305}
306
307HRESULT WINAPI D3DX10GetImageInfoFromFileW(const WCHAR *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info,
309{
310 void *buffer = NULL;
311 DWORD size = 0;
312 HRESULT hr;
313
314 TRACE("src_file %s, pump %p, info %p, result %p.\n", debugstr_w(src_file), pump, info, result);
315
316 if (!src_file)
317 return E_FAIL;
318
319 if (pump)
320 {
321 ID3DX10DataProcessor *processor;
322 ID3DX10DataLoader *loader;
323
324 if (FAILED((hr = D3DX10CreateAsyncFileLoaderW(src_file, &loader))))
325 return hr;
327 {
329 return hr;
330 }
331 hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL);
332 if (FAILED(hr))
333 {
336 }
337 return hr;
338 }
339
340 if (SUCCEEDED((hr = load_file(src_file, &buffer, &size))))
341 {
343 free(buffer);
344 }
345 if (result)
346 *result = hr;
347 return hr;
348}
349
352{
353 void *buffer;
354 HRESULT hr;
355 DWORD size;
356
357 TRACE("module %p, resource %s, pump %p, info %p, result %p.\n",
359
360 if (pump)
361 {
362 ID3DX10DataProcessor *processor;
363 ID3DX10DataLoader *loader;
364
366 return hr;
368 {
370 return hr;
371 }
372 if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL))))
373 {
376 }
377 return hr;
378 }
379
381 return hr;
383 if (result)
384 *result = hr;
385 return hr;
386}
387
390{
391 void *buffer;
392 HRESULT hr;
393 DWORD size;
394
395 TRACE("module %p, resource %s, pump %p, info %p, result %p.\n",
397
398 if (pump)
399 {
400 ID3DX10DataProcessor *processor;
401 ID3DX10DataLoader *loader;
402
404 return hr;
406 {
408 return hr;
409 }
410 if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL))))
411 {
414 }
415 return hr;
416 }
417
419 return hr;
421 if (result)
422 *result = hr;
423 return hr;
424}
425
427{
430 IWICDdsDecoder *dds_decoder = NULL;
432 WICDdsParameters dds_params;
434 unsigned int frame_count;
435 GUID container_format;
436 HRESULT hr;
437
438 WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory);
439 IWICImagingFactory_CreateStream(factory, &stream);
440 hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size);
441 if (FAILED(hr))
442 {
443 WARN("Failed to initialize stream.\n");
444 goto end;
445 }
446 hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder);
447 if (FAILED(hr))
448 goto end;
449
450 hr = IWICBitmapDecoder_GetContainerFormat(decoder, &container_format);
451 if (FAILED(hr))
452 goto end;
453 img_info->ImageFileFormat = wic_container_guid_to_file_format(&container_format);
455 {
456 hr = E_FAIL;
457 WARN("Unsupported image file format %s.\n", debugstr_guid(&container_format));
458 goto end;
459 }
460
461 hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
462 if (FAILED(hr) || !frame_count)
463 goto end;
464 hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame);
465 if (FAILED(hr))
466 goto end;
467 hr = IWICBitmapFrameDecode_GetSize(frame, &img_info->Width, &img_info->Height);
468 if (FAILED(hr))
469 goto end;
470
471 if (img_info->ImageFileFormat == D3DX10_IFF_DDS)
472 {
473 hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
474 if (FAILED(hr))
475 goto end;
476 hr = IWICDdsDecoder_GetParameters(dds_decoder, &dds_params);
477 if (FAILED(hr))
478 goto end;
479 img_info->ArraySize = dds_params.ArraySize;
480 img_info->Depth = dds_params.Depth;
481 img_info->MipLevels = dds_params.MipLevels;
483 img_info->Format = get_d3dx10_dds_format(dds_params.DxgiFormat);
484 img_info->MiscFlags = 0;
485 if (dds_params.Dimension == WICDdsTextureCube)
486 {
488 img_info->ArraySize *= 6;
489 }
490 }
491 else
492 {
493 img_info->ArraySize = 1;
494 img_info->Depth = 1;
495 img_info->MipLevels = 1;
498 img_info->MiscFlags = 0;
499 }
500
501end:
502 if (dds_decoder)
503 IWICDdsDecoder_Release(dds_decoder);
504 if (frame)
505 IWICBitmapFrameDecode_Release(frame);
506 if (decoder)
507 IWICBitmapDecoder_Release(decoder);
508 if (stream)
509 IWICStream_Release(stream);
510 if (factory)
511 IWICImagingFactory_Release(factory);
512
513 if (hr != S_OK)
514 {
515 WARN("Invalid or unsupported image file.\n");
516 return E_FAIL;
517 }
518 return S_OK;
519}
520
521HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX10ThreadPump *pump,
522 D3DX10_IMAGE_INFO *img_info, HRESULT *result)
523{
524 HRESULT hr;
525
526 TRACE("src_data %p, src_data_size %Iu, pump %p, img_info %p, hresult %p.\n",
527 src_data, src_data_size, pump, img_info, result);
528
529 if (!src_data)
530 return E_FAIL;
531
532 if (pump)
533 {
534 ID3DX10DataProcessor *processor;
535 ID3DX10DataLoader *loader;
536
537 if (FAILED((hr = D3DX10CreateAsyncMemoryLoader(src_data, src_data_size, &loader))))
538 return hr;
539 if (FAILED((hr = D3DX10CreateAsyncTextureInfoProcessor(img_info, &processor))))
540 {
542 return hr;
543 }
544 if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, result, NULL))))
545 {
548 }
549 return hr;
550 }
551
552 hr = get_image_info(src_data, src_data_size, img_info);
553 if (result)
554 *result = hr;
555 return hr;
556}
557
560{
562 D3DX10_IMAGE_LOAD_INFO load_info_copy;
563 HRESULT hr;
564
565 init_load_info(load_info, &load_info_copy);
566
567 if (FAILED((hr = load_texture_data(data, size, &load_info_copy, &resource_data))))
568 return hr;
569 hr = create_d3d_texture(device, &load_info_copy, resource_data, texture);
571 return hr;
572}
573
575 D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
576{
577 WCHAR *buffer;
578 int str_len;
579 HRESULT hr;
580
581 TRACE("device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.\n",
582 device, debugstr_a(src_file), load_info, pump, texture, hresult);
583
584 if (!device)
585 return E_INVALIDARG;
586 if (!src_file)
587 return E_FAIL;
588
589 if (!(str_len = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0)))
591
592 if (!(buffer = malloc(str_len * sizeof(*buffer))))
593 return E_OUTOFMEMORY;
594
595 MultiByteToWideChar(CP_ACP, 0, src_file, -1, buffer, str_len);
596 hr = D3DX10CreateTextureFromFileW(device, buffer, load_info, pump, texture, hresult);
597
598 free(buffer);
599
600 return hr;
601}
602
604 D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
605{
606 void *buffer = NULL;
607 DWORD size = 0;
608 HRESULT hr;
609
610 TRACE("device %p, src_file %s, load_info %p, pump %p, texture %p, hresult %p.\n",
611 device, debugstr_w(src_file), load_info, pump, texture, hresult);
612
613 if (!device)
614 return E_INVALIDARG;
615 if (!src_file)
616 return E_FAIL;
617
618 if (pump)
619 {
620 ID3DX10DataProcessor *processor;
621 ID3DX10DataLoader *loader;
622
623 if (FAILED((hr = D3DX10CreateAsyncFileLoaderW(src_file, &loader))))
624 return hr;
625 if (FAILED((hr = D3DX10CreateAsyncTextureProcessor(device, load_info, &processor))))
626 {
628 return hr;
629 }
630 if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture))))
631 {
634 }
635 return hr;
636 }
637
638 if (SUCCEEDED((hr = load_file(src_file, &buffer, &size))))
639 {
640 hr = create_texture(device, buffer, size, load_info, texture);
641 free(buffer);
642 }
643 if (hresult)
644 *hresult = hr;
645 return hr;
646}
647
649 D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
650{
651 void *buffer;
652 DWORD size;
653 HRESULT hr;
654
655 TRACE("device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.\n",
656 device, module, debugstr_a(resource), load_info, pump, texture, hresult);
657
658 if (!device)
659 return E_INVALIDARG;
660
661 if (pump)
662 {
663 ID3DX10DataProcessor *processor;
664 ID3DX10DataLoader *loader;
665
667 return hr;
668 if (FAILED((hr = D3DX10CreateAsyncTextureProcessor(device, load_info, &processor))))
669 {
671 return hr;
672 }
673 if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture))))
674 {
677 }
678 return hr;
679 }
680
682 return hr;
683 hr = create_texture(device, buffer, size, load_info, texture);
684 if (hresult)
685 *hresult = hr;
686 return hr;
687}
688
690 D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
691{
692 void *buffer;
693 DWORD size;
694 HRESULT hr;
695
696 TRACE("device %p, module %p, resource %s, load_info %p, pump %p, texture %p, hresult %p.\n",
697 device, module, debugstr_w(resource), load_info, pump, texture, hresult);
698
699 if (!device)
700 return E_INVALIDARG;
701
702 if (pump)
703 {
704 ID3DX10DataProcessor *processor;
705 ID3DX10DataLoader *loader;
706
708 return hr;
709 if (FAILED((hr = D3DX10CreateAsyncTextureProcessor(device, load_info, &processor))))
710 {
712 return hr;
713 }
714 if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture))))
715 {
718 }
719 return hr;
720 }
721
723 return hr;
724 hr = create_texture(device, buffer, size, load_info, texture);
725 if (hresult)
726 *hresult = hr;
727 return hr;
728}
729
731{
732 if (load_info)
733 {
734 *out = *load_info;
735 return;
736 }
737
738 out->Width = D3DX10_DEFAULT;
739 out->Height = D3DX10_DEFAULT;
740 out->Depth = D3DX10_DEFAULT;
741 out->FirstMipLevel = D3DX10_DEFAULT;
742 out->MipLevels = D3DX10_DEFAULT;
743 out->Usage = D3DX10_DEFAULT;
744 out->BindFlags = D3DX10_DEFAULT;
745 out->CpuAccessFlags = D3DX10_DEFAULT;
746 out->MiscFlags = D3DX10_DEFAULT;
747 out->Format = D3DX10_DEFAULT;
748 out->Filter = D3DX10_DEFAULT;
749 out->MipFilter = D3DX10_DEFAULT;
750 out->pSrcInfo = NULL;
751}
752
754 WICDdsFormatInfo *format_info, unsigned int *stride, unsigned int *frame_size)
755{
756 unsigned int width, height;
757 HRESULT hr;
758
759 if (FAILED(hr = IWICDdsFrameDecode_GetFormatInfo(frame, format_info)))
760 return hr;
761 if (FAILED(hr = IWICDdsFrameDecode_GetSizeInBlocks(frame, &width, &height)))
762 return hr;
763
764 if (img_info->Format == format_info->DxgiFormat)
765 {
766 *stride = width * format_info->BytesPerBlock;
767 *frame_size = *stride * height;
768 }
769 else
770 {
771 width *= format_info->BlockWidth;
772 height *= format_info->BlockHeight;
773 *stride = (width * get_bpp_from_format(img_info->Format) + 7) / 8;
774 *frame_size = *stride * height;
775 }
776 return S_OK;
777}
778
780 const GUID *dst_format, unsigned int stride, unsigned int frame_size, BYTE *buffer)
781{
782 IWICFormatConverter *converter;
783 BOOL can_convert;
784 GUID src_format;
785 HRESULT hr;
786
787 if (FAILED(hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &src_format)))
788 return hr;
789
790 if (IsEqualGUID(&src_format, dst_format))
791 {
792 if (FAILED(hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, stride, frame_size, buffer)))
793 return hr;
794 return S_OK;
795 }
796
797 if (FAILED(hr = IWICImagingFactory_CreateFormatConverter(factory, &converter)))
798 return hr;
799 if (FAILED(hr = IWICFormatConverter_CanConvert(converter, &src_format, dst_format, &can_convert)))
800 {
801 IWICFormatConverter_Release(converter);
802 return hr;
803 }
804 if (!can_convert)
805 {
806 WARN("Format converting %s to %s is not supported by WIC.\n",
807 debugstr_guid(&src_format), debugstr_guid(dst_format));
808 IWICFormatConverter_Release(converter);
809 return E_NOTIMPL;
810 }
811 if (FAILED(hr = IWICFormatConverter_Initialize(converter, (IWICBitmapSource *)frame, dst_format,
813 {
814 IWICFormatConverter_Release(converter);
815 return hr;
816 }
817 hr = IWICFormatConverter_CopyPixels(converter, NULL, stride, frame_size, buffer);
818 IWICFormatConverter_Release(converter);
819 return hr;
820}
821
824{
825 unsigned int stride, frame_size, i, j;
826 IWICDdsFrameDecode *dds_frame = NULL;
829 IWICDdsDecoder *dds_decoder = NULL;
831 BYTE *res_data = NULL, *buffer;
832 D3DX10_IMAGE_INFO img_info;
834 const GUID *dst_format;
835 HRESULT hr;
836
837 if (load_info->Width != D3DX10_DEFAULT)
838 FIXME("load_info->Width is ignored.\n");
839 if (load_info->Height != D3DX10_DEFAULT)
840 FIXME("load_info->Height is ignored.\n");
841 if (load_info->Depth != D3DX10_DEFAULT)
842 FIXME("load_info->Depth is ignored.\n");
843 if (load_info->FirstMipLevel != D3DX10_DEFAULT)
844 FIXME("load_info->FirstMipLevel is ignored.\n");
845 if (load_info->MipLevels != D3DX10_DEFAULT)
846 FIXME("load_info->MipLevels is ignored.\n");
847 if (load_info->Usage != D3DX10_DEFAULT)
848 FIXME("load_info->Usage is ignored.\n");
849 if (load_info->BindFlags != D3DX10_DEFAULT)
850 FIXME("load_info->BindFlags is ignored.\n");
851 if (load_info->CpuAccessFlags != D3DX10_DEFAULT)
852 FIXME("load_info->CpuAccessFlags is ignored.\n");
853 if (load_info->MiscFlags != D3DX10_DEFAULT)
854 FIXME("load_info->MiscFlags is ignored.\n");
855 if (load_info->Format != D3DX10_DEFAULT)
856 FIXME("load_info->Format is ignored.\n");
857 if (load_info->Filter != D3DX10_DEFAULT)
858 FIXME("load_info->Filter is ignored.\n");
859 if (load_info->MipFilter != D3DX10_DEFAULT)
860 FIXME("load_info->MipFilter is ignored.\n");
861 if (load_info->pSrcInfo)
862 FIXME("load_info->pSrcInfo is ignored.\n");
863
865 return E_FAIL;
866 if ((!(img_info.MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE) || img_info.ArraySize != 6)
867 && img_info.ArraySize != 1)
868 {
869 FIXME("img_info.ArraySize = %u not supported.\n", img_info.ArraySize);
870 return E_NOTIMPL;
871 }
872
873
874 if (FAILED(hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory)))
875 goto end;
876 if (FAILED(hr = IWICImagingFactory_CreateStream(factory, &stream)))
877 goto end;
878 if (FAILED(hr = IWICStream_InitializeFromMemory(stream, (BYTE *)data, size)))
879 goto end;
880 if (FAILED(hr = IWICImagingFactory_CreateDecoderFromStream(factory, (IStream *)stream, NULL, 0, &decoder)))
881 goto end;
882
883 if (img_info.ImageFileFormat == D3DX10_IFF_DDS)
884 {
886 size_t size = 0;
887
888 if (FAILED(hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder)))
889 goto end;
890
891 for (i = 0; i < img_info.ArraySize; ++i)
892 {
893 for (j = 0; j < img_info.MipLevels; ++j)
894 {
895 if (FAILED(hr = IWICDdsDecoder_GetFrame(dds_decoder, i, j, 0, &frame)))
896 goto end;
897 if (FAILED(hr = IWICBitmapFrameDecode_QueryInterface(frame,
898 &IID_IWICDdsFrameDecode, (void **)&dds_frame)))
899 goto end;
900 if (FAILED(hr = dds_get_frame_info(dds_frame, &img_info, &format_info, &stride, &frame_size)))
901 goto end;
902
903 if (!i && !j)
904 {
905 img_info.Width = (img_info.Width + format_info.BlockWidth - 1) & ~(format_info.BlockWidth - 1);
906 img_info.Height = (img_info.Height + format_info.BlockHeight - 1) & ~(format_info.BlockHeight - 1);
907 }
908
909 size += sizeof(**resource_data) + frame_size;
910
911 IWICDdsFrameDecode_Release(dds_frame);
912 dds_frame = NULL;
913 IWICBitmapFrameDecode_Release(frame);
914 frame = NULL;
915 }
916 }
917
918 if (!(res_data = malloc(size)))
919 {
920 hr = E_FAIL;
921 goto end;
922 }
924
925 size = 0;
926 for (i = 0; i < img_info.ArraySize; ++i)
927 {
928 for (j = 0; j < img_info.MipLevels; ++j)
929 {
930 if (FAILED(hr = IWICDdsDecoder_GetFrame(dds_decoder, i, j, 0, &frame)))
931 goto end;
932 if (FAILED(hr = IWICBitmapFrameDecode_QueryInterface(frame,
933 &IID_IWICDdsFrameDecode, (void **)&dds_frame)))
934 goto end;
935 if (FAILED(hr = dds_get_frame_info(dds_frame, &img_info, &format_info, &stride, &frame_size)))
936 goto end;
937
938 buffer = res_data + sizeof(**resource_data) * img_info.ArraySize * img_info.MipLevels + size;
939 size += frame_size;
940
941 if (img_info.Format == format_info.DxgiFormat)
942 {
943 if (FAILED(hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, stride, frame_size, buffer)))
944 goto end;
945 }
946 else
947 {
948 if (!(dst_format = dxgi_format_to_wic_guid(img_info.Format)))
949 {
950 hr = E_FAIL;
951 FIXME("Unsupported DXGI format %#x.\n", img_info.Format);
952 goto end;
953 }
954 if (FAILED(hr = convert_image(factory, frame, dst_format, stride, frame_size, buffer)))
955 goto end;
956 }
957
958 IWICDdsFrameDecode_Release(dds_frame);
959 dds_frame = NULL;
960 IWICBitmapFrameDecode_Release(frame);
961 frame = NULL;
962
963 (*resource_data)[i * img_info.MipLevels + j].pSysMem = buffer;
964 (*resource_data)[i * img_info.MipLevels + j].SysMemPitch = stride;
965 (*resource_data)[i * img_info.MipLevels + j].SysMemSlicePitch = frame_size;
966 }
967 }
968 }
969 else
970 {
971 if (FAILED(hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame)))
972 goto end;
973
974 stride = (img_info.Width * get_bpp_from_format(img_info.Format) + 7) / 8;
975 frame_size = stride * img_info.Height;
976
977 if (!(res_data = malloc(sizeof(**resource_data) + frame_size)))
978 {
979 hr = E_FAIL;
980 goto end;
981 }
982 buffer = res_data + sizeof(**resource_data);
983
984 if (!(dst_format = dxgi_format_to_wic_guid(img_info.Format)))
985 {
986 hr = E_FAIL;
987 FIXME("Unsupported DXGI format %#x.\n", img_info.Format);
988 goto end;
989 }
990 if (FAILED(hr = convert_image(factory, frame, dst_format, stride, frame_size, buffer)))
991 goto end;
992
994 (*resource_data)->pSysMem = buffer;
995 (*resource_data)->SysMemPitch = stride;
996 (*resource_data)->SysMemSlicePitch = frame_size;
997 }
998
999 load_info->Width = img_info.Width;
1000 load_info->Height = img_info.Height;
1001 load_info->MipLevels = img_info.MipLevels;
1002 load_info->Format = img_info.Format;
1003 load_info->Usage = D3D10_USAGE_DEFAULT;
1005 load_info->MiscFlags = img_info.MiscFlags;
1006
1007 res_data = NULL;
1008 hr = S_OK;
1009
1010end:
1011 if (dds_decoder)
1012 IWICDdsDecoder_Release(dds_decoder);
1013 if (dds_frame)
1014 IWICDdsFrameDecode_Release(dds_frame);
1015 free(res_data);
1016 if (frame)
1017 IWICBitmapFrameDecode_Release(frame);
1018 if (decoder)
1019 IWICBitmapDecoder_Release(decoder);
1020 if (stream)
1021 IWICStream_Release(stream);
1022 if (factory)
1023 IWICImagingFactory_Release(factory);
1024 return hr;
1025}
1026
1029{
1030 D3D10_TEXTURE2D_DESC texture_2d_desc;
1031 ID3D10Texture2D *texture_2d;
1032 HRESULT hr;
1033
1034 memset(&texture_2d_desc, 0, sizeof(texture_2d_desc));
1035 texture_2d_desc.Width = load_info->Width;
1036 texture_2d_desc.Height = load_info->Height;
1037 texture_2d_desc.MipLevels = load_info->MipLevels;
1038 texture_2d_desc.ArraySize = load_info->MiscFlags & D3D10_RESOURCE_MISC_TEXTURECUBE ? 6 : 1;
1039 texture_2d_desc.Format = load_info->Format;
1040 texture_2d_desc.SampleDesc.Count = 1;
1041 texture_2d_desc.Usage = load_info->Usage;
1042 texture_2d_desc.BindFlags = load_info->BindFlags;
1043 texture_2d_desc.MiscFlags = load_info->MiscFlags;
1044
1045 if (FAILED(hr = ID3D10Device_CreateTexture2D(device, &texture_2d_desc, resource_data, &texture_2d)))
1046 return hr;
1047
1048 *texture = (ID3D10Resource *)texture_2d;
1049 return S_OK;
1050}
1051
1053 D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
1054{
1055 HRESULT hr;
1056
1057 TRACE("device %p, src_data %p, src_data_size %Iu, load_info %p, pump %p, texture %p, hresult %p.\n",
1058 device, src_data, src_data_size, load_info, pump, texture, hresult);
1059
1060 if (!device)
1061 return E_INVALIDARG;
1062 if (!src_data)
1063 return E_FAIL;
1064
1065 if (pump)
1066 {
1067 ID3DX10DataProcessor *processor;
1068 ID3DX10DataLoader *loader;
1069
1070 if (FAILED((hr = D3DX10CreateAsyncMemoryLoader(src_data, src_data_size, &loader))))
1071 return hr;
1072 if (FAILED((hr = D3DX10CreateAsyncTextureProcessor(device, load_info, &processor))))
1073 {
1075 return hr;
1076 }
1077 if (FAILED((hr = ID3DX10ThreadPump_AddWorkItem(pump, loader, processor, hresult, (void **)texture))))
1078 {
1081 }
1082 return hr;
1083 }
1084
1085 hr = create_texture(device, src_data, src_data_size, load_info, texture);
1086 if (hresult)
1087 *hresult = hr;
1088 return hr;
1089}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
@ D3D10_USAGE_DEFAULT
Definition: d3d10.idl:461
@ D3D10_RESOURCE_MISC_TEXTURECUBE
Definition: d3d10.idl:890
D3D10_RESOURCE_DIMENSION
Definition: d3d10.idl:452
@ D3D10_RESOURCE_DIMENSION_TEXTURE1D
Definition: d3d10.idl:455
@ D3D10_RESOURCE_DIMENSION_UNKNOWN
Definition: d3d10.idl:453
@ D3D10_RESOURCE_DIMENSION_TEXTURE3D
Definition: d3d10.idl:457
@ D3D10_RESOURCE_DIMENSION_TEXTURE2D
Definition: d3d10.idl:456
@ D3D10_BIND_SHADER_RESOURCE
Definition: d3d10.idl:471
#define D3DX10_DEFAULT
Definition: d3dx10.h:25
#define ID3DX10ThreadPump_AddWorkItem(p, a, b, c, d)
Definition: d3dx10core.h:141
#define ID3DX10DataLoader_Destroy(p)
Definition: d3dx10core.h:88
#define ID3DX10DataProcessor_Destroy(p)
Definition: d3dx10core.h:109
D3DX10_IMAGE_FILE_FORMAT
Definition: d3dx10tex.h:46
@ D3DX10_IFF_BMP
Definition: d3dx10tex.h:47
@ D3DX10_IFF_PNG
Definition: d3dx10tex.h:49
@ D3DX10_IFF_TIFF
Definition: d3dx10tex.h:51
@ D3DX10_IFF_JPG
Definition: d3dx10tex.h:48
@ D3DX10_IFF_DDS
Definition: d3dx10tex.h:50
@ D3DX10_IFF_GIF
Definition: d3dx10tex.h:52
@ D3DX10_IFF_WMP
Definition: d3dx10tex.h:53
@ D3DX10_IFF_FORCE_DWORD
Definition: d3dx10tex.h:54
format_info
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
HRESULT WINAPI D3DX10CreateAsyncTextureProcessor(ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10DataProcessor **processor)
Definition: async.c:580
HRESULT load_resourceA(HMODULE module, const char *resource, void **data, DWORD *size)
Definition: async.c:213
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA(HMODULE module, const char *resource, ID3DX10DataLoader **loader)
Definition: async.c:496
HRESULT WINAPI D3DX10CreateAsyncFileLoaderW(const WCHAR *filename, ID3DX10DataLoader **loader)
Definition: async.c:467
HRESULT WINAPI D3DX10CreateAsyncMemoryLoader(const void *data, SIZE_T data_size, ID3DX10DataLoader **loader)
Definition: async.c:423
HRESULT load_file(const WCHAR *path, void **data, DWORD *size)
Definition: async.c:91
HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor(D3DX10_IMAGE_INFO *info, ID3DX10DataProcessor **processor)
Definition: async.c:560
HRESULT load_resourceW(HMODULE module, const WCHAR *resource, void **data, DWORD *size)
Definition: async.c:223
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW(HMODULE module, const WCHAR *resource, ID3DX10DataLoader **loader)
Definition: async.c:528
#define NULL
Definition: types.h:112
static HRESULT convert_image(IWICImagingFactory *factory, IWICBitmapFrameDecode *frame, const GUID *dst_format, unsigned int stride, unsigned int frame_size, BYTE *buffer)
Definition: texture.c:779
static HRESULT create_texture(ID3D10Device *device, const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, ID3D10Resource **texture)
Definition: texture.c:558
HRESULT load_texture_data(const void *data, SIZE_T size, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA **resource_data)
Definition: texture.c:822
HRESULT WINAPI D3DX10CreateTextureFromResourceA(ID3D10Device *device, HMODULE module, const char *resource, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
Definition: texture.c:648
const GUID * wic_guid
Definition: texture.c:50
HRESULT WINAPI D3DX10GetImageInfoFromFileA(const char *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, HRESULT *result)
Definition: texture.c:279
DXGI_FORMAT dxgi_format
Definition: texture.c:51
static const GUID * dxgi_format_to_wic_guid(DXGI_FORMAT format)
Definition: texture.c:86
HRESULT WINAPI D3DX10CreateTextureFromFileA(ID3D10Device *device, const char *src_file, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
Definition: texture.c:574
HRESULT create_d3d_texture(ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA *resource_data, ID3D10Resource **texture)
Definition: texture.c:1027
HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_info)
Definition: texture.c:426
const GUID * wic_container_guid
Definition: texture.c:34
static D3DX10_IMAGE_FILE_FORMAT wic_container_guid_to_file_format(GUID *container_format)
Definition: texture.c:74
HRESULT WINAPI D3DX10CreateTextureFromFileW(ID3D10Device *device, const WCHAR *src_file, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
Definition: texture.c:603
void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_INFO *out)
Definition: texture.c:730
HRESULT WINAPI D3DX10GetImageInfoFromResourceA(HMODULE module, const char *resource, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, HRESULT *result)
Definition: texture.c:350
HRESULT WINAPI D3DX10CreateTextureFromMemory(ID3D10Device *device, const void *src_data, SIZE_T src_data_size, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
Definition: texture.c:1052
HRESULT WINAPI D3DX10CreateTextureFromResourceW(ID3D10Device *device, HMODULE module, const WCHAR *resource, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10ThreadPump *pump, ID3D10Resource **texture, HRESULT *hresult)
Definition: texture.c:689
static unsigned int get_bpp_from_format(DXGI_FORMAT format)
Definition: texture.c:115
static HRESULT dds_get_frame_info(IWICDdsFrameDecode *frame, const D3DX10_IMAGE_INFO *img_info, WICDdsFormatInfo *format_info, unsigned int *stride, unsigned int *frame_size)
Definition: texture.c:753
static const struct @278 wic_pixel_formats[]
static const struct @277 file_formats[]
HRESULT WINAPI D3DX10GetImageInfoFromMemory(const void *src_data, SIZE_T src_data_size, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *img_info, HRESULT *result)
Definition: texture.c:521
HRESULT WINAPI D3DX10GetImageInfoFromFileW(const WCHAR *src_file, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, HRESULT *result)
Definition: texture.c:307
HRESULT WINAPI D3DX10GetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, ID3DX10ThreadPump *pump, D3DX10_IMAGE_INFO *info, HRESULT *result)
Definition: texture.c:388
HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT sdk_version, IWICImagingFactory **imaging_factory)
Definition: proxy.c:649
static D3D10_RESOURCE_DIMENSION wic_dimension_to_d3dx10_dimension(WICDdsDimension wic_dimension)
Definition: texture.c:99
static DXGI_FORMAT get_d3dx10_dds_format(DXGI_FORMAT format)
Definition: texture.c:249
D3DX10_IMAGE_FILE_FORMAT d3dx_file_format
Definition: texture.c:35
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
DXGI_FORMAT
Definition: dxgiformat.idl:22
@ DXGI_FORMAT_R16_UINT
Definition: dxgiformat.idl:80
@ DXGI_FORMAT_B8G8R8A8_UNORM
Definition: dxgiformat.idl:110
@ DXGI_FORMAT_R8_TYPELESS
Definition: dxgiformat.idl:83
@ DXGI_FORMAT_Y410
Definition: dxgiformat.idl:124
@ DXGI_FORMAT_BC3_UNORM_SRGB
Definition: dxgiformat.idl:101
@ DXGI_FORMAT_R8G8_B8G8_UNORM
Definition: dxgiformat.idl:91
@ DXGI_FORMAT_R32G32B32_TYPELESS
Definition: dxgiformat.idl:28
@ DXGI_FORMAT_BC3_TYPELESS
Definition: dxgiformat.idl:99
@ DXGI_FORMAT_R16G16_SNORM
Definition: dxgiformat.idl:60
@ DXGI_FORMAT_D32_FLOAT_S8X24_UINT
Definition: dxgiformat.idl:43
@ DXGI_FORMAT_R32G32B32A32_SINT
Definition: dxgiformat.idl:27
@ DXGI_FORMAT_BC5_UNORM
Definition: dxgiformat.idl:106
@ DXGI_FORMAT_Y216
Definition: dxgiformat.idl:132
@ DXGI_FORMAT_BC1_UNORM
Definition: dxgiformat.idl:94
@ DXGI_FORMAT_R8G8_UINT
Definition: dxgiformat.idl:73
@ DXGI_FORMAT_420_OPAQUE
Definition: dxgiformat.idl:129
@ DXGI_FORMAT_R32G32B32A32_UINT
Definition: dxgiformat.idl:26
@ DXGI_FORMAT_R16G16B16A16_SNORM
Definition: dxgiformat.idl:36
@ DXGI_FORMAT_R32_FLOAT
Definition: dxgiformat.idl:64
@ DXGI_FORMAT_R16G16B16A16_UNORM
Definition: dxgiformat.idl:34
@ DXGI_FORMAT_R32_SINT
Definition: dxgiformat.idl:66
@ DXGI_FORMAT_R8G8_UNORM
Definition: dxgiformat.idl:72
@ DXGI_FORMAT_R16G16_UNORM
Definition: dxgiformat.idl:58
@ DXGI_FORMAT_BC1_UNORM_SRGB
Definition: dxgiformat.idl:95
@ DXGI_FORMAT_A8P8
Definition: dxgiformat.idl:137
@ DXGI_FORMAT_R16G16_SINT
Definition: dxgiformat.idl:61
@ DXGI_FORMAT_R24_UNORM_X8_TYPELESS
Definition: dxgiformat.idl:69
@ DXGI_FORMAT_R8G8B8A8_TYPELESS
Definition: dxgiformat.idl:50
@ DXGI_FORMAT_BC2_TYPELESS
Definition: dxgiformat.idl:96
@ DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS
Definition: dxgiformat.idl:44
@ DXGI_FORMAT_R32G32B32_FLOAT
Definition: dxgiformat.idl:29
@ DXGI_FORMAT_R32G32B32_SINT
Definition: dxgiformat.idl:31
@ DXGI_FORMAT_R32G32B32A32_TYPELESS
Definition: dxgiformat.idl:24
@ DXGI_FORMAT_B8G8R8A8_UNORM_SRGB
Definition: dxgiformat.idl:114
@ DXGI_FORMAT_B8G8R8X8_TYPELESS
Definition: dxgiformat.idl:115
@ DXGI_FORMAT_B8G8R8A8_TYPELESS
Definition: dxgiformat.idl:113
@ DXGI_FORMAT_UNKNOWN
Definition: dxgiformat.idl:23
@ DXGI_FORMAT_X24_TYPELESS_G8_UINT
Definition: dxgiformat.idl:70
@ DXGI_FORMAT_R16_SINT
Definition: dxgiformat.idl:82
@ DXGI_FORMAT_R1_UNORM
Definition: dxgiformat.idl:89
@ DXGI_FORMAT_R16G16B16A16_UINT
Definition: dxgiformat.idl:35
@ DXGI_FORMAT_R16_UNORM
Definition: dxgiformat.idl:79
@ DXGI_FORMAT_R8G8B8A8_SINT
Definition: dxgiformat.idl:55
@ DXGI_FORMAT_D24_UNORM_S8_UINT
Definition: dxgiformat.idl:68
@ DXGI_FORMAT_R8G8B8A8_SNORM
Definition: dxgiformat.idl:54
@ DXGI_FORMAT_A8_UNORM
Definition: dxgiformat.idl:88
@ DXGI_FORMAT_R8G8B8A8_UINT
Definition: dxgiformat.idl:53
@ DXGI_FORMAT_R10G10B10A2_TYPELESS
Definition: dxgiformat.idl:46
@ DXGI_FORMAT_R32G32_FLOAT
Definition: dxgiformat.idl:39
@ DXGI_FORMAT_BC6H_UF16
Definition: dxgiformat.idl:118
@ DXGI_FORMAT_BC6H_SF16
Definition: dxgiformat.idl:119
@ DXGI_FORMAT_R10G10B10A2_UNORM
Definition: dxgiformat.idl:47
@ DXGI_FORMAT_R8_SNORM
Definition: dxgiformat.idl:86
@ DXGI_FORMAT_R9G9B9E5_SHAREDEXP
Definition: dxgiformat.idl:90
@ DXGI_FORMAT_P010
Definition: dxgiformat.idl:127
@ DXGI_FORMAT_R16G16B16A16_TYPELESS
Definition: dxgiformat.idl:32
@ DXGI_FORMAT_R16G16B16A16_FLOAT
Definition: dxgiformat.idl:33
@ DXGI_FORMAT_BC7_TYPELESS
Definition: dxgiformat.idl:120
@ DXGI_FORMAT_P016
Definition: dxgiformat.idl:128
@ DXGI_FORMAT_R32_TYPELESS
Definition: dxgiformat.idl:62
@ DXGI_FORMAT_R8_UNORM
Definition: dxgiformat.idl:84
@ DXGI_FORMAT_R32G32_UINT
Definition: dxgiformat.idl:40
@ DXGI_FORMAT_R11G11B10_FLOAT
Definition: dxgiformat.idl:49
@ DXGI_FORMAT_R8G8B8A8_UNORM
Definition: dxgiformat.idl:51
@ DXGI_FORMAT_AYUV
Definition: dxgiformat.idl:123
@ DXGI_FORMAT_Y416
Definition: dxgiformat.idl:125
@ DXGI_FORMAT_G8R8_G8B8_UNORM
Definition: dxgiformat.idl:92
@ DXGI_FORMAT_YUY2
Definition: dxgiformat.idl:130
@ DXGI_FORMAT_D16_UNORM
Definition: dxgiformat.idl:78
@ DXGI_FORMAT_R16_FLOAT
Definition: dxgiformat.idl:77
@ DXGI_FORMAT_Y210
Definition: dxgiformat.idl:131
@ DXGI_FORMAT_R10G10B10A2_UINT
Definition: dxgiformat.idl:48
@ DXGI_FORMAT_BC6H_TYPELESS
Definition: dxgiformat.idl:117
@ DXGI_FORMAT_BC7_UNORM
Definition: dxgiformat.idl:121
@ DXGI_FORMAT_BC5_TYPELESS
Definition: dxgiformat.idl:105
@ DXGI_FORMAT_R32G32_SINT
Definition: dxgiformat.idl:41
@ DXGI_FORMAT_BC2_UNORM_SRGB
Definition: dxgiformat.idl:98
@ DXGI_FORMAT_R16_SNORM
Definition: dxgiformat.idl:81
@ DXGI_FORMAT_R8_SINT
Definition: dxgiformat.idl:87
@ DXGI_FORMAT_BC5_SNORM
Definition: dxgiformat.idl:107
@ DXGI_FORMAT_R32_UINT
Definition: dxgiformat.idl:65
@ DXGI_FORMAT_BC4_TYPELESS
Definition: dxgiformat.idl:102
@ DXGI_FORMAT_R32G32B32A32_FLOAT
Definition: dxgiformat.idl:25
@ DXGI_FORMAT_R24G8_TYPELESS
Definition: dxgiformat.idl:67
@ DXGI_FORMAT_IA44
Definition: dxgiformat.idl:135
@ DXGI_FORMAT_NV11
Definition: dxgiformat.idl:133
@ DXGI_FORMAT_R8G8_SINT
Definition: dxgiformat.idl:75
@ DXGI_FORMAT_R16_TYPELESS
Definition: dxgiformat.idl:76
@ DXGI_FORMAT_BC3_UNORM
Definition: dxgiformat.idl:100
@ DXGI_FORMAT_R32G32B32_UINT
Definition: dxgiformat.idl:30
@ DXGI_FORMAT_R16G16_TYPELESS
Definition: dxgiformat.idl:56
@ DXGI_FORMAT_R8G8B8A8_UNORM_SRGB
Definition: dxgiformat.idl:52
@ DXGI_FORMAT_R16G16_UINT
Definition: dxgiformat.idl:59
@ DXGI_FORMAT_D32_FLOAT
Definition: dxgiformat.idl:63
@ DXGI_FORMAT_R8G8_TYPELESS
Definition: dxgiformat.idl:71
@ DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM
Definition: dxgiformat.idl:112
@ DXGI_FORMAT_R16G16B16A16_SINT
Definition: dxgiformat.idl:37
@ DXGI_FORMAT_BC1_TYPELESS
Definition: dxgiformat.idl:93
@ DXGI_FORMAT_BC7_UNORM_SRGB
Definition: dxgiformat.idl:122
@ DXGI_FORMAT_BC2_UNORM
Definition: dxgiformat.idl:97
@ DXGI_FORMAT_R32G32_TYPELESS
Definition: dxgiformat.idl:38
@ DXGI_FORMAT_R32G8X24_TYPELESS
Definition: dxgiformat.idl:42
@ DXGI_FORMAT_B4G4R4A4_UNORM
Definition: dxgiformat.idl:138
@ DXGI_FORMAT_AI44
Definition: dxgiformat.idl:134
@ DXGI_FORMAT_R16G16_FLOAT
Definition: dxgiformat.idl:57
@ DXGI_FORMAT_B5G6R5_UNORM
Definition: dxgiformat.idl:108
@ DXGI_FORMAT_BC4_UNORM
Definition: dxgiformat.idl:103
@ DXGI_FORMAT_X32_TYPELESS_G8X24_UINT
Definition: dxgiformat.idl:45
@ DXGI_FORMAT_R8G8_SNORM
Definition: dxgiformat.idl:74
@ DXGI_FORMAT_B8G8R8X8_UNORM_SRGB
Definition: dxgiformat.idl:116
@ DXGI_FORMAT_P8
Definition: dxgiformat.idl:136
@ DXGI_FORMAT_R8_UINT
Definition: dxgiformat.idl:85
@ DXGI_FORMAT_BC4_SNORM
Definition: dxgiformat.idl:104
@ DXGI_FORMAT_NV12
Definition: dxgiformat.idl:126
@ DXGI_FORMAT_B5G5R5A1_UNORM
Definition: dxgiformat.idl:109
@ DXGI_FORMAT_B8G8R8X8_UNORM
Definition: dxgiformat.idl:111
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLuint texture
Definition: glext.h:6295
GLsizei stride
Definition: glext.h:5848
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum dst
Definition: glext.h:6340
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
unsigned int UINT
Definition: sysinfo.c:13
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL UINT UINT sdk_version
Definition: hlsl_d3d11.c:29
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
static const char * dst_format
Definition: dib.c:1339
short WCHAR
Definition: pedump.c:58
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
DXGI_FORMAT Format
Definition: d3d10.idl:550
DXGI_SAMPLE_DESC SampleDesc
Definition: d3d10.idl:551
D3D10_USAGE Usage
Definition: d3d10.idl:552
D3D10_RESOURCE_DIMENSION ResourceDimension
Definition: d3dx10tex.h:66
DXGI_FORMAT Format
Definition: d3dx10tex.h:65
D3DX10_IMAGE_FILE_FORMAT ImageFileFormat
Definition: d3dx10tex.h:67
DXGI_FORMAT Format
Definition: d3dx10tex.h:81
D3DX10_IMAGE_INFO * pSrcInfo
Definition: d3dx10tex.h:84
D3D10_USAGE Usage
Definition: d3dx10tex.h:77
WICDdsDimension Dimension
Definition: wincodec.idl:353
DXGI_FORMAT DxgiFormat
Definition: wincodec.idl:352
Definition: devices.h:37
Definition: main.c:439
Definition: loader.c:72
Definition: parse.h:23
#define str_len
Definition: treelist.c:89
ULONG_PTR SIZE_T
Definition: typedefs.h:80
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
WICDdsDimension
Definition: wincodec.idl:197
@ WICDdsTexture2D
Definition: wincodec.idl:199
@ WICDdsTexture3D
Definition: wincodec.idl:200
@ WICDdsTexture1D
Definition: wincodec.idl:198
@ WICDdsTextureCube
Definition: wincodec.idl:201
@ WICBitmapDitherTypeErrorDiffusion
Definition: wincodec.idl:66
@ WICBitmapPaletteTypeCustom
Definition: wincodec.idl:92
#define WINAPI
Definition: msvc.h:6
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
unsigned char BYTE
Definition: xxhash.c:193