42#define compile_shader(a, b) compile_shader_(__LINE__, a, b, 0)
43#define compile_shader_flags(a, b, c) compile_shader_(__LINE__, a, b, c)
49 hr =
D3DCompile(
source,
strlen(
source),
NULL,
NULL,
NULL,
"main",
target,
flags, 0, &
blob, &errors);
50 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to compile shader, hr %#lx.\n",
hr);
54 trace_(__FILE__,
line)(
"%s\n", (
char *)ID3D10Blob_GetBufferPointer(errors));
55 ID3D10Blob_Release(errors);
62 unsigned int diff =
x >
y ?
x -
y :
y -
x;
64 return diff <= max_diff;
94 ID3D11RenderTargetView *
rtv;
98 ID3D11VertexShader *
vs;
135 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
137 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
140 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
160 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
166#define init_test_context(a) init_test_context_(__LINE__, a)
169 const D3D11_TEXTURE2D_DESC texture_desc =
176 .SampleDesc.Count = 1,
177 .Usage = D3D11_USAGE_DEFAULT,
178 .BindFlags = D3D11_BIND_RENDER_TARGET,
180 unsigned int rt_width, rt_height;
189 skip_(__FILE__,
line)(
"Failed to create device.\n");
202 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to create texture, hr %#lx.\n",
hr);
205 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to create rendertarget view, hr %#lx.\n",
hr);
207 ID3D11Device_GetImmediateContext(
context->device, &
context->immediate_context);
209 ID3D11DeviceContext_OMSetRenderTargets(
context->immediate_context, 1, &
context->rtv,
NULL);
214 vp.Height = rt_height;
217 ID3D11DeviceContext_RSSetViewports(
context->immediate_context, 1, &vp);
222#define release_test_context(context) release_test_context_(__LINE__, context)
228 ID3D11InputLayout_Release(
context->input_layout);
230 ID3D11VertexShader_Release(
context->vs);
232 ID3D11Buffer_Release(
context->vb);
234 ID3D11DeviceContext_Release(
context->immediate_context);
235 ID3D11RenderTargetView_Release(
context->rtv);
236 ID3D11Texture2D_Release(
context->rt);
237 IDXGISwapChain_Release(
context->swapchain);
241 ok_(__FILE__,
line)(!
ref,
"Device has %lu references left.\n",
ref);
244#define create_buffer(a, b, c, d) create_buffer_(__LINE__, a, b, c, d)
246 unsigned int bind_flags,
unsigned int size,
const void *
data)
249 D3D11_BUFFER_DESC buffer_desc =
252 .Usage = D3D11_USAGE_DEFAULT,
253 .BindFlags = bind_flags,
259 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to create buffer, hr %#lx.\n",
hr);
263#define draw_quad(context, ps_code) draw_quad_(__LINE__, context, ps_code)
271 static const char vs_source[] =
272 "float4 main(float4 position : POSITION) : SV_POSITION\n"
274 " return position;\n"
287 ID3D11PixelShader *ps;
294 hr = ID3D11Device_CreateInputLayout(
device, default_layout_desc,
ARRAY_SIZE(default_layout_desc),
295 ID3D10Blob_GetBufferPointer(vs_code), ID3D10Blob_GetBufferSize(vs_code), &
context->input_layout);
296 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to create input layout, hr %#lx.\n",
hr);
298 hr = ID3D11Device_CreateVertexShader(
device, ID3D10Blob_GetBufferPointer(vs_code),
299 ID3D10Blob_GetBufferSize(vs_code),
NULL, &
context->vs);
300 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to create vertex shader, hr %#lx.\n",
hr);
306 hr = ID3D11Device_CreatePixelShader(
device, ID3D10Blob_GetBufferPointer(ps_code),
307 ID3D10Blob_GetBufferSize(ps_code),
NULL, &ps);
308 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to create pixel shader, hr %#lx.\n",
hr);
310 ID3D11DeviceContext_IASetInputLayout(
context->immediate_context,
context->input_layout);
316 ID3D11DeviceContext_PSSetShader(
context->immediate_context, ps,
NULL, 0);
318 ID3D11DeviceContext_Draw(
context->immediate_context, 4, 0);
320 ID3D11PixelShader_Release(ps);
331 D3D11_TEXTURE2D_DESC texture_desc;
334 ID3D11Texture2D_GetDesc(
context->rt, &texture_desc);
335 texture_desc.Usage = D3D11_USAGE_STAGING;
336 texture_desc.BindFlags = 0;
337 texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
338 texture_desc.MiscFlags = 0;
339 hr = ID3D11Device_CreateTexture2D(
context->device, &texture_desc,
NULL, (ID3D11Texture2D **)&rb->
resource);
340 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
342 ID3D11DeviceContext_CopyResource(
context->immediate_context, rb->
resource, (ID3D11Resource *)
context->rt);
344 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
349 ID3D11DeviceContext_Unmap(
context->immediate_context, rb->
resource, 0);
350 ID3D11Resource_Release(rb->
resource);
371 static const struct vec4 uniform = {0.0303f, 0.0f, 0.0f, 0.0202f};
377 static const char ps_source[] =
378 "uniform float4 color;\n"
379 "float4 main() : SV_TARGET\n"
381 " float4 ret = color;\n"
382 " ret.gb = ret.ra;\n"
383 " ret.ra = float2(0.0101, 0.0404);\n"
397 "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n",
v.x,
v.y,
v.z,
v.w);
399 ID3D11Buffer_Release(
cb);
400 ID3D10Blob_Release(ps_code);
406 static const float uniforms[8] = {2.5f, 0.3f, 0.2f, 0.7f, 0.1f, 1.5f};
412 static const char ps_source[] =
413 "float4 main(uniform float u, uniform float v, uniform float w, uniform float x,\n"
414 " uniform float y, uniform float z) : SV_TARGET\n"
416 " return float4(x * y - z / w + --u / -v,\n"
417 " z * x / y + w / -v,\n"
432 "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n",
v.x,
v.y,
v.z,
v.w);
434 ID3D11Buffer_Release(
cb);
435 ID3D10Blob_Release(ps_code);
443 const struct vec4 *
v;
447 static const char ps_source[] =
448 "float4 main(float4 pos : SV_POSITION) : SV_TARGET\n"
450 " if(pos.x > 200.0)\n"
451 " return float4(0.1, 0.2, 0.3, 0.4);\n"
453 " return float4(0.9, 0.8, 0.7, 0.6);\n"
463 for (
i = 0;
i < 200;
i += 40)
467 "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n",
v->x,
v->y,
v->z,
v->w);
470 for (
i = 240;
i < 640;
i += 40)
474 "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n",
v->x,
v->y,
v->z,
v->w);
478 ID3D10Blob_Release(ps_code);
486 const struct vec4 *
v;
490 static const char ps_source[] =
491 "float4 main(float4 pos : SV_POSITION) : SV_TARGET\n"
493 " return float4(sin(pos.x - 0.5), cos(pos.x - 0.5), 0, 0);\n"
503 for (
i = 0;
i < 640;
i += 20)
507 "Test %u: Got {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n",
512 ID3D10Blob_Release(ps_code);
518 D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc = {0};
520 ID3D11ShaderResourceView *srv;
528 static const char *
tests[] =
531 "float4 main() : COLOR\n"
533 " return tex2D(s, float2(0.5, 0.5));\n"
537 "float4 main() : COLOR\n"
539 " return tex2D(s, float2(0.5, 0.5));\n"
543 "float4 main() : COLOR\n"
545 " return tex2D(s, float2(0.5, 0.5));\n"
550 "float4 main() : COLOR\n"
552 " return t.Sample(s, float2(0.5, 0.5));\n"
557 "float4 main() : COLOR\n"
559 " return t.Sample(s, float2(0.5, 0.5));\n"
563 static const D3D11_TEXTURE2D_DESC texture_desc =
570 .SampleDesc.Count = 1,
571 .Usage = D3D11_USAGE_DEFAULT,
572 .BindFlags = D3D11_BIND_SHADER_RESOURCE,
575 static const float texture_data[] =
577 0.0f, 0.0f, 0.0f, 0.0f,
578 0.0f, 0.0f, 0.0f, 0.0f,
579 0.0f, 0.0f, 0.0f, 0.0f,
580 1.0f, 0.0f, 1.0f, 0.0f,
583 static const D3D11_SUBRESOURCE_DATA
resource_data = {&texture_data,
sizeof(texture_data) / 2};
585 static const D3D11_SAMPLER_DESC sampler_desc =
588 .AddressU = D3D11_TEXTURE_ADDRESS_WRAP,
589 .AddressV = D3D11_TEXTURE_ADDRESS_WRAP,
590 .AddressW = D3D11_TEXTURE_ADDRESS_WRAP,
593 static const float red[] = {1.0f, 0.0f, 0.0f, 1.0f};
599 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
602 srv_desc.Texture2D.MipLevels = 1;
604 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
608 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
621 "Got unexpected value {%.8e, %.8e, %.8e, %.8e}.\n",
v.x,
v.y,
v.z,
v.w);
623 ID3D10Blob_Release(ps_code);
628 ID3D11Texture2D_Release(
texture);
629 ID3D11SamplerState_Release(
sampler);
630 ID3D11ShaderResourceView_Release(srv);
640 ok(
type->Elements ==
expect->Elements,
"Got %u elements.\n",
type->Elements);
651 ok(
desc->BindPoint ==
expect->BindPoint,
"Got bind point %u.\n",
desc->BindPoint);
652 ok(
desc->BindCount ==
expect->BindCount,
"Got bind count %u.\n",
desc->BindCount);
654 ok(
desc->ReturnType ==
expect->ReturnType,
"Got return type %#x.\n",
desc->ReturnType);
655 ok(
desc->Dimension ==
expect->Dimension,
"Got dimension %#x.\n",
desc->Dimension);
656 ok(
desc->NumSamples ==
expect->NumSamples,
"Got multisample count %u.\n",
desc->NumSamples);
670 unsigned int i,
j,
k;
674 static const char vs_source[] =
675 "typedef uint uint_t;\n"
696 " row_major float3x1 l;\n"
697 "#pragma pack_matrix(row_major)\n"
701 " struct r_name {float a;} r;\n"
702 " column_major float3x1 t;\n"
705 "cbuffer b5 : register(b5)\n"
710 "float4 main(uniform float4 n) : SV_POSITION\n"
712 " return o._31 + m + n + u;\n"
715 struct shader_variable
734 static const struct shader_variable globals_vars =
735 {{
"m", 0, 4,
D3D_SVF_USED}, {
D3D_SVC_SCALAR,
D3D_SVT_FLOAT, 1, 1, 0, 0, 0,
"float"}};
736 static const struct shader_variable params_vars =
737 {{
"n", 0, 16,
D3D_SVF_USED}, {
D3D_SVC_VECTOR,
D3D_SVT_FLOAT, 1, 4, 0, 0, 0,
"float4"}};
738 static const struct shader_variable buffer_vars[] =
740 {{
"a", 0, 4}, {
D3D_SVC_SCALAR,
D3D_SVT_FLOAT, 1, 1, 0, 0, 0,
"float"}},
741 {{
"b", 4, 8}, {
D3D_SVC_VECTOR,
D3D_SVT_FLOAT, 1, 2, 0, 0, 0,
"float2"}},
742 {{
"c", 16, 16}, {
D3D_SVC_VECTOR,
D3D_SVT_FLOAT, 1, 4, 0, 0, 0,
"float4"}},
743 {{
"d", 32, 4}, {
D3D_SVC_SCALAR,
D3D_SVT_FLOAT, 1, 1, 0, 0, 0,
"float"}},
744 {{
"s", 48, 24}, {
D3D_SVC_STRUCT,
D3D_SVT_VOID, 1, 6, 0,
ARRAY_SIZE(s_field_types), 0,
"<unnamed>"}, s_field_types},
745 {{
"g", 72, 4}, {
D3D_SVC_SCALAR,
D3D_SVT_BOOL, 1, 1, 0, 0, 0,
"bool"}},
746 {{
"h", 80, 20}, {
D3D_SVC_SCALAR,
D3D_SVT_FLOAT, 1, 1, 2, 0, 0,
"float"}},
747 {{
"i", 100, 4}, {
D3D_SVC_SCALAR,
D3D_SVT_INT, 1, 1, 0, 0, 0,
"int"}},
748 {{
"j", 104, 4}, {
D3D_SVC_SCALAR,
D3D_SVT_UINT, 1, 1, 0, 0, 0,
"uint_t"}},
749 {{
"k", 112, 12}, {
D3D_SVC_MATRIX_COLUMNS,
D3D_SVT_FLOAT, 3, 1, 0, 0, 0,
"float3x1"}},
750 {{
"l", 128, 36}, {
D3D_SVC_MATRIX_ROWS,
D3D_SVT_FLOAT, 3, 1, 0, 0, 0,
"float3x1"}},
751 {{
"o", 176, 36,
D3D_SVF_USED}, {
D3D_SVC_MATRIX_ROWS,
D3D_SVT_FLOAT, 3, 1, 0, 0, 0,
"float3x1"}},
752 {{
"p", 224, 16}, {
D3D_SVC_VECTOR,
D3D_SVT_FLOAT, 1, 4, 0, 0, 0,
"float4"}},
753 {{
"q", 240, 4}, {
D3D_SVC_SCALAR,
D3D_SVT_FLOAT, 1, 1, 0, 0, 0,
"float"}},
754 {{
"r", 256, 4}, {
D3D_SVC_STRUCT,
D3D_SVT_VOID, 1, 1, 0,
ARRAY_SIZE(r_field_types), 0,
"r_name"}, r_field_types},
755 {{
"t", 260, 12}, {
D3D_SVC_MATRIX_COLUMNS,
D3D_SVT_FLOAT, 3, 1, 0, 0, 0,
"float3x1"}},
757 static const struct shader_variable b5_vars =
758 {{
"u", 0, 16,
D3D_SVF_USED}, {
D3D_SVC_VECTOR,
D3D_SVT_FLOAT, 1, 4, 0, 0, 0,
"float4"}};
763 const struct shader_variable *vars;
781 static const char ps_source[] =
784 "SamplerState d {};\n"
796 "sampler b : register(s5);\n"
797 "float4 main(float2 pos : texcoord) : SV_TARGET\n"
799 " return a.Sample(b, pos) + a.Sample(c, pos) + a.Sample(d, pos) + tex2D(f, pos) + tex2D(e, pos)"
800 " + tex2D(g, pos);\n"
820 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
822 hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
823 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
831 cbuffer = reflection->lpVtbl->GetConstantBufferByIndex(reflection,
i);
832 hr = cbuffer->lpVtbl->GetDesc(cbuffer, &buffer_desc);
833 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
835 ok(buffer_desc.
Type == vs_buffers[
i].desc.Type,
"Got type %#x.\n", buffer_desc.
Type);
836 ok(buffer_desc.
Variables == vs_buffers[
i].desc.Variables,
"Got %u variables.\n", buffer_desc.
Variables);
837 ok(buffer_desc.
Size == vs_buffers[
i].desc.Size,
"Got size %u.\n", buffer_desc.
Size);
838 ok(buffer_desc.
uFlags == vs_buffers[
i].desc.uFlags,
"Got flags %#x.\n", buffer_desc.
uFlags);
842 const struct shader_variable *
expect = &vs_buffers[
i].vars[
j];
846 var = cbuffer->lpVtbl->GetVariableByIndex(cbuffer,
j);
847 hr =
var->lpVtbl->GetDesc(
var, &var_desc);
848 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
851 ok(var_desc.
Size ==
expect->var_desc.Size,
"Got size %u.\n", var_desc.
Size);
857 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
866 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
884 hr = reflection->lpVtbl->GetResourceBindingDesc(reflection,
i, &
desc);
885 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
891 ID3D10Blob_Release(
code);
892 refcount = reflection->lpVtbl->Release(reflection);
893 ok(!refcount,
"Got unexpected refcount %lu.\n", refcount);
898 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
900 hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
901 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
911 hr = reflection->lpVtbl->GetResourceBindingDesc(reflection,
i, &
desc);
912 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
918 ID3D10Blob_Release(
code);
919 refcount = reflection->lpVtbl->Release(reflection);
920 ok(!refcount,
"Got unexpected refcount %lu.\n", refcount);
928 ok(
desc->SemanticIndex ==
expect->SemanticIndex,
"Got index %u.\n",
desc->SemanticIndex);
929 ok(
desc->Register ==
expect->Register,
"Got register %u.\n",
desc->Register);
931 ok(
desc->SystemValueType ==
expect->SystemValueType,
"Got sysval %u.\n",
desc->SystemValueType);
932 ok(
desc->ComponentType ==
expect->ComponentType,
"Got data type %u.\n",
desc->ComponentType);
935 ok(
desc->ReadWriteMask ==
expect->ReadWriteMask,
"Got used mask %#x.\n",
desc->ReadWriteMask);
949 static const char vs1_source[] =
951 " in float4 a : apple,\n"
952 " out float4 b : banana2,\n"
953 " inout float4 c : color,\n"
954 " inout float4 d : depth,\n"
955 " inout float4 e : sv_position,\n"
956 " in uint3 f : fruit,\n"
957 " inout bool2 g : grape,\n"
958 " in int h : honeydew)\n"
983 static const char vs2_source[] =
984 "void main(inout float4 pos : position)\n"
1003 static const char ps1_source[] =
1005 " in float2 a : apple,\n"
1006 " out float4 b : sv_target2,\n"
1007 " out float c : sv_depth,\n"
1008 " in float4 d : position,\n"
1009 " in float4 e : sv_position)\n"
1028 static const char ps2_source[] =
1030 " inout float4 a : color2,\n"
1031 " inout float b : depth,\n"
1032 " in float4 c : position)\n"
1049 static const char cs1_source[] =
1050 "[numthreads(1, 1, 1)]\n"
1051 "void main(in uint a : sv_dispatchthreadid)\n"
1055 static const char gs1_source[] =
1058 " float4 a : sv_position;\n"
1059 " float4 b : apple2;\n"
1063 " float4 a : sv_position;\n"
1064 " float4 b : apple2;\n"
1065 " uint c : sv_primitiveid;\n"
1067 "[maxvertexcount(1)]\n"
1069 " point input i[1],\n"
1070 " inout PointStream<vertex> o,\n"
1071 " uint a : sv_primitiveid)\n"
1073 " struct vertex v;\n"
1100 unsigned int input_count;
1102 unsigned int output_count;
1109 {vs2_source,
"vs_4_0",
TRUE, vs2_inputs,
ARRAY_SIZE(vs2_inputs), vs2_legacy_outputs,
ARRAY_SIZE(vs2_legacy_outputs)},
1130 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1132 hr = reflection->lpVtbl->GetDesc(reflection, &shader_desc);
1133 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1142 hr = reflection->lpVtbl->GetInputParameterDesc(reflection,
j, &
desc);
1143 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1151 hr = reflection->lpVtbl->GetOutputParameterDesc(reflection,
j, &
desc);
1152 ok(
hr ==
S_OK,
"Got unexpected hr %#lx.\n",
hr);
1157 ID3D10Blob_Release(
code);
1158 refcount = reflection->lpVtbl->
Release(reflection);
1159 ok(!refcount,
"Got unexpected refcount %lu.\n", refcount);
1174 skip(
"Direct3D 11 is not available.\n");
std::map< E_MODULE, HMODULE > mod
@ D3D11_FILTER_MIN_MAG_MIP_LINEAR
@ D3D11_INPUT_PER_VERTEX_DATA
@ D3D_SIF_TEXTURE_COMPONENTS
@ D3D_DRIVER_TYPE_HARDWARE
@ D3D_DRIVER_TYPE_REFERENCE
@ D3D_SRV_DIMENSION_TEXTURE2D
@ D3D11_SRV_DIMENSION_TEXTURE2D
@ D3D_REGISTER_COMPONENT_FLOAT32
@ D3D_REGISTER_COMPONENT_UINT32
@ D3D_REGISTER_COMPONENT_SINT32
@ D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP
#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY
HRESULT WINAPI D3DReflect(const void *data, SIZE_T data_size, REFIID riid, void **reflector)
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)
#define ID3D11ShaderReflectionType
#define ID3D11ShaderReflectionConstantBuffer
#define ID3D11ShaderReflection
#define ID3D11ShaderReflectionVariable
#define IID_ID3D11ShaderReflection
#define GetProcAddress(x, y)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
_ACRTIMP float __cdecl cosf(float)
_ACRTIMP float __cdecl sinf(float)
_ACRTIMP double __cdecl cos(double)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
@ DXGI_SWAP_EFFECT_DISCARD
const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT
@ DXGI_MODE_SCALING_UNSPECIFIED
@ DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
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
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL UINT UINT sdk_version
static void release_test_context_(unsigned int line, struct test_context *context)
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL UINT UINT ID3D11Device ** device_out
static void test_swizzle(void)
#define release_test_context(context)
#define init_test_context(a)
static BOOL compare_vec4(const struct vec4 *vec, float x, float y, float z, float w, unsigned int ulps)
static void check_parameter_desc(const D3D11_SIGNATURE_PARAMETER_DESC *desc, const D3D11_SIGNATURE_PARAMETER_DESC *expect)
static const struct vec4 * get_readback_vec4(struct readback *rb, unsigned int x, unsigned int y)
static struct vec4 get_color_vec4(struct test_context *context, unsigned int x, unsigned int y)
#define compile_shader_flags(a, b, c)
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL UINT UINT ID3D11Device D3D_FEATURE_LEVEL * obtained_feature_level
static void check_resource_binding(const D3D11_SHADER_INPUT_BIND_DESC *desc, const D3D11_SHADER_INPUT_BIND_DESC *expect)
static void test_trig(void)
static void test_semantic_reflection(void)
static void check_type_desc(const D3D11_SHADER_TYPE_DESC *type, const D3D11_SHADER_TYPE_DESC *expect)
static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff)
static void release_readback(struct test_context *context, struct readback *rb)
static D3D_DRIVER_TYPE driver_type
#define create_buffer(a, b, c, d)
static ID3D11Buffer * create_buffer_(unsigned int line, ID3D11Device *device, unsigned int bind_flags, unsigned int size, const void *data)
static void test_sampling(void)
static void test_reflection(void)
static D3D_DRIVER_TYPE HMODULE swrast
static void init_readback(struct test_context *context, struct readback *rb)
#define compile_shader(a, b)
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL * feature_levels
static ID3D11Device * create_device(void)
#define draw_quad(context, ps_code)
static void test_math(void)
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL UINT UINT ID3D11Device D3D_FEATURE_LEVEL ID3D11DeviceContext ** immediate_context
static void draw_quad_(unsigned int line, struct test_context *context, ID3D10Blob *ps_code)
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL UINT levels
static void test_conditionals(void)
static D3D_DRIVER_TYPE HMODULE UINT flags
static IDXGISwapChain * create_swapchain(ID3D11Device *device, HWND window)
static ID3D10Blob * compile_shader_(unsigned int line, const char *source, const char *target, UINT flags)
static BOOL init_test_context_(unsigned int line, struct test_context *context)
#define skip_(test, file, line,...)
#define trace_(file, line,...)
#define todo_wine_if(is_todo)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
static struct test_info tests[]
D3D11_SHADER_VARIABLE_DESC desc
#define compare_float(got, exp)
static IHTMLWindow2 * window
#define WS_OVERLAPPEDWINDOW
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
static void quad(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, GLuint pv)
DXGI_MODE_SCANLINE_ORDER ScanlineOrdering
DXGI_MODE_SCALING Scaling
DXGI_RATIONAL RefreshRate
DXGI_SWAP_EFFECT SwapEffect
DXGI_SAMPLE_DESC SampleDesc
DXGI_MODE_DESC BufferDesc
D3D11_MAPPED_SUBRESOURCE map_desc
ID3D11Resource * resource
ID3D11DeviceContext * immediate_context
ID3D11RenderTargetView * rtv
ID3D11InputLayout * input_layout
IDXGISwapChain * swapchain