ReactOS  0.4.15-dev-1070-ge1a01de
asm.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 Stefan Dösinger
3  * Copyright (C) 2009 Matteo Bruni
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18  */
19 #define COBJMACROS
20 #define CONST_VTABLE
21 #include "wine/test.h"
22 
23 #include <d3dx9.h>
24 
25 #include "resources.h"
26 
27 static char temp_path[MAX_PATH];
28 
29 static BOOL create_file(const char *filename, const char *data, const unsigned int size, char *out_path)
30 {
31  DWORD written;
32  HANDLE hfile;
33  char path[MAX_PATH];
34 
35  if (!*temp_path)
37 
41  if (hfile == INVALID_HANDLE_VALUE)
42  return FALSE;
43 
44  if (WriteFile(hfile, data, size, &written, NULL))
45  {
46  CloseHandle(hfile);
47 
48  if (out_path)
49  strcpy(out_path, path);
50  return TRUE;
51  }
52 
53  CloseHandle(hfile);
54  return FALSE;
55 }
56 
57 static void delete_file(const char *filename)
58 {
59  char path[MAX_PATH];
60 
64 }
65 
66 static BOOL create_directory(const char *name)
67 {
68  char path[MAX_PATH];
69 
71  strcat(path, name);
72  return CreateDirectoryA(path, NULL);
73 }
74 
75 static void delete_directory(const char *name)
76 {
77  char path[MAX_PATH];
78 
80  strcat(path, name);
82 }
83 
84 static HRESULT WINAPI testD3DXInclude_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE include_type,
85  const char *filename, const void *parent_data, const void **data, UINT *bytes)
86 {
87  char *buffer;
88  static const char shader[] =
89  "#include \"incl.vsh\"\n"
90  "mov REGISTER, v0\n";
91  static const char include[] = "#define REGISTER r0\nvs.1.1\n";
92  static const char include2[] = "#include \"incl3.vsh\"\n";
93  static const char include3[] = "vs.1.1\n";
94 
95  trace("filename %s.\n", filename);
96  trace("parent_data %p: %s.\n", parent_data, parent_data ? (char *)parent_data : "(null)");
97 
98  if (!strcmp(filename, "shader.vsh"))
99  {
100  buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(shader));
101  memcpy(buffer, shader, sizeof(shader));
102  *bytes = sizeof(shader);
103  }
104  else if (!strcmp(filename, "incl.vsh"))
105  {
106  buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include));
107  memcpy(buffer, include, sizeof(include));
108  *bytes = sizeof(include);
109  /* This is included from the first D3DXAssembleShader with non-null ID3DXInclude test
110  * (parent_data == NULL) and from shader.vsh / shader[] (with matching parent_data).
111  * Allow both cases. */
112  ok(parent_data == NULL || !strncmp(shader, parent_data, strlen(shader)), "wrong parent_data value\n");
113  }
114  else if (!strcmp(filename, "incl2.vsh"))
115  {
116  buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include2));
117  memcpy(buffer, include2, sizeof(include2));
118  *bytes = sizeof(include2);
119  }
120  else if (!strcmp(filename, "incl3.vsh"))
121  {
122  buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include3));
123  memcpy(buffer, include3, sizeof(include3));
124  *bytes = sizeof(include3);
125  /* Also check for the correct parent_data content */
126  ok(parent_data != NULL && !strncmp(include2, parent_data, strlen(include2)), "wrong parent_data value\n");
127  }
128  else if (!strcmp(filename, "include/incl3.vsh"))
129  {
130  buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include));
131  memcpy(buffer, include, sizeof(include));
132  *bytes = sizeof(include);
133  ok(!parent_data, "wrong parent_data value\n");
134  }
135  else
136  {
137  ok(0, "Unexpected #include for file %s.\n", filename);
138  return D3DERR_INVALIDCALL;
139  }
140  *data = buffer;
141  return S_OK;
142 }
143 
144 static HRESULT WINAPI testD3DXInclude_close(ID3DXInclude *iface, const void *data)
145 {
146  HeapFree(GetProcessHeap(), 0, (void *)data);
147  return S_OK;
148 }
149 
150 static const struct ID3DXIncludeVtbl D3DXInclude_Vtbl = {
153 };
154 
156  ID3DXInclude ID3DXInclude_iface;
157 };
158 
159 static void assembleshader_test(void)
160 {
161  static const char test1[] =
162  "vs.1.1\n"
163  "mov DEF2, v0\n";
164  static const char testincl[] =
165  "#define REGISTER r0\n"
166  "vs.1.1\n";
167  static const char testshader[] =
168  "#include \"incl.vsh\"\n"
169  "mov REGISTER, v0\n";
170  static const char testshader2[] =
171  "#include \"incl2.vsh\"\n"
172  "mov REGISTER, v0\n";
173  static const char testshader3[] =
174  "#include \"include/incl3.vsh\"\n"
175  "mov REGISTER, v0\n";
176  static const char testincl3[] =
177  "#include \"incl4.vsh\"\n";
178  static const char testincl4_ok[] =
179  "#define REGISTER r0\n"
180  "vs.1.1\n";
181  static const char testincl4_wrong[] =
182  "#error \"wrong include\"\n";
183  HRESULT hr;
185  static const D3DXMACRO defines[] = {
186  {
187  "DEF1", "10 + 15"
188  },
189  {
190  "DEF2", "r0"
191  },
192  {
193  NULL, NULL
194  }
195  };
196  struct D3DXIncludeImpl include;
197  char shader_vsh_path[MAX_PATH], shader3_vsh_path[MAX_PATH];
198  static const WCHAR shader_filename_w[] = {'s','h','a','d','e','r','.','v','s','h',0};
199 
200  /* pDefines test */
201  shader = NULL;
202  messages = NULL;
205  &shader, &messages);
206  ok(hr == D3D_OK, "pDefines test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
207  if(messages) {
208  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
210  }
212 
213  /* NULL messages test */
214  shader = NULL;
217  &shader, NULL);
218  ok(hr == D3D_OK, "NULL messages test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
220 
221  /* NULL shader test */
222  messages = NULL;
225  NULL, &messages);
226  ok(hr == D3D_OK, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
227  if(messages) {
228  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
230  }
231 
232  /* pInclude test */
233  shader = NULL;
234  messages = NULL;
235  include.ID3DXInclude_iface.lpVtbl = &D3DXInclude_Vtbl;
236  hr = D3DXAssembleShader(testshader, strlen(testshader), NULL, &include.ID3DXInclude_iface,
238  ok(hr == D3D_OK, "pInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
239  if(messages) {
240  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
242  }
244 
245  /* "unexpected #include file from memory" test */
246  shader = NULL;
247  messages = NULL;
248  hr = D3DXAssembleShader(testshader, strlen(testshader),
250  &shader, &messages);
251  ok(hr == D3DXERR_INVALIDDATA, "D3DXAssembleShader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
252  if(messages) {
253  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
255  }
257 
258  /* recursive #include test */
259  shader = NULL;
260  messages = NULL;
261  hr = D3DXAssembleShader(testshader2, strlen(testshader2), NULL, &include.ID3DXInclude_iface,
263  ok(hr == D3D_OK, "D3DXAssembleShader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
264  if(messages) {
265  trace("recursive D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
267  }
269 
270  /* #include with a path. */
271  shader = NULL;
272  messages = NULL;
273  hr = D3DXAssembleShader(testshader3, strlen(testshader3), NULL, &include.ID3DXInclude_iface,
275  ok(hr == D3D_OK, "D3DXAssembleShader test failed with error 0x%x - %d\n", hr, hr & 0x0000ffff);
276  if (messages)
277  {
278  trace("Path search D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
280  }
281  if (shader)
283 
284  if (create_file("shader.vsh", testshader, sizeof(testshader) - 1, shader_vsh_path))
285  {
286  create_file("incl.vsh", testincl, sizeof(testincl) - 1, NULL);
287 
288  /* D3DXAssembleShaderFromFile + #include test */
289  shader = NULL;
290  messages = NULL;
291  hr = D3DXAssembleShaderFromFileA(shader_vsh_path,
293  &shader, &messages);
294  ok(hr == D3D_OK, "D3DXAssembleShaderFromFile test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
295  if(messages) {
296  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
298  }
300 
301  /* D3DXAssembleShaderFromFile + pInclude test */
302  shader = NULL;
303  messages = NULL;
304  hr = D3DXAssembleShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
306  ok(hr == D3D_OK, "D3DXAssembleShaderFromFile + pInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
307  if(messages) {
308  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
310  }
312 
313  create_file("shader3.vsh", testshader3, sizeof(testshader3) - 1, shader3_vsh_path);
314  create_file("incl4.vsh", testincl4_wrong, sizeof(testincl4_wrong) - 1, NULL);
315  if (create_directory("include"))
316  {
317  create_file("include\\incl3.vsh", testincl3, sizeof(testincl3) - 1, NULL);
318  create_file("include\\incl4.vsh", testincl4_ok, sizeof(testincl4_ok) - 1, NULL);
319 
320  /* path search #include test */
321  shader = NULL;
322  messages = NULL;
323  hr = D3DXAssembleShaderFromFileA(shader3_vsh_path, NULL, NULL,
325  &shader, &messages);
326  ok(hr == D3D_OK, "D3DXAssembleShaderFromFile path search test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
327  if(messages) {
328  trace("D3DXAssembleShaderFromFile path search messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
330  }
332  } else skip("Couldn't create \"include\" directory\n");
333 
334  delete_file("shader.vsh");
335  delete_file("incl.vsh");
336  delete_file("shader3.vsh");
337  delete_file("incl4.vsh");
338  delete_file("include\\incl3.vsh");
339  delete_file("include\\incl4.vsh");
340  delete_directory("include");
341 
342  /* The main shader is also to be loaded through the ID3DXInclude object. */
343  shader = NULL;
344  messages = NULL;
345  hr = D3DXAssembleShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
347  ok(hr == D3D_OK, "D3DXAssembleShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
348  hr, hr & 0x0000ffff);
349  if (messages)
350  {
351  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
353  }
354  if (shader)
356 
357  shader = NULL;
358  messages = NULL;
359  hr = D3DXAssembleShaderFromFileW(shader_filename_w, NULL, &include.ID3DXInclude_iface,
361  ok(hr == D3D_OK, "D3DXAssembleShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
362  hr, hr & 0x0000ffff);
363  if (messages)
364  {
365  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
367  }
368  if (shader)
370  } else skip("Couldn't create \"shader.vsh\"\n");
371 
372  /* NULL shader tests */
373  shader = NULL;
374  messages = NULL;
377  &shader, &messages);
378  ok(hr == D3DXERR_INVALIDDATA, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
379  if(messages) {
380  trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
382  }
384 
385  shader = NULL;
386  messages = NULL;
387  hr = D3DXAssembleShaderFromFileA("nonexistent.vsh",
389  &shader, &messages);
390  ok(hr == D3DXERR_INVALIDDATA || hr == E_FAIL, /* I get this on WinXP */
391  "D3DXAssembleShaderFromFile nonexistent file test failed with error 0x%x - %d\n",
392  hr, hr & 0x0000FFFF);
393  if(messages) {
394  trace("D3DXAssembleShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
396  }
398 
399  /* D3DXAssembleShaderFromResource test */
400  shader = NULL;
401  messages = NULL;
404  &shader, &messages);
405  ok(hr == D3D_OK, "D3DXAssembleShaderFromResource test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
406  if(messages) {
407  trace("D3DXAssembleShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
409  }
411 
412  /* D3DXAssembleShaderFromResource with missing shader resource test */
413  shader = NULL;
414  messages = NULL;
415  hr = D3DXAssembleShaderFromResourceA(NULL, "notexisting",
417  &shader, &messages);
418  ok(hr == D3DXERR_INVALIDDATA, "D3DXAssembleShaderFromResource NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
419  if(messages) {
420  trace("D3DXAssembleShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
422  }
424 }
425 
426 static void d3dxpreprocess_test(void)
427 {
428  static const char testincl[] =
429  "#define REGISTER r0\n"
430  "vs.1.1\n";
431  static const char testshader[] =
432  "#include \"incl.vsh\"\n"
433  "mov REGISTER, v0\n";
434  static const char testshader3[] =
435  "#include \"include/incl3.vsh\"\n"
436  "mov REGISTER, v0\n";
437  static const char testincl3[] =
438  "#include \"incl4.vsh\"\n";
439  static const char testincl4_ok[] =
440  "#define REGISTER r0\n"
441  "vs.1.1\n";
442  static const char testincl4_wrong[] =
443  "#error \"wrong include\"\n";
444  HRESULT hr;
446  char shader_vsh_path[MAX_PATH], shader3_vsh_path[MAX_PATH];
447  static struct D3DXIncludeImpl include = {{&D3DXInclude_Vtbl}};
448  static const WCHAR shader_filename_w[] = {'s','h','a','d','e','r','.','v','s','h',0};
449 
450  if (create_file("shader.vsh", testshader, sizeof(testshader) - 1, shader_vsh_path))
451  {
452  create_file("incl.vsh", testincl, sizeof(testincl) - 1, NULL);
453  create_file("shader3.vsh", testshader3, sizeof(testshader3) - 1, shader3_vsh_path);
454  create_file("incl4.vsh", testincl4_wrong, sizeof(testincl4_wrong) - 1, NULL);
455  if (create_directory("include"))
456  {
457  create_file("include\\incl3.vsh", testincl3, sizeof(testincl3) - 1, NULL);
458  create_file("include\\incl4.vsh", testincl4_ok, sizeof(testincl4_ok) - 1, NULL);
459 
460  /* path search #include test */
461  shader = NULL;
462  messages = NULL;
463  hr = D3DXPreprocessShaderFromFileA(shader3_vsh_path, NULL, NULL,
464  &shader, &messages);
465  ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile path search test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
466  if(messages) {
467  trace("D3DXPreprocessShaderFromFile path search messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
469  }
471  } else skip("Couldn't create \"include\" directory\n");
472 
473  /* D3DXPreprocessShaderFromFile + #include test */
474  shader = NULL;
475  messages = NULL;
476  hr = D3DXPreprocessShaderFromFileA(shader_vsh_path,
477  NULL, NULL,
478  &shader, &messages);
479  ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
480  if(messages) {
481  trace("D3DXPreprocessShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
483  }
485 
486  /* D3DXPreprocessShaderFromFile + pInclude test */
487  shader = NULL;
488  messages = NULL;
489  hr = D3DXPreprocessShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
490  &shader, &messages);
491  ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile + pInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
492  if(messages) {
493  trace("D3DXPreprocessShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
495  }
497 
498  delete_file("shader.vsh");
499  delete_file("incl.vsh");
500  delete_file("shader3.vsh");
501  delete_file("incl4.vsh");
502  delete_file("include\\incl3.vsh");
503  delete_file("include\\incl4.vsh");
504  delete_directory("include");
505 
506  /* The main shader is also to be loaded through the ID3DXInclude object. */
507  shader = NULL;
508  messages = NULL;
509  hr = D3DXPreprocessShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
510  &shader, &messages);
511  ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
512  hr, hr & 0x0000ffff);
513  if (messages)
514  {
515  trace("D3DXPreprocessShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
517  }
518  if (shader)
520 
521  shader = NULL;
522  messages = NULL;
523  hr = D3DXPreprocessShaderFromFileW(shader_filename_w, NULL, &include.ID3DXInclude_iface,
524  &shader, &messages);
525  ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
526  hr, hr & 0x0000ffff);
527  if (messages)
528  {
529  trace("D3DXPreprocessShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
531  }
532  if (shader)
534  } else skip("Couldn't create \"shader.vsh\"\n");
535 
536  /* NULL shader tests */
537  shader = NULL;
538  messages = NULL;
539  hr = D3DXPreprocessShaderFromFileA("nonexistent.vsh",
540  NULL, NULL,
541  &shader, &messages);
542  ok(hr == D3DXERR_INVALIDDATA || hr == E_FAIL, /* I get this on WinXP */
543  "D3DXPreprocessShaderFromFile nonexistent file test failed with error 0x%x - %d\n",
544  hr, hr & 0x0000FFFF);
545  if(messages) {
546  trace("D3DXPreprocessShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
548  }
550 
551  /* D3DXPreprocessShaderFromResource test */
552  shader = NULL;
553  messages = NULL;
555  NULL, NULL,
556  &shader, &messages);
557  ok(hr == D3D_OK, "D3DXPreprocessShaderFromResource test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
558  if(messages) {
559  trace("D3DXPreprocessShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
561  }
563 
564  /* D3DXPreprocessShaderFromResource with missing shader resource test */
565  shader = NULL;
566  messages = NULL;
567  hr = D3DXPreprocessShaderFromResourceA(NULL, "notexisting",
568  NULL, NULL,
569  &shader, &messages);
570  ok(hr == D3DXERR_INVALIDDATA, "D3DXPreprocessShaderFromResource NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
571  if(messages) {
572  trace("D3DXPreprocessShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
574  }
576 }
577 
579 {
581 
583 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CloseHandle
Definition: compat.h:487
HRESULT hr
Definition: shlfolder.c:183
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TRUE
Definition: types.h:120
#define D3DERR_INVALIDCALL
static void assembleshader_test(void)
Definition: asm.c:159
#define INVALID_HANDLE_VALUE
Definition: compat.h:479
static void d3dxpreprocess_test(void)
Definition: asm.c:426
GLuint buffer
Definition: glext.h:5915
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
static HRESULT WINAPI testD3DXInclude_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE include_type, const char *filename, const void *parent_data, const void **data, UINT *bytes)
Definition: asm.c:84
const char * filename
Definition: ioapi.h:135
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ** shader
Definition: asm.c:30
#define E_FAIL
Definition: ddrawi.h:102
static BOOL create_file(const char *filename, const char *data, const unsigned int size, char *out_path)
Definition: asm.c:29
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
ID3DXInclude ID3DXInclude_iface
Definition: asm.c:156
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GENERIC_WRITE
Definition: nt_native.h:90
HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:343
BOOL WINAPI CreateDirectoryA(IN LPCSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:37
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
struct ID3DXBuffer ID3DXBuffer
Definition: d3dx8core.h:51
#define D3DXSHADER_SKIPVALIDATION
Definition: d3dx9shader.h:26
HRESULT WINAPI D3DXPreprocessShaderFromResourceA(HMODULE module, const char *resource, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:680
static const struct ID3DXIncludeVtbl D3DXInclude_Vtbl
Definition: asm.c:150
GLuint shader
Definition: glext.h:6030
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:484
#define trace
Definition: atltest.h:70
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
Definition: asm.c:30
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDB_ASMSHADER
Definition: resources.h:26
LONG HRESULT
Definition: typedefs.h:79
enum _D3DXINCLUDE_TYPE D3DXINCLUDE_TYPE
static BOOL create_directory(const char *name)
Definition: asm.c:66
#define MAX_PATH
Definition: compat.h:34
void test1(void)
Definition: hivetest.c:366
#define WINAPI
Definition: msvc.h:6
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static void delete_file(const char *filename)
Definition: asm.c:57
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static char temp_path[MAX_PATH]
Definition: asm.c:27
#define S_OK
Definition: intsafe.h:51
#define CREATE_ALWAYS
Definition: disk.h:72
#define D3D_OK
Definition: d3d.h:106
START_TEST(asm)
Definition: asm.c:1735
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2053
#define ID3DXBuffer_Release(p)
Definition: d3dx9core.h:83
HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:636
HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:320
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI RemoveDirectoryA(IN LPCSTR lpPathName)
Definition: dir.c:714
unsigned int UINT
Definition: ndis.h:50
#define skip(...)
Definition: atltest.h:64
Definition: name.c:38
static SIZE_T const char const D3D_SHADER_MACRO * defines
Definition: asm.c:30
static void delete_directory(const char *name)
Definition: asm.c:75
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:199
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:488
static HRESULT WINAPI testD3DXInclude_close(ID3DXInclude *iface, const void *data)
Definition: asm.c:144
HRESULT WINAPI D3DXAssembleShaderFromResourceA(HMODULE module, const char *resource, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:384
HRESULT WINAPI D3DXPreprocessShaderFromFileA(const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages)
Definition: shader.c:613
#define HeapFree(x, y, z)
Definition: compat.h:483
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85