ReactOS 0.4.17-dev-934-g091855f
async.c File Reference
#include "d3d10_1.h"
#include "d3dx10.h"
#include "d3dcompiler.h"
#include "dxhelpers.h"
#include "winternl.h"
#include "wine/debug.h"
#include "wine/list.h"
Include dependency graph for async.c:

Go to the source code of this file.

Classes

struct  asyncdataloader
 
struct  texture_info_processor
 
struct  texture_processor
 
struct  work_item
 
struct  thread_pump
 

Macros

#define COBJMACROS
 
#define THREAD_PUMP_EXITING   UINT_MAX
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3dx)
 
static struct asyncdataloader * impl_from_ID3DX10DataLoader (ID3DX10DataLoader *iface)
 
static HRESULT WINAPI memorydataloader_Load (ID3DX10DataLoader *iface)
 
static HRESULT WINAPI memorydataloader_Decompress (ID3DX10DataLoader *iface, void **data, SIZE_T *size)
 
static HRESULT WINAPI memorydataloader_Destroy (ID3DX10DataLoader *iface)
 
HRESULT load_file (const WCHAR *path, void **data, DWORD *size)
 
static HRESULT WINAPI filedataloader_Load (ID3DX10DataLoader *iface)
 
static HRESULT WINAPI filedataloader_Decompress (ID3DX10DataLoader *iface, void **data, SIZE_T *size)
 
static HRESULT WINAPI filedataloader_Destroy (ID3DX10DataLoader *iface)
 
static HRESULT load_resource_initA (HMODULE module, const char *resource, HRSRC *rsrc)
 
static HRESULT load_resource_initW (HMODULE module, const WCHAR *resource, HRSRC *rsrc)
 
static HRESULT load_resource (HMODULE module, HRSRC rsrc, void **data, DWORD *size)
 
HRESULT load_resourceA (HMODULE module, const char *resource, void **data, DWORD *size)
 
HRESULT load_resourceW (HMODULE module, const WCHAR *resource, void **data, DWORD *size)
 
static HRESULT WINAPI resourcedataloader_Load (ID3DX10DataLoader *iface)
 
static HRESULT WINAPI resourcedataloader_Decompress (ID3DX10DataLoader *iface, void **data, SIZE_T *size)
 
static HRESULT WINAPI resourcedataloader_Destroy (ID3DX10DataLoader *iface)
 
static struct texture_info_processor * impl_from_ID3DX10DataProcessor (ID3DX10DataProcessor *iface)
 
static HRESULT WINAPI texture_info_processor_Process (ID3DX10DataProcessor *iface, void *data, SIZE_T size)
 
static HRESULT WINAPI texture_info_processor_CreateDeviceObject (ID3DX10DataProcessor *iface, void **object)
 
static HRESULT WINAPI texture_info_processor_Destroy (ID3DX10DataProcessor *iface)
 
static struct texture_processor * texture_processor_from_ID3DX10DataProcessor (ID3DX10DataProcessor *iface)
 
static HRESULT WINAPI texture_processor_Process (ID3DX10DataProcessor *iface, void *data, SIZE_T size)
 
static HRESULT WINAPI texture_processor_CreateDeviceObject (ID3DX10DataProcessor *iface, void **object)
 
static HRESULT WINAPI texture_processor_Destroy (ID3DX10DataProcessor *iface)
 
HRESULT WINAPI D3DX10CompileFromMemory (const char *data, SIZE_T data_size, const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *entry_point, const char *target, UINT sflags, UINT eflags, ID3DX10ThreadPump *pump, ID3D10Blob **shader, ID3D10Blob **error_messages, HRESULT *hresult)
 
HRESULT WINAPI D3DX10CreateEffectPoolFromFileA (const char *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, ID3DX10ThreadPump *pump, ID3D10EffectPool **effectpool, ID3D10Blob **errors, HRESULT *hresult)
 
HRESULT WINAPI D3DX10CreateEffectPoolFromFileW (const WCHAR *filename, const D3D10_SHADER_MACRO *defines, ID3D10Include *include, const char *profile, UINT hlslflags, UINT fxflags, ID3D10Device *device, ID3DX10ThreadPump *pump, ID3D10EffectPool **effectpool, ID3D10Blob **errors, HRESULT *hresult)
 
HRESULT WINAPI D3DX10CreateAsyncMemoryLoader (const void *data, SIZE_T data_size, ID3DX10DataLoader **loader)
 
HRESULT WINAPI D3DX10CreateAsyncFileLoaderA (const char *filename, ID3DX10DataLoader **loader)
 
HRESULT WINAPI D3DX10CreateAsyncFileLoaderW (const WCHAR *filename, ID3DX10DataLoader **loader)
 
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA (HMODULE module, const char *resource, ID3DX10DataLoader **loader)
 
HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW (HMODULE module, const WCHAR *resource, ID3DX10DataLoader **loader)
 
HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor (D3DX10_IMAGE_INFO *info, ID3DX10DataProcessor **processor)
 
HRESULT WINAPI D3DX10CreateAsyncTextureProcessor (ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *load_info, ID3DX10DataProcessor **processor)
 
static void work_item_free (struct work_item *work_item, BOOL cancel)
 
static struct thread_pump * impl_from_ID3DX10ThreadPump (ID3DX10ThreadPump *iface)
 
static HRESULT WINAPI thread_pump_QueryInterface (ID3DX10ThreadPump *iface, REFIID riid, void **out)
 
static ULONG WINAPI thread_pump_AddRef (ID3DX10ThreadPump *iface)
 
static ULONG WINAPI thread_pump_Release (ID3DX10ThreadPump *iface)
 
static HRESULT WINAPI thread_pump_AddWorkItem (ID3DX10ThreadPump *iface, ID3DX10DataLoader *loader, ID3DX10DataProcessor *processor, HRESULT *result, void **object)
 
static UINT WINAPI thread_pump_GetWorkItemCount (ID3DX10ThreadPump *iface)
 
static HRESULT WINAPI thread_pump_WaitForAllItems (ID3DX10ThreadPump *iface)
 
static HRESULT WINAPI thread_pump_ProcessDeviceWorkItems (ID3DX10ThreadPump *iface, UINT count)
 
static void purge_list (struct list *list, LONG *count)
 
static HRESULT WINAPI thread_pump_PurgeAllItems (ID3DX10ThreadPump *iface)
 
static HRESULT WINAPI thread_pump_GetQueueStatus (ID3DX10ThreadPump *iface, UINT *io_queue, UINT *process_queue, UINT *device_queue)
 
static DWORD WINAPI io_thread (void *arg)
 
static DWORD WINAPI proc_thread (void *arg)
 
HRESULT WINAPI D3DX10CreateThreadPump (UINT io_threads, UINT proc_threads, ID3DX10ThreadPump **pump)
 

Variables

static const ID3DX10DataLoaderVtbl memorydataloadervtbl
 
static const ID3DX10DataLoaderVtbl filedataloadervtbl
 
static const ID3DX10DataLoaderVtbl resourcedataloadervtbl
 
static ID3DX10DataProcessorVtbl texture_info_processor_vtbl
 
static ID3DX10DataProcessorVtbl texture_processor_vtbl
 
static const ID3DX10ThreadPumpVtbl thread_pump_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file async.c.

◆ THREAD_PUMP_EXITING

#define THREAD_PUMP_EXITING   UINT_MAX

Definition at line 622 of file async.c.

Function Documentation

◆ D3DX10CompileFromMemory()

HRESULT WINAPI D3DX10CompileFromMemory ( const char *  data,
SIZE_T  data_size,
const char *  filename,
const D3D10_SHADER_MACRO *  defines,
ID3D10Include *  include,
const char *  entry_point,
const char *  target,
UINT  sflags,
UINT  eflags,
ID3DX10ThreadPump *  pump,
ID3D10Blob **  shader,
ID3D10Blob **  error_messages,
HRESULT *  hresult 
)

Definition at line 381 of file async.c.

385{
386 TRACE("data %s, data_size %Iu, filename %s, defines %p, include %p, entry_point %s, target %s, "
387 "sflags %#x, eflags %#x, pump %p, shader %p, error_messages %p, hresult %p.\n",
388 debugstr_an(data, data_size), data_size, debugstr_a(filename), defines, include,
389 debugstr_a(entry_point), debugstr_a(target), sflags, eflags, pump, shader,
390 error_messages, hresult);
391
392 if (pump)
393 FIXME("Unimplemented ID3DX10ThreadPump handling.\n");
394
395 return D3DCompile(data, data_size, filename, defines, include, entry_point, target,
397}
#define FIXME(fmt,...)
Definition: precomp.h:53
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:31
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
Definition: asm.c:32
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:31
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
Definition: compiler.c:639
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint shader
Definition: glext.h:6030
const char * filename
Definition: ioapi.h:137
#define debugstr_a
Definition: kernel32.h:31
#define TRACE(s)
Definition: solgame.cpp:4
Definition: tools.h:99

◆ D3DX10CreateAsyncFileLoaderA()

HRESULT WINAPI D3DX10CreateAsyncFileLoaderA ( const char *  filename,
ID3DX10DataLoader **  loader 
)

Definition at line 445 of file async.c.

446{
447 WCHAR *filename_w;
448 HRESULT hr;
449 int len;
450
451 TRACE("filename %s, loader %p.\n", debugstr_a(filename), loader);
452
453 if (!filename || !loader)
454 return E_FAIL;
455
457 filename_w = malloc(len * sizeof(*filename_w));
458 MultiByteToWideChar(CP_ACP, 0, filename, -1, filename_w, len);
459
461
462 free(filename_w);
463
464 return hr;
465}
#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 D3DX10CreateAsyncFileLoaderW(const WCHAR *filename, ID3DX10DataLoader **loader)
Definition: async.c:467
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
short WCHAR
Definition: pedump.c:58
Definition: loader.c:72

◆ D3DX10CreateAsyncFileLoaderW()

HRESULT WINAPI D3DX10CreateAsyncFileLoaderW ( const WCHAR *  filename,
ID3DX10DataLoader **  loader 
)

Definition at line 467 of file async.c.

468{
469 struct asyncdataloader *object;
470
471 TRACE("filename %s, loader %p.\n", debugstr_w(filename), loader);
472
473 if (!filename || !loader)
474 return E_FAIL;
475
476 object = calloc(1, sizeof(*object));
477 if (!object)
478 return E_OUTOFMEMORY;
479
480 object->ID3DX10DataLoader_iface.lpVtbl = &filedataloadervtbl;
481 object->u.file.path = malloc((lstrlenW(filename) + 1) * sizeof(WCHAR));
482 if (!object->u.file.path)
483 {
484 free(object);
485 return E_OUTOFMEMORY;
486 }
487 lstrcpyW(object->u.file.path, filename);
488 object->data = NULL;
489 object->size = 0;
490
491 *loader = &object->ID3DX10DataLoader_iface;
492
493 return S_OK;
494}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const ID3DX10DataLoaderVtbl filedataloadervtbl
Definition: async.c:169
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
#define S_OK
Definition: intsafe.h:52
#define debugstr_w
Definition: kernel32.h:32
#define calloc
Definition: rosglue.h:14

Referenced by D3DX10CreateAsyncFileLoaderA(), D3DX10CreateTextureFromFileW(), and D3DX10GetImageInfoFromFileW().

◆ D3DX10CreateAsyncMemoryLoader()

HRESULT WINAPI D3DX10CreateAsyncMemoryLoader ( const void *  data,
SIZE_T  data_size,
ID3DX10DataLoader **  loader 
)

Definition at line 423 of file async.c.

424{
425 struct asyncdataloader *object;
426
427 TRACE("data %p, data_size %Iu, loader %p.\n", data, data_size, loader);
428
429 if (!data || !loader)
430 return E_FAIL;
431
432 object = calloc(1, sizeof(*object));
433 if (!object)
434 return E_OUTOFMEMORY;
435
436 object->ID3DX10DataLoader_iface.lpVtbl = &memorydataloadervtbl;
437 object->data = (void *)data;
438 object->size = data_size;
439
440 *loader = &object->ID3DX10DataLoader_iface;
441
442 return S_OK;
443}
static const ID3DX10DataLoaderVtbl memorydataloadervtbl
Definition: async.c:84

Referenced by D3DX10CreateTextureFromMemory(), and D3DX10GetImageInfoFromMemory().

◆ D3DX10CreateAsyncResourceLoaderA()

HRESULT WINAPI D3DX10CreateAsyncResourceLoaderA ( HMODULE  module,
const char *  resource,
ID3DX10DataLoader **  loader 
)

Definition at line 496 of file async.c.

497{
498 struct asyncdataloader *object;
499 HRSRC rsrc;
500 HRESULT hr;
501
502 TRACE("module %p, resource %s, loader %p.\n", module, debugstr_a(resource), loader);
503
504 if (!loader)
505 return E_FAIL;
506
507 object = calloc(1, sizeof(*object));
508 if (!object)
509 return E_OUTOFMEMORY;
510
512 {
513 free(object);
514 return hr;
515 }
516
517 object->ID3DX10DataLoader_iface.lpVtbl = &resourcedataloadervtbl;
518 object->u.resource.module = module;
519 object->u.resource.rsrc = rsrc;
520 object->data = NULL;
521 object->size = 0;
522
523 *loader = &object->ID3DX10DataLoader_iface;
524
525 return S_OK;
526}
static const ID3DX10DataLoaderVtbl resourcedataloadervtbl
Definition: async.c:272
static HRESULT load_resource_initA(HMODULE module, const char *resource, HRSRC *rsrc)
Definition: async.c:176
#define FAILED(hr)
Definition: intsafe.h:51
HRSRC rsrc
Definition: async.c:44
HMODULE module
Definition: async.c:43

Referenced by D3DX10CreateTextureFromResourceA(), and D3DX10GetImageInfoFromResourceA().

◆ D3DX10CreateAsyncResourceLoaderW()

HRESULT WINAPI D3DX10CreateAsyncResourceLoaderW ( HMODULE  module,
const WCHAR *  resource,
ID3DX10DataLoader **  loader 
)

Definition at line 528 of file async.c.

529{
530 struct asyncdataloader *object;
531 HRSRC rsrc;
532 HRESULT hr;
533
534 TRACE("module %p, resource %s, loader %p.\n", module, debugstr_w(resource), loader);
535
536 if (!loader)
537 return E_FAIL;
538
539 object = calloc(1, sizeof(*object));
540 if (!object)
541 return E_OUTOFMEMORY;
542
544 {
545 free(object);
546 return hr;
547 }
548
549 object->ID3DX10DataLoader_iface.lpVtbl = &resourcedataloadervtbl;
550 object->u.resource.module = module;
551 object->u.resource.rsrc = rsrc;
552 object->data = NULL;
553 object->size = 0;
554
555 *loader = &object->ID3DX10DataLoader_iface;
556
557 return S_OK;
558}
static HRESULT load_resource_initW(HMODULE module, const WCHAR *resource, HRSRC *rsrc)
Definition: async.c:188

Referenced by D3DX10CreateTextureFromResourceW(), and D3DX10GetImageInfoFromResourceW().

◆ D3DX10CreateAsyncTextureInfoProcessor()

HRESULT WINAPI D3DX10CreateAsyncTextureInfoProcessor ( D3DX10_IMAGE_INFO *  info,
ID3DX10DataProcessor **  processor 
)

Definition at line 560 of file async.c.

561{
563
564 TRACE("info %p, processor %p.\n", info, processor);
565
566 if (!processor)
567 return E_INVALIDARG;
568
569 object = malloc(sizeof(*object));
570 if (!object)
571 return E_OUTOFMEMORY;
572
573 object->ID3DX10DataProcessor_iface.lpVtbl = &texture_info_processor_vtbl;
574 object->info = info;
575
576 *processor = &object->ID3DX10DataProcessor_iface;
577 return S_OK;
578}
#define E_INVALIDARG
Definition: ddrawi.h:101
static ID3DX10DataProcessorVtbl texture_info_processor_vtbl
Definition: async.c:314
D3DX10_IMAGE_INFO * info
Definition: async.c:282

Referenced by D3DX10GetImageInfoFromFileW(), D3DX10GetImageInfoFromMemory(), D3DX10GetImageInfoFromResourceA(), and D3DX10GetImageInfoFromResourceW().

◆ D3DX10CreateAsyncTextureProcessor()

HRESULT WINAPI D3DX10CreateAsyncTextureProcessor ( ID3D10Device *  device,
D3DX10_IMAGE_LOAD_INFO *  load_info,
ID3DX10DataProcessor **  processor 
)

Definition at line 580 of file async.c.

582{
584
585 TRACE("device %p, load_info %p, processor %p.\n", device, load_info, processor);
586
587 if (!device || !processor)
588 return E_INVALIDARG;
589
590 object = calloc(1, sizeof(*object));
591 if (!object)
592 return E_OUTOFMEMORY;
593
594 object->ID3DX10DataProcessor_iface.lpVtbl = &texture_processor_vtbl;
595 object->device = device;
596 ID3D10Device_AddRef(device);
597 init_load_info(load_info, &object->load_info);
598
599 *processor = &object->ID3DX10DataProcessor_iface;
600 return S_OK;
601}
static ID3DX10DataProcessorVtbl texture_processor_vtbl
Definition: async.c:374
void init_load_info(const D3DX10_IMAGE_LOAD_INFO *load_info, D3DX10_IMAGE_LOAD_INFO *out)
Definition: texture.c:730
Definition: devices.h:37
D3DX10_IMAGE_LOAD_INFO load_info
Definition: async.c:325
ID3D10Device * device
Definition: async.c:324

Referenced by D3DX10CreateTextureFromFileW(), D3DX10CreateTextureFromMemory(), D3DX10CreateTextureFromResourceA(), and D3DX10CreateTextureFromResourceW().

◆ D3DX10CreateEffectPoolFromFileA()

HRESULT WINAPI D3DX10CreateEffectPoolFromFileA ( const char *  filename,
const D3D10_SHADER_MACRO *  defines,
ID3D10Include *  include,
const char *  profile,
UINT  hlslflags,
UINT  fxflags,
ID3D10Device *  device,
ID3DX10ThreadPump *  pump,
ID3D10EffectPool **  effectpool,
ID3D10Blob **  errors,
HRESULT *  hresult 
)

Definition at line 399 of file async.c.

402{
403 FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, device %p, "
404 "pump %p, effectpool %p, errors %p, hresult %p, stub!\n",
405 debugstr_a(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device,
406 pump, effectpool, errors, hresult);
407
408 return E_NOTIMPL;
409}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define profile
Definition: kernel32.h:12

◆ D3DX10CreateEffectPoolFromFileW()

HRESULT WINAPI D3DX10CreateEffectPoolFromFileW ( const WCHAR *  filename,
const D3D10_SHADER_MACRO *  defines,
ID3D10Include *  include,
const char *  profile,
UINT  hlslflags,
UINT  fxflags,
ID3D10Device *  device,
ID3DX10ThreadPump *  pump,
ID3D10EffectPool **  effectpool,
ID3D10Blob **  errors,
HRESULT *  hresult 
)

Definition at line 411 of file async.c.

414{
415 FIXME("filename %s, defines %p, include %p, profile %s, hlslflags %#x, fxflags %#x, device %p, "
416 "pump %p, effectpool %p, errors %p, hresult %p, stub!\n",
417 debugstr_w(filename), defines, include, debugstr_a(profile), hlslflags, fxflags, device,
418 pump, effectpool, errors, hresult);
419
420 return E_NOTIMPL;
421}

◆ D3DX10CreateThreadPump()

HRESULT WINAPI D3DX10CreateThreadPump ( UINT  io_threads,
UINT  proc_threads,
ID3DX10ThreadPump **  pump 
)

Definition at line 1034 of file async.c.

1035{
1036 struct thread_pump *object;
1037 unsigned int i;
1038
1039 TRACE("io_threads %u, proc_threads %u, pump %p.\n", io_threads, proc_threads, pump);
1040
1041 if (io_threads >= 1024 || proc_threads >= 1024)
1042 return E_FAIL;
1043
1044 if (!io_threads)
1045 io_threads = 1;
1046 if (!proc_threads)
1047 {
1049
1051 proc_threads = info.dwNumberOfProcessors;
1052 }
1053
1054 if (!(object = calloc(1, FIELD_OFFSET(struct thread_pump, threads[io_threads + proc_threads]))))
1055 return E_OUTOFMEMORY;
1056
1057 object->ID3DX10ThreadPump_iface.lpVtbl = &thread_pump_vtbl;
1058 object->refcount = 1;
1059 InitializeSRWLock(&object->io_lock);
1061 list_init(&object->io_queue);
1062 InitializeSRWLock(&object->proc_lock);
1064 list_init(&object->proc_queue);
1065 InitializeSRWLock(&object->device_lock);
1066 list_init(&object->device_queue);
1067 object->thread_count = io_threads + proc_threads;
1068
1069 for (i = 0; i < object->thread_count; ++i)
1070 {
1071 object->threads[i] = CreateThread(NULL, 0, i < io_threads ? io_thread : proc_thread, object, 0, NULL);
1072 if (!object->threads[i])
1073 {
1074 ID3DX10ThreadPump_Release(&object->ID3DX10ThreadPump_iface);
1075 return E_FAIL;
1076 }
1077 }
1078
1079 *pump = &object->ID3DX10ThreadPump_iface;
1080 return S_OK;
1081}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define ID3DX10ThreadPump_Release(p)
Definition: d3dx10core.h:139
static const ID3DX10ThreadPumpVtbl thread_pump_vtbl
Definition: async.c:898
static DWORD WINAPI proc_thread(void *arg)
Definition: async.c:963
static DWORD WINAPI io_thread(void *arg)
Definition: async.c:911
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:143
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
VOID WINAPI InitializeSRWLock(PSRWLOCK Lock)
Definition: sync.c:29
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:22
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
static HANDLE ULONG_PTR DWORD threads
Definition: process.c:83
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

◆ filedataloader_Decompress()

static HRESULT WINAPI filedataloader_Decompress ( ID3DX10DataLoader *  iface,
void **  data,
SIZE_T *  size 
)
static

Definition at line 141 of file async.c.

142{
144
145 TRACE("iface %p, data %p, size %p.\n", iface, data, size);
146
147 if (!loader->data)
148 return E_FAIL;
149
150 *data = loader->data;
151 *size = loader->size;
152
153 return S_OK;
154}
static struct asyncdataloader * impl_from_ID3DX10DataLoader(ID3DX10DataLoader *iface)
Definition: async.c:51
GLsizeiptr size
Definition: glext.h:5919

◆ filedataloader_Destroy()

static HRESULT WINAPI filedataloader_Destroy ( ID3DX10DataLoader *  iface)
static

Definition at line 156 of file async.c.

157{
159
160 TRACE("iface %p.\n", iface);
161
162 free(loader->u.file.path);
163 free(loader->data);
164 free(loader);
165
166 return S_OK;
167}

◆ filedataloader_Load()

static HRESULT WINAPI filedataloader_Load ( ID3DX10DataLoader *  iface)
static

Definition at line 121 of file async.c.

122{
124 void *data;
125 DWORD size;
126 HRESULT hr;
127
128 TRACE("iface %p.\n", iface);
129
130 /* Always buffer file contents, even if Load() was already called. */
131 if (FAILED((hr = load_file(loader->u.file.path, &data, &size))))
132 return hr;
133
134 free(loader->data);
135 loader->data = data;
136 loader->size = size;
137
138 return S_OK;
139}
HRESULT load_file(const WCHAR *path, void **data, DWORD *size)
Definition: async.c:91
unsigned long DWORD
Definition: ntddk_ex.h:95

◆ impl_from_ID3DX10DataLoader()

static struct asyncdataloader * impl_from_ID3DX10DataLoader ( ID3DX10DataLoader *  iface)
inlinestatic

◆ impl_from_ID3DX10DataProcessor()

static struct texture_info_processor * impl_from_ID3DX10DataProcessor ( ID3DX10DataProcessor *  iface)
inlinestatic

Definition at line 285 of file async.c.

286{
287 return CONTAINING_RECORD(iface, struct texture_info_processor, ID3DX10DataProcessor_iface);
288}

Referenced by texture_info_processor_Destroy(), and texture_info_processor_Process().

◆ impl_from_ID3DX10ThreadPump()

static struct thread_pump * impl_from_ID3DX10ThreadPump ( ID3DX10ThreadPump *  iface)
inlinestatic

◆ io_thread()

static DWORD WINAPI io_thread ( void *  arg)
static

Definition at line 911 of file async.c.

912{
913 struct thread_pump *thread_pump = arg;
914 struct work_item *work_item;
915 HRESULT hr;
916
917 TRACE("%p thread started.\n", thread_pump);
918
919 for (;;)
920 {
922
923 while (!thread_pump->io_count)
925
927 {
929 return 0;
930 }
931
936
938 {
939 if (work_item->result)
940 *work_item->result = hr;
944 continue;
945 }
946
949 {
952 return 0;
953 }
954
959 }
960 return 0;
961}
#define InterlockedDecrement
Definition: armddk.h:52
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define ID3DX10DataLoader_Load(p)
Definition: d3dx10core.h:86
#define THREAD_PUMP_EXITING
Definition: async.c:622
static void work_item_free(struct work_item *work_item, BOOL cancel)
Definition: async.c:613
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:8
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:36
BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK Lock, DWORD Timeout, ULONG Flags)
Definition: sync.c:75
VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:98
#define INFINITE
Definition: serial.h:102
uint32_t entry
Definition: isohybrid.c:63
Definition: list.h:15
SRWLOCK io_lock
Definition: async.c:630
CONDITION_VARIABLE proc_cv
Definition: async.c:636
struct list io_queue
Definition: async.c:633
LONG processing_count
Definition: async.c:628
SRWLOCK proc_lock
Definition: async.c:635
unsigned int io_count
Definition: async.c:632
CONDITION_VARIABLE io_cv
Definition: async.c:631
unsigned int proc_count
Definition: async.c:637
struct list proc_queue
Definition: async.c:638
struct list entry
Definition: async.c:605
ID3DX10DataLoader * loader
Definition: async.c:607
HRESULT * result
Definition: async.c:609
#define LIST_ENTRY(type)
Definition: queue.h:175
void * arg
Definition: msvc.h:10
NTSYSAPI void WINAPI RtlWakeAddressAll(const void *)

Referenced by D3DX10CreateThreadPump().

◆ load_file()

HRESULT load_file ( const WCHAR *  path,
void **  data,
DWORD *  size 
)

Definition at line 91 of file async.c.

92{
93 DWORD read_len;
95 BOOL ret;
96
101
103 *data = malloc(*size);
104 if (!*data)
105 {
107 return E_OUTOFMEMORY;
108 }
109
110 ret = ReadFile(file, *data, *size, &read_len, NULL);
112 if (!ret || read_len != *size)
113 {
114 WARN("Failed to read file contents.\n");
115 free(*data);
116 return E_FAIL;
117 }
118 return S_OK;
119}
#define WARN(fmt,...)
Definition: precomp.h:61
#define CloseHandle
Definition: compat.h:739
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GENERIC_READ
Definition: compat.h:135
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
return ret
Definition: mutex.c:147
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
Definition: fci.c:123
#define D3D10_ERROR_FILE_NOT_FOUND
Definition: winerror.h:7117

Referenced by D3DX10CreateEffectFromFileW(), D3DX10CreateTextureFromFileW(), D3DX10GetImageInfoFromFileW(), elf_load_file_cb(), filedataloader_Load(), main(), and process_file().

◆ load_resource()

static HRESULT load_resource ( HMODULE  module,
HRSRC  rsrc,
void **  data,
DWORD *  size 
)
static

Definition at line 200 of file async.c.

201{
202 HGLOBAL hglobal;
203
204 if (!(*size = SizeofResource(module, rsrc)))
206 if (!(hglobal = LoadResource(module, rsrc)))
208 if (!(*data = LockResource(hglobal)))
210 return S_OK;
211}
@ D3DX10_ERR_INVALID_DATA
Definition: d3dx10.h:46
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532

◆ load_resource_initA()

static HRESULT load_resource_initA ( HMODULE  module,
const char *  resource,
HRSRC *  rsrc 
)
static

Definition at line 176 of file async.c.

177{
178 if (!(*rsrc = FindResourceA(module, resource, (const char *)RT_RCDATA)))
179 *rsrc = FindResourceA(module, resource, (const char *)RT_BITMAP);
180 if (!*rsrc)
181 {
182 WARN("Failed to find resource.\n");
184 }
185 return S_OK;
186}
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
#define RT_BITMAP
Definition: pedump.c:364
#define RT_RCDATA
Definition: pedump.c:372

Referenced by D3DX10CreateAsyncResourceLoaderA(), and load_resourceA().

◆ load_resource_initW()

static HRESULT load_resource_initW ( HMODULE  module,
const WCHAR *  resource,
HRSRC *  rsrc 
)
static

Definition at line 188 of file async.c.

189{
190 if (!(*rsrc = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA)))
191 *rsrc = FindResourceW(module, resource, (const WCHAR *)RT_BITMAP);
192 if (!*rsrc)
193 {
194 WARN("Failed to find resource.\n");
196 }
197 return S_OK;
198}
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176

Referenced by D3DX10CreateAsyncResourceLoaderW(), and load_resourceW().

◆ load_resourceA()

HRESULT load_resourceA ( HMODULE  module,
const char *  resource,
void **  data,
DWORD *  size 
)

Definition at line 213 of file async.c.

214{
215 HRESULT hr;
216 HRSRC rsrc;
217
218 if (FAILED((hr = load_resource_initA(module, resource, &rsrc))))
219 return hr;
220 return load_resource(module, rsrc, data, size);
221}
#define load_resource(a, b, c)
Definition: font.c:46

Referenced by D3DX10CreateEffectFromResourceA(), D3DX10CreateTextureFromResourceA(), and D3DX10GetImageInfoFromResourceA().

◆ load_resourceW()

HRESULT load_resourceW ( HMODULE  module,
const WCHAR *  resource,
void **  data,
DWORD *  size 
)

Definition at line 223 of file async.c.

224{
225 HRESULT hr;
226 HRSRC rsrc;
227
228 if ((FAILED(hr = load_resource_initW(module, resource, &rsrc))))
229 return hr;
230 return load_resource(module, rsrc, data, size);
231}

Referenced by D3DX10CreateEffectFromResourceW(), D3DX10CreateTextureFromResourceW(), and D3DX10GetImageInfoFromResourceW().

◆ memorydataloader_Decompress()

static HRESULT WINAPI memorydataloader_Decompress ( ID3DX10DataLoader *  iface,
void **  data,
SIZE_T *  size 
)
static

Definition at line 62 of file async.c.

63{
65
66 TRACE("iface %p, data %p, size %p.\n", iface, data, size);
67
68 *data = loader->data;
69 *size = loader->size;
70
71 return S_OK;
72}

◆ memorydataloader_Destroy()

static HRESULT WINAPI memorydataloader_Destroy ( ID3DX10DataLoader *  iface)
static

Definition at line 74 of file async.c.

75{
77
78 TRACE("iface %p.\n", iface);
79
80 free(loader);
81 return S_OK;
82}

◆ memorydataloader_Load()

static HRESULT WINAPI memorydataloader_Load ( ID3DX10DataLoader *  iface)
static

Definition at line 56 of file async.c.

57{
58 TRACE("iface %p.\n", iface);
59 return S_OK;
60}

◆ proc_thread()

static DWORD WINAPI proc_thread ( void *  arg)
static

Definition at line 963 of file async.c.

964{
965 struct thread_pump *thread_pump = arg;
966 struct work_item *work_item;
967 SIZE_T size;
968 void *data;
969 HRESULT hr;
970
971 TRACE("%p thread started.\n", thread_pump);
972
973 for (;;)
974 {
976
977 while (!thread_pump->proc_count)
979
981 {
983 return 0;
984 }
985
990
992 {
993 if (work_item->result)
994 *work_item->result = hr;
998 continue;
999 }
1000
1002 {
1004 return 0;
1005 }
1006
1008 {
1009 if (work_item->result)
1010 *work_item->result = hr;
1014 continue;
1015 }
1016
1019 {
1022 return 0;
1023 }
1024
1030 }
1031 return 0;
1032}
#define ID3DX10DataLoader_Decompress(p, a, b)
Definition: d3dx10core.h:87
#define ID3DX10DataProcessor_Process(p, a, b)
Definition: d3dx10core.h:107
unsigned int device_count
Definition: async.c:641
struct list device_queue
Definition: async.c:642
SRWLOCK device_lock
Definition: async.c:640
ID3DX10DataProcessor * processor
Definition: async.c:608
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by D3DX10CreateThreadPump().

◆ purge_list()

static void purge_list ( struct list *  list,
LONG *  count 
)
static

Definition at line 836 of file async.c.

837{
838 struct work_item *work_item;
839
840 while (!list_empty(list))
841 {
845
848 }
849}
static int list_empty(struct list_entry *head)
Definition: list.h:58
Definition: list.h:39
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by thread_pump_PurgeAllItems().

◆ resourcedataloader_Decompress()

static HRESULT WINAPI resourcedataloader_Decompress ( ID3DX10DataLoader *  iface,
void **  data,
SIZE_T *  size 
)
static

Definition at line 246 of file async.c.

247{
249
250 TRACE("iface %p, data %p, size %p.\n", iface, data, size);
251
252 if (!loader->data)
253 return E_FAIL;
254
255 *data = loader->data;
256 *size = loader->size;
257
258 return S_OK;
259}

◆ resourcedataloader_Destroy()

static HRESULT WINAPI resourcedataloader_Destroy ( ID3DX10DataLoader *  iface)
static

Definition at line 261 of file async.c.

262{
264
265 TRACE("iface %p.\n", iface);
266
267 free(loader);
268
269 return S_OK;
270}

◆ resourcedataloader_Load()

static HRESULT WINAPI resourcedataloader_Load ( ID3DX10DataLoader *  iface)
static

Definition at line 233 of file async.c.

234{
236
237 TRACE("iface %p.\n", iface);
238
239 if (loader->data)
240 return S_OK;
241
242 return load_resource(loader->u.resource.module, loader->u.resource.rsrc,
243 &loader->data, &loader->size);
244}

◆ texture_info_processor_CreateDeviceObject()

static HRESULT WINAPI texture_info_processor_CreateDeviceObject ( ID3DX10DataProcessor *  iface,
void **  object 
)
static

Definition at line 298 of file async.c.

299{
300 TRACE("iface %p, object %p.\n", iface, object);
301 return S_OK;
302}

◆ texture_info_processor_Destroy()

static HRESULT WINAPI texture_info_processor_Destroy ( ID3DX10DataProcessor *  iface)
static

Definition at line 304 of file async.c.

305{
307
308 TRACE("iface %p.\n", iface);
309
310 free(processor);
311 return S_OK;
312}
static struct texture_info_processor * impl_from_ID3DX10DataProcessor(ID3DX10DataProcessor *iface)
Definition: async.c:285

◆ texture_info_processor_Process()

static HRESULT WINAPI texture_info_processor_Process ( ID3DX10DataProcessor *  iface,
void *  data,
SIZE_T  size 
)
static

Definition at line 290 of file async.c.

291{
293
294 TRACE("iface %p, data %p, size %Iu.\n", iface, data, size);
295 return get_image_info(data, size, processor->info);
296}
HRESULT get_image_info(const void *data, SIZE_T size, D3DX10_IMAGE_INFO *img_info)
Definition: texture.c:426

◆ texture_processor_CreateDeviceObject()

static HRESULT WINAPI texture_processor_CreateDeviceObject ( ID3DX10DataProcessor *  iface,
void **  object 
)
static

Definition at line 349 of file async.c.

350{
352
353 TRACE("iface %p, object %p.\n", iface, object);
354
355 if (!processor->resource_data)
356 return E_FAIL;
357
358 return create_d3d_texture(processor->device, &processor->load_info,
359 processor->resource_data, (ID3D10Resource **)object);
360}
static struct texture_processor * texture_processor_from_ID3DX10DataProcessor(ID3DX10DataProcessor *iface)
Definition: async.c:329
HRESULT create_d3d_texture(ID3D10Device *device, D3DX10_IMAGE_LOAD_INFO *load_info, D3D10_SUBRESOURCE_DATA *resource_data, ID3D10Resource **texture)
Definition: texture.c:1027
D3D10_SUBRESOURCE_DATA * resource_data
Definition: async.c:326

◆ texture_processor_Destroy()

static HRESULT WINAPI texture_processor_Destroy ( ID3DX10DataProcessor *  iface)
static

Definition at line 362 of file async.c.

363{
365
366 TRACE("iface %p.\n", iface);
367
368 ID3D10Device_Release(processor->device);
369 free(processor->resource_data);
370 free(processor);
371 return S_OK;
372}

◆ texture_processor_from_ID3DX10DataProcessor()

static struct texture_processor * texture_processor_from_ID3DX10DataProcessor ( ID3DX10DataProcessor *  iface)
inlinestatic

Definition at line 329 of file async.c.

330{
331 return CONTAINING_RECORD(iface, struct texture_processor, ID3DX10DataProcessor_iface);
332}

Referenced by texture_processor_CreateDeviceObject(), texture_processor_Destroy(), and texture_processor_Process().

◆ texture_processor_Process()

static HRESULT WINAPI texture_processor_Process ( ID3DX10DataProcessor *  iface,
void *  data,
SIZE_T  size 
)
static

Definition at line 334 of file async.c.

335{
337
338 TRACE("iface %p, data %p, size %Iu.\n", iface, data, size);
339
340 if (processor->resource_data)
341 {
342 WARN("Called multiple times.\n");
343 free(processor->resource_data);
344 processor->resource_data = NULL;
345 }
346 return load_texture_data(data, size, &processor->load_info, &processor->resource_data);
347}
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

◆ thread_pump_AddRef()

static ULONG WINAPI thread_pump_AddRef ( ID3DX10ThreadPump *  iface)
static

Definition at line 670 of file async.c.

671{
674
675 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
676
677 return refcount;
678}
#define InterlockedIncrement
Definition: armddk.h:53
static struct thread_pump * impl_from_ID3DX10ThreadPump(ID3DX10ThreadPump *iface)
Definition: async.c:648
LONG refcount
Definition: async.c:626
uint32_t ULONG
Definition: typedefs.h:59

◆ thread_pump_AddWorkItem()

static HRESULT WINAPI thread_pump_AddWorkItem ( ID3DX10ThreadPump *  iface,
ID3DX10DataLoader *  loader,
ID3DX10DataProcessor *  processor,
HRESULT *  result,
void **  object 
)
static

Definition at line 731 of file async.c.

733{
735 struct work_item *work_item;
736
737 TRACE("iface %p, loader %p, processor %p, result %p, object %p.\n",
738 iface, loader, processor, result, object);
739
740 work_item = malloc(sizeof(*work_item));
741 if (!work_item)
742 return E_OUTOFMEMORY;
743
748
749 if (object)
750 *object = NULL;
751
758 return S_OK;
759}
GLuint64EXT * result
Definition: glext.h:11304
void ** object
Definition: async.c:610

◆ thread_pump_GetQueueStatus()

static HRESULT WINAPI thread_pump_GetQueueStatus ( ID3DX10ThreadPump *  iface,
UINT *  io_queue,
UINT *  process_queue,
UINT *  device_queue 
)
static

Definition at line 884 of file async.c.

886{
888
889 TRACE("iface %p, io_queue %p, process_queue %p, device_queue %p.\n",
890 iface, io_queue, process_queue, device_queue);
891
893 *process_queue = thread_pump->proc_count;
895 return S_OK;
896}

◆ thread_pump_GetWorkItemCount()

static UINT WINAPI thread_pump_GetWorkItemCount ( ID3DX10ThreadPump *  iface)
static

Definition at line 761 of file async.c.

762{
764 UINT ret;
765
766 TRACE("iface %p.\n", iface);
767
771 return ret;
772}
unsigned int UINT
Definition: sysinfo.c:13

◆ thread_pump_ProcessDeviceWorkItems()

static HRESULT WINAPI thread_pump_ProcessDeviceWorkItems ( ID3DX10ThreadPump *  iface,
UINT  count 
)
static

Definition at line 804 of file async.c.

805{
807 struct work_item *work_item;
808 HRESULT hr;
809 UINT i;
810
811 TRACE("iface %p, count %u.\n", iface, count);
812
813 for (i = 0; i < count; ++i)
814 {
817 {
819 break;
820 }
821
826
828 if (work_item->result)
829 *work_item->result = hr;
831 }
832
833 return S_OK;
834}
#define ID3DX10DataProcessor_CreateDeviceObject(p, a)
Definition: d3dx10core.h:108

◆ thread_pump_PurgeAllItems()

static HRESULT WINAPI thread_pump_PurgeAllItems ( ID3DX10ThreadPump *  iface)
static

Definition at line 851 of file async.c.

852{
854 LONG v;
855
856 TRACE("iface %p.\n", iface);
857
858 for (;;)
859 {
864
869
875 if (!v)
876 break;
877
879 }
880
881 return S_OK;
882}
static void purge_list(struct list *list, LONG *count)
Definition: async.c:836
const GLdouble * v
Definition: gl.h:2040
long LONG
Definition: pedump.c:60
NTSYSAPI NTSTATUS WINAPI RtlWaitOnAddress(const void *, const void *, SIZE_T, const LARGE_INTEGER *)

◆ thread_pump_QueryInterface()

static HRESULT WINAPI thread_pump_QueryInterface ( ID3DX10ThreadPump *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 653 of file async.c.

654{
655 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
656
657 if (IsEqualGUID(riid, &IID_ID3DX10ThreadPump)
659 {
661 *out = iface;
662 return S_OK;
663 }
664
665 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
666 *out = NULL;
667 return E_NOINTERFACE;
668}
const GUID IID_IUnknown
#define ID3DX10ThreadPump_AddRef(p)
Definition: d3dx10core.h:138
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ thread_pump_Release()

static ULONG WINAPI thread_pump_Release ( ID3DX10ThreadPump *  iface)
static

Definition at line 680 of file async.c.

681{
684 struct work_item *item, *next;
685 struct list list;
686 unsigned int i;
687
688 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
689
690 if (!refcount)
691 {
696
701
705
706 for (i = 0; i < thread_pump->thread_count; ++i)
707 {
708 if (!thread_pump->threads[i])
709 continue;
710
713 }
714
715 list_init(&list);
720 {
721 list_remove(&item->entry);
723 }
724
726 }
727
728 return refcount;
729}
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:91
static void list_move_tail(struct list_head *list, struct list_head *head)
Definition: list.h:122
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242
unsigned int thread_count
Definition: async.c:644
HANDLE threads[1]
Definition: async.c:645
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

◆ thread_pump_WaitForAllItems()

static HRESULT WINAPI thread_pump_WaitForAllItems ( ID3DX10ThreadPump *  iface)
static

Definition at line 774 of file async.c.

775{
777 HRESULT hr;
778 LONG v;
779
780 TRACE("iface %p.\n", iface);
781
782 for (;;)
783 {
785 return hr;
786
789 {
791 continue;
792 }
795 if (!v)
796 break;
797
799 }
800
801 return S_OK;
802}
#define ID3DX10ThreadPump_ProcessDeviceWorkItems(p, a)
Definition: d3dx10core.h:144
#define UINT_MAX
Definition: limits.h:27

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3dx  )

◆ work_item_free()

static void work_item_free ( struct work_item *  work_item,
BOOL  cancel 
)
inlinestatic

Definition at line 613 of file async.c.

614{
617 if (cancel && work_item->result)
620}
#define ID3DX10DataLoader_Destroy(p)
Definition: d3dx10core.h:88
#define ID3DX10DataProcessor_Destroy(p)
Definition: d3dx10core.h:109
#define S_FALSE
Definition: winerror.h:3451

Referenced by io_thread(), proc_thread(), purge_list(), thread_pump_ProcessDeviceWorkItems(), and thread_pump_Release().

Variable Documentation

◆ filedataloadervtbl

const ID3DX10DataLoaderVtbl filedataloadervtbl
static
Initial value:
=
{
}
static HRESULT WINAPI filedataloader_Destroy(ID3DX10DataLoader *iface)
Definition: async.c:156
static HRESULT WINAPI filedataloader_Decompress(ID3DX10DataLoader *iface, void **data, SIZE_T *size)
Definition: async.c:141
static HRESULT WINAPI filedataloader_Load(ID3DX10DataLoader *iface)
Definition: async.c:121

Definition at line 169 of file async.c.

Referenced by D3DX10CreateAsyncFileLoaderW(), and D3DX11CreateAsyncFileLoaderW().

◆ memorydataloadervtbl

const ID3DX10DataLoaderVtbl memorydataloadervtbl
static
Initial value:
=
{
}
static HRESULT WINAPI memorydataloader_Load(ID3DX10DataLoader *iface)
Definition: async.c:56
static HRESULT WINAPI memorydataloader_Decompress(ID3DX10DataLoader *iface, void **data, SIZE_T *size)
Definition: async.c:62
static HRESULT WINAPI memorydataloader_Destroy(ID3DX10DataLoader *iface)
Definition: async.c:74

Definition at line 84 of file async.c.

Referenced by D3DX10CreateAsyncMemoryLoader(), and D3DX11CreateAsyncMemoryLoader().

◆ resourcedataloadervtbl

const ID3DX10DataLoaderVtbl resourcedataloadervtbl
static
Initial value:
=
{
}
static HRESULT WINAPI resourcedataloader_Destroy(ID3DX10DataLoader *iface)
Definition: async.c:261
static HRESULT WINAPI resourcedataloader_Decompress(ID3DX10DataLoader *iface, void **data, SIZE_T *size)
Definition: async.c:246
static HRESULT WINAPI resourcedataloader_Load(ID3DX10DataLoader *iface)
Definition: async.c:233

Definition at line 272 of file async.c.

Referenced by D3DX10CreateAsyncResourceLoaderA(), D3DX10CreateAsyncResourceLoaderW(), D3DX11CreateAsyncResourceLoaderA(), and D3DX11CreateAsyncResourceLoaderW().

◆ texture_info_processor_vtbl

ID3DX10DataProcessorVtbl texture_info_processor_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI texture_info_processor_Process(ID3DX10DataProcessor *iface, void *data, SIZE_T size)
Definition: async.c:290
static HRESULT WINAPI texture_info_processor_CreateDeviceObject(ID3DX10DataProcessor *iface, void **object)
Definition: async.c:298
static HRESULT WINAPI texture_info_processor_Destroy(ID3DX10DataProcessor *iface)
Definition: async.c:304

Definition at line 314 of file async.c.

Referenced by D3DX10CreateAsyncTextureInfoProcessor().

◆ texture_processor_vtbl

ID3DX10DataProcessorVtbl texture_processor_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI texture_processor_Process(ID3DX10DataProcessor *iface, void *data, SIZE_T size)
Definition: async.c:334
static HRESULT WINAPI texture_processor_CreateDeviceObject(ID3DX10DataProcessor *iface, void **object)
Definition: async.c:349
static HRESULT WINAPI texture_processor_Destroy(ID3DX10DataProcessor *iface)
Definition: async.c:362

Definition at line 374 of file async.c.

Referenced by D3DX10CreateAsyncTextureProcessor().

◆ thread_pump_vtbl

const ID3DX10ThreadPumpVtbl thread_pump_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI thread_pump_GetQueueStatus(ID3DX10ThreadPump *iface, UINT *io_queue, UINT *process_queue, UINT *device_queue)
Definition: async.c:884
static HRESULT WINAPI thread_pump_ProcessDeviceWorkItems(ID3DX10ThreadPump *iface, UINT count)
Definition: async.c:804
static UINT WINAPI thread_pump_GetWorkItemCount(ID3DX10ThreadPump *iface)
Definition: async.c:761
static ULONG WINAPI thread_pump_AddRef(ID3DX10ThreadPump *iface)
Definition: async.c:670
static HRESULT WINAPI thread_pump_PurgeAllItems(ID3DX10ThreadPump *iface)
Definition: async.c:851
static HRESULT WINAPI thread_pump_QueryInterface(ID3DX10ThreadPump *iface, REFIID riid, void **out)
Definition: async.c:653
static HRESULT WINAPI thread_pump_AddWorkItem(ID3DX10ThreadPump *iface, ID3DX10DataLoader *loader, ID3DX10DataProcessor *processor, HRESULT *result, void **object)
Definition: async.c:731
static HRESULT WINAPI thread_pump_WaitForAllItems(ID3DX10ThreadPump *iface)
Definition: async.c:774
static ULONG WINAPI thread_pump_Release(ID3DX10ThreadPump *iface)
Definition: async.c:680

Definition at line 898 of file async.c.

Referenced by D3DX10CreateThreadPump().