52 return CreateWindowA(
"d3d9_test_wc",
"d3d9_test", 0, 0, 0, 0, 0, 0, 0, 0, 0);
55static IDirect3DDevice9 *
init_d3d9(IDirect3DVertexDeclaration9 **vdeclaration,
56 IDirect3DVertexBuffer9 **quad_geometry, IDirect3DVertexShader9 **vshader_passthru)
58 static const struct vertex quad_vertices[4] =
60 {-1.0f, -1.0f, 0.0f, 0.0f, 1.0f},
61 {-1.0f, 1.0f, 0.0f, 0.0f, 0.0f},
62 { 1.0f, -1.0f, 0.0f, 1.0f, 1.0f},
63 { 1.0f, 1.0f, 0.0f, 1.0f, 0.0f}
73 static const char *vshader_passthru_hlsl =
74 "float4 vshader(float4 pos: POSITION, inout float2 texcoord: TEXCOORD0): POSITION\n"
80 IDirect3DDevice9 *device_ptr =
NULL;
83 void *temp_geometry_vertices;
93 skip(
"could not create D3D9\n");
101 skip(
"A32B32G32R32F format not available on this device\n");
106 ZeroMemory(&present_parameters,
sizeof(present_parameters));
116 skip(
"could not create Direct3D9 device\n");
124 "Could not create vertex buffer, IDirect3DDevice9_CreateVertexBuffer returned: %08x\n",
hr);
128 memcpy(temp_geometry_vertices, quad_vertices,
sizeof(quad_vertices));
133 "IDirect3DDevice9_CreateVertexDeclaration returned: %08x\n",
hr);
136 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_SetVertexDeclaration returned: %08x\n",
hr);
140 NULL,
NULL,
"vshader",
"vs_1_1", 0, 0, &compiled, &errors);
143 skip(
"not compiling vertex shader due to lacking wine HLSL support!\n");
145 ID3D10Blob_Release(errors);
151 ok(
SUCCEEDED(
hr),
"IDirect3DDevice9_CreateVertexShader returned: %08x\n",
hr);
152 ID3D10Blob_Release(compiled);
159 float x,
float y,
float z,
float w)
175 IDirect3DPixelShader9 *pshader;
180 0, 0, &compiled, &errors);
182 errors ? (
char *)ID3D10Blob_GetBufferPointer(errors) :
"");
186 ok(
hr ==
D3D_OK,
"Could not get constant table from compiled pixel shader\n");
189 ok(
SUCCEEDED(
hr),
"IDirect3DDevice9_CreatePixelShader returned: %08x\n",
hr);
190 ID3D10Blob_Release(compiled);
204 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_Clear returned: %08x\n",
hr);
207 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_BeginScene returned: %08x\n",
hr);
210 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_SetStreamSource returned: %08x\n",
hr);
212 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_DrawPrimitive returned: %08x\n",
hr);
215 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_EndScene returned: %08x\n",
hr);
220 IDirect3DVertexShader9 *vshader, IDirect3DPixelShader9 *pshader)
225 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_CreateRenderTarget returned: %08x\n",
hr);
231 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_CreateOffscreenPlainSurface returned: %08x\n",
hr);
234 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_SetRenderTarget returned: %08x\n",
hr);
237 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_SetVertexShader returned: %08x\n",
hr);
239 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_SetPixelShader returned: %08x\n",
hr);
244 return (
fabs(
a.r -
b.r) < epsilon &&
fabs(
a.g -
b.g) < epsilon &&
fabs(
a.b -
b.b) < epsilon &&
245 fabs(
a.a -
b.a) < epsilon);
251 IDirect3DPixelShader9 *pshader, IDirect3DVertexBuffer9 *quad_geometry,
255 IDirect3DSurface9 *render_target;
256 IDirect3DSurface9 *readback;
270 ok(
hr ==
D3D_OK,
"IDirect3DSurface9_LockRect returned: %08x\n",
hr);
271 pbits_data = lr.
pBits;
274 for (
i = 0;
i <
count;
i++, probes++) {
277 "Line %d: At (%d, %d): %s: Expected (%.04f,%.04f,%.04f, %.04f), got "
279 probes->
c.
r, probes->
c.
g, probes->
c.
b, probes->
c.
a, pbits_data[
index].
r,
284 ok(
hr ==
D3D_OK,
"IDirect3DSurface9_UnlockRect returned: %08x\n",
hr);
291 ok(
hr ==
D3D_OK,
"IDirect3DDevice9_Present returned: %08x\n",
hr);
299 IDirect3DVertexShader9 *vshader_passthru)
303 {0, 0, {0.0101f, 0.0303f, 0.0202f, 0.0404f}, 0.0001f,
"swizzle_test"}
306 static const char *swizzle_test_shader =
307 "uniform float4 color;\n"
308 "float4 test(): COLOR\n"
310 " float4 ret = color;\n"
311 " ret.gb = ret.ra;\n"
312 " ret.ra = float2(0.0101, 0.0404);\n"
317 IDirect3DPixelShader9 *pshader;
333 IDirect3DVertexShader9 *vshader_passthru)
336 static const float u = 2.5f,
v = 0.3f,
w = 0.2f,
x = 0.7f,
y = 0.1f,
z = 1.5f;
340 {0, 0, {-12.4300f, 9.8333f, 1.6000f, 34.9999f}, 0.0001f,
341 "order of operations test"}
344 static const char *order_of_operations_shader =
345 "float4 test(uniform float u, uniform float v, uniform float w, uniform float x,\n"
346 " uniform float y, uniform float z): COLOR\n"
348 " return float4(x * y - z / w + --u / -v,\n"
349 " z * x / y + w / -v,\n"
355 IDirect3DPixelShader9 *pshader;
376 IDirect3DVertexShader9 *vshader_passthru)
380 { 0, 0, {0.9f, 0.8f, 0.7f, 0.6f}, 0.0001f,
"if greater test"},
381 { 5, 0, {0.9f, 0.8f, 0.7f, 0.6f}, 0.0001f,
"if greater test"},
382 {10, 0, {0.9f, 0.8f, 0.7f, 0.6f}, 0.0001f,
"if greater test"},
383 {15, 0, {0.9f, 0.8f, 0.7f, 0.6f}, 0.0001f,
"if greater test"},
384 {25, 0, {0.1f, 0.2f, 0.3f, 0.4f}, 0.0001f,
"if greater test"},
385 {30, 0, {0.1f, 0.2f, 0.3f, 0.4f}, 0.0001f,
"if greater test"}
388 static const char *if_greater_shader =
389 "float4 test(float2 pos: TEXCOORD0): COLOR\n"
391 " if((pos.x * 32.0) > 20.0)\n"
392 " return float4(0.1, 0.2, 0.3, 0.4);\n"
394 " return float4(0.9, 0.8, 0.7, 0.6);\n"
399 {0, 0, {0.50f, 0.25f, 0.50f, 0.75f}, 0.00001f,
"ternary operator test"},
400 {1, 0, {0.50f, 0.25f, 0.50f, 0.75f}, 0.00001f,
"ternary operator test"},
401 {2, 0, {0.50f, 0.25f, 0.50f, 0.75f}, 0.00001f,
"ternary operator test"},
402 {3, 0, {0.50f, 0.25f, 0.50f, 0.75f}, 0.00001f,
"ternary operator test"},
403 {4, 0, {0.60f, 0.80f, 0.10f, 0.20f}, 0.00001f,
"ternary operator test"},
404 {5, 0, {0.60f, 0.80f, 0.10f, 0.20f}, 0.00001f,
"ternary operator test"},
405 {6, 0, {0.60f, 0.80f, 0.10f, 0.20f}, 0.00001f,
"ternary operator test"},
406 {7, 0, {0.60f, 0.80f, 0.10f, 0.20f}, 0.00001f,
"ternary operator test"}
409 static const char *ternary_operator_shader =
410 "float4 test(float2 pos: TEXCOORD0): COLOR\n"
412 " return (pos.x < 0.5?float4(0.5, 0.25, 0.5, 0.75):float4(0.6, 0.8, 0.1, 0.2));\n"
416 IDirect3DPixelShader9 *pshader;
422 ARRAY_SIZE(if_greater_probes), 32, 1, __LINE__);
432 ARRAY_SIZE(ternary_operator_probes), 8, 1, __LINE__);
440 IDirect3DVertexShader9 *vshader_passthru)
444 {0, 0, {0.020f, 0.245f, 0.351f, 1.000f}, 0.0001f,
"vec4 indexing test 1"}
447 static const char *vec4_indexing_test1_shader =
448 "float4 test(): COLOR\n"
451 " color[0] = 0.020;\n"
452 " color[1] = 0.245;\n"
453 " color[2] = 0.351;\n"
460 {0, 0, {0.5f, 0.3f, 0.8f, 0.2f}, 0.0001f,
"vec4 indexing test 2"}
464 static const char *vec4_indexing_test2_shader =
466 "float4 test(): COLOR\n"
468 " float4 color = float4(0.5, 0.4, 0.3, 0.2);\n"
469 " color.g = color[i];\n"
475 IDirect3DPixelShader9 *pshader;
481 ARRAY_SIZE(vec4_indexing_test1_probes), 1, 1, __LINE__);
493 ARRAY_SIZE(vec4_indexing_test2_probes), 32, 1, __LINE__);
501 IDirect3DVertexShader9 *vshader_passthru)
505 {0, 0, {0.5000f, 1.0000f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
506 {1, 0, {0.5975f, 0.9904f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
507 {2, 0, {0.6913f, 0.9620f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
508 {3, 0, {0.7778f, 0.9160f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
509 {4, 0, {0.8536f, 0.8536f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
510 {5, 0, {0.9157f, 0.7778f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
511 {6, 0, {0.9620f, 0.6913f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
512 {7, 0, {0.9904f, 0.5975f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
513 {8, 0, {1.0000f, 0.5000f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
514 {9, 0, {0.9904f, 0.4025f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
515 {10, 0, {0.9619f, 0.3087f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
516 {11, 0, {0.9157f, 0.2222f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
517 {12, 0, {0.8536f, 0.1464f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
518 {13, 0, {0.7778f, 0.0843f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
519 {14, 0, {0.6913f, 0.0381f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
520 {15, 0, {0.5975f, 0.0096f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
521 {16, 0, {0.5000f, 0.0000f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
522 {17, 0, {0.4025f, 0.0096f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
523 {18, 0, {0.3087f, 0.0381f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
524 {19, 0, {0.2222f, 0.0843f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
525 {20, 0, {0.1464f, 0.1464f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
526 {21, 0, {0.0843f, 0.2222f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
527 {22, 0, {0.0381f, 0.3087f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
528 {23, 0, {0.0096f, 0.4025f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
529 {24, 0, {0.0000f, 0.5000f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
530 {25, 0, {0.0096f, 0.5975f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
531 {26, 0, {0.0381f, 0.6913f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
532 {27, 0, {0.0843f, 0.7778f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
533 {28, 0, {0.1464f, 0.8536f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
534 {29, 0, {0.2222f, 0.9157f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
535 {30, 0, {0.3087f, 0.9619f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
536 {31, 0, {0.4025f, 0.9904f, 0.0f, 0.0f}, 0.001f,
"sin/cos test"},
539 static const char *sincos_shader =
540 "float4 test(float x: TEXCOORD0): COLOR\n"
542 " const float pi2 = 6.2831853;\n"
543 " float calcd_sin = (sin(x * pi2) + 1)/2;\n"
544 " float calcd_cos = (cos(x * pi2) + 1)/2;\n"
545 " return float4(calcd_sin, calcd_cos, 0, 0);\n"
549 IDirect3DPixelShader9 *pshader;
562static void test_fail(IDirect3DDevice9 *
device, IDirect3DVertexBuffer9 *qquad_geometry,
563 IDirect3DVertexShader9 *vshader_passthru)
565 static const char *
tests[] =
567 "float4 test(float2 pos: TEXCOORD0) : COLOR\n"
572 "float4 test(float2 pos: TEXCOORD0) : COLOR\n"
574 " float4 x = float4(0, 0, 0, 0);\n"
575 " x.xzzx = float4(1, 2, 3, 4);\n"
579 "float4 test(float2 pos: TEXCOORD0) : COLOR\n"
585 "float4 test(float2 pos, TEXCOORD0) ; COLOR\n"
588 " mul(float4(5, 4, 3, 2), mvp) = x;\n"
592 "float4 563r(float2 45s: TEXCOORD0) : COLOR\n"
595 " return float4(x.x, x.y, 0, 0);\n"
598 "float4 test(float2 pos: TEXCOORD0) : COLOR\n"
600 " struct { int b,c; } x = {0};\n"
604 "float4 test(float2 pos: TEXCOORD0) : COLOR\n"
606 " struct {} x = {};\n"
617 compiled = errors =
NULL;
618 hr =
ppD3DCompile(
tests[
i],
strlen(
tests[
i]),
NULL,
NULL,
NULL,
"test",
"ps_2_0", 0, 0, &compiled, &errors);
619 ok(
hr ==
E_FAIL,
"Test %u, got unexpected hr %#x.\n",
i,
hr);
620 ok(!!errors,
"Test %u, expected non-NULL error blob.\n",
i);
621 ok(!compiled,
"Test %u, expected no compiled shader blob.\n",
i);
622 ID3D10Blob_Release(errors);
641 IDirect3DVertexDeclaration9 *vdeclaration;
642 IDirect3DVertexBuffer9 *quad_geometry;
643 IDirect3DVertexShader9 *vshader_passthru;
647 win_skip(
"Could not load d3dcompiler_43.dll\n");
668 }
else skip(
"no pixel shader support\n");
671 if (vshader_passthru)
674 ok(!refcount,
"Pass-through vertex shader has %u references left\n", refcount);
678 ok(!refcount,
"Vertex buffer has %u references left\n", refcount);
681 ok(!refcount,
"Vertex declaration has %u references left\n", refcount);
684 ok(!refcount,
"Device has %u references left\n", refcount);
ACPI_SIZE strlen(const char *String)
#define D3DPS_VERSION(major, minor)
#define D3DUSAGE_WRITEONLY
enum _D3DFORMAT D3DFORMAT
#define D3DCOLOR_XRGB(r, g, b)
IDirect3D9 *WINAPI Direct3DCreate9(UINT SDKVersion)
#define IDirect3DDevice9_EndScene(p)
#define IDirect3DDevice9_BeginScene(p)
#define IDirect3DVertexBuffer9_Unlock(p)
#define IDirect3DDevice9_CreatePixelShader(p, a, b)
#define IDirect3DDevice9_CreateVertexDeclaration(p, a, b)
#define IDirect3DVertexBuffer9_Release(p)
#define IDirect3DSurface9_LockRect(p, a, b, c)
#define IDirect3D9_CreateDevice(p, a, b, c, d, e, f)
#define IDirect3DVertexBuffer9_Lock(p, a, b, c, d)
#define IDirect3DDevice9_GetRenderTargetData(p, a, b)
#define IDirect3DDevice9_SetRenderTarget(p, a, b)
#define IDirect3DDevice9_SetPixelShader(p, a)
#define IDirect3DDevice9_Present(p, a, b, c, d)
#define IDirect3DDevice9_GetDeviceCaps(p, a)
#define IDirect3DVertexDeclaration9_Release(p)
#define IDirect3DDevice9_SetStreamSource(p, a, b, c, d)
#define IDirect3DDevice9_SetTransform(p, a, b)
#define IDirect3DPixelShader9_Release(p)
#define IDirect3D9_Release(p)
#define IDirect3DVertexShader9_Release(p)
#define IDirect3DDevice9_DrawPrimitive(p, a, b, c)
#define IDirect3DDevice9_SetVertexShader(p, a)
#define IDirect3DDevice9_Release(p)
#define IDirect3DDevice9_Clear(p, a, b, c, d, e, f)
#define IDirect3D9_CheckDeviceFormat(p, a, b, c, d, e, f)
#define IDirect3DSurface9_UnlockRect(p)
#define IDirect3DDevice9_CreateVertexBuffer(p, a, b, c, d, e, f)
#define IDirect3DSurface9_Release(p)
#define IDirect3DDevice9_SetVertexDeclaration(p, a)
#define IDirect3DDevice9_CreateRenderTarget(p, a, b, c, d, e, f, g, h)
#define IDirect3DDevice9_CreateVertexShader(p, a, b)
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
HRESULT(WINAPI * pD3DCompile)(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)
#define ID3DXConstantTable_Release(p)
#define ID3DXConstantTable_SetVector(p, a, b, c)
#define ID3DXConstantTable_SetFloat(p, a, b, c)
#define ID3DXConstantTable_SetInt(p, a, b, c)
D3DXMATRIX *WINAPI D3DXMatrixOrthoLH(D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
HRESULT WINAPI D3DXGetShaderConstantTable(const DWORD *byte_code, ID3DXConstantTable **constant_table)
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
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
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 * u
static pD3DCompile ppD3DCompile
static IDirect3DPixelShader9 * compile_pixel_shader9(IDirect3DDevice9 *device, const char *shader, const char *profile, ID3DXConstantTable **constants)
static void test_math(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry, IDirect3DVertexShader9 *vshader_passthru)
static BOOL colors_match(D3DXCOLOR a, D3DXCOLOR b, float epsilon)
static IDirect3DDevice9 * init_d3d9(IDirect3DVertexDeclaration9 **vdeclaration, IDirect3DVertexBuffer9 **quad_geometry, IDirect3DVertexShader9 **vshader_passthru)
static void test_fail(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *qquad_geometry, IDirect3DVertexShader9 *vshader_passthru)
static void draw_quad_with_shader9(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry)
static void test_trig(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry, IDirect3DVertexShader9 *vshader_passthru)
static void set_float4_d3d9(IDirect3DDevice9 *device, ID3DXConstantTable *constants, const char *name, float x, float y, float z, float w)
static void setup_device9(IDirect3DDevice9 *device, IDirect3DSurface9 **render_target, IDirect3DSurface9 **readback, D3DFORMAT format, unsigned int width, unsigned int height, IDirect3DVertexShader9 *vshader, IDirect3DPixelShader9 *pshader)
static void test_conditionals(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry, IDirect3DVertexShader9 *vshader_passthru)
static void test_float_vectors(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry, IDirect3DVertexShader9 *vshader_passthru)
static HWND create_window(void)
static void test_swizzle(IDirect3DDevice9 *device, IDirect3DVertexBuffer9 *quad_geometry, IDirect3DVertexShader9 *vshader_passthru)
static void compute_shader_probe9(IDirect3DDevice9 *device, IDirect3DVertexShader9 *vshader, IDirect3DPixelShader9 *pshader, IDirect3DVertexBuffer9 *quad_geometry, const struct hlsl_probe_info *probes, unsigned int count, unsigned int width, unsigned int height, unsigned int line_number)
static BOOL load_d3dcompiler(void)
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
#define memcpy(s1, s2, n)
static struct test_info tests[]
#define D3DADAPTER_DEFAULT
#define D3DCREATE_HARDWARE_VERTEXPROCESSING
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)