Signed-off-by: Paul Gofman gofmanp@gmail.com --- v4: - added patch.
dlls/d3d9/tests/device.c | 67 +++++++++------------------------------- dlls/d3d9/tests/utils.h | 39 +++++++++++++++++++++++ 2 files changed, 54 insertions(+), 52 deletions(-) create mode 100644 dlls/d3d9/tests/utils.h
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 170ad57124..40ca639001 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -25,7 +25,7 @@ #define WINVER 0x0602 /* for CURSOR_SUPPRESSED */ #define COBJMACROS #include <d3d9.h> -#include "wine/test.h" +#include "utils.h"
struct vec3 { @@ -5947,13 +5947,8 @@ static void test_occlusion_query(void)
hr = IDirect3DQuery9_Issue(query, D3DISSUE_END); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - for (i = 0; i < 500; ++i) - { - if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) - break; - Sleep(10); - } - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + wait_query(query);
memset(&data, 0xff, sizeof(data)); hr = IDirect3DQuery9_GetData(query, &data, data_size, D3DGETDATA_FLUSH); @@ -6057,13 +6052,7 @@ static void test_occlusion_query(void) hr = IDirect3DQuery9_Issue(query, D3DISSUE_END); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
- for (i = 0; i < 500; ++i) - { - if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) - break; - Sleep(10); - } - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + wait_query(query);
memset(&data, 0xff, sizeof(data)); hr = IDirect3DQuery9_GetData(query, &data, sizeof(data), D3DGETDATA_FLUSH); @@ -6085,13 +6074,7 @@ static void test_occlusion_query(void) hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr);
- for (i = 0; i < 500; ++i) - { - if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) == S_OK) - break; - Sleep(10); - } - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + wait_query(query);
memset(&data, 0xff, sizeof(data)); hr = IDirect3DQuery9_GetData(query, &data, sizeof(data), D3DGETDATA_FLUSH); @@ -6119,8 +6102,8 @@ static void test_timestamp_query(void) 1.0f, -1.0f, 0.0f, }; IDirect3DQuery9 *query, *disjoint_query, *freq_query; - unsigned int data_size, i; IDirect3DDevice9 *device; + unsigned int data_size; IDirect3D9 *d3d9; ULONG refcount; HWND window; @@ -6183,14 +6166,8 @@ static void test_timestamp_query(void) ok(data_size == sizeof(UINT64), "Query data size is %u, 8 expected.\n", data_size);
hr = IDirect3DQuery9_Issue(freq_query, D3DISSUE_END); - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - for (i = 0; i < 500; ++i) - { - if ((hr = IDirect3DQuery9_GetData(freq_query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) - break; - Sleep(10); - } - ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + wait_query(freq_query);
memset(freq, 0xff, sizeof(freq)); hr = IDirect3DQuery9_GetData(freq_query, freq, sizeof(DWORD), D3DGETDATA_FLUSH); @@ -6235,13 +6212,8 @@ static void test_timestamp_query(void)
hr = IDirect3DQuery9_Issue(query, D3DISSUE_END); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - for (i = 0; i < 500; ++i) - { - if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) - break; - Sleep(10); - } - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + wait_query(query);
memset(timestamp, 0xff, sizeof(timestamp)); hr = IDirect3DQuery9_GetData(query, timestamp, sizeof(DWORD), D3DGETDATA_FLUSH); @@ -6259,13 +6231,8 @@ static void test_timestamp_query(void)
hr = IDirect3DQuery9_Issue(disjoint_query, D3DISSUE_END); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - for (i = 0; i < 500; ++i) - { - if ((hr = IDirect3DQuery9_GetData(disjoint_query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) - break; - Sleep(10); - } - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + wait_query(disjoint_query);
memset(disjoint, 0xff, sizeof(disjoint)); hr = IDirect3DQuery9_GetData(disjoint_query, disjoint, sizeof(WORD), D3DGETDATA_FLUSH); @@ -6287,13 +6254,9 @@ static void test_timestamp_query(void)
hr = IDirect3DQuery9_Issue(query, D3DISSUE_END); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - for (i = 0; i < 500; ++i) - { - if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) - break; - Sleep(10); - } - ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + wait_query(query); + hr = IDirect3DQuery9_GetData(query, timestamp, sizeof(timestamp), D3DGETDATA_FLUSH); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
diff --git a/dlls/d3d9/tests/utils.h b/dlls/d3d9/tests/utils.h new file mode 100644 index 0000000000..aa6a3227d6 --- /dev/null +++ b/dlls/d3d9/tests/utils.h @@ -0,0 +1,39 @@ +/* + * Copyright 2019 Paul Gofman + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_D3D9_TESTS_UTILS_H +#define __WINE_D3D9_TESTS_UTILS_H + +#include "wine/test.h" + +#define wait_query(a) wait_query_(__FILE__, __LINE__, a) +static inline void wait_query_(const char *file, unsigned int line, IDirect3DQuery9 *query) +{ + unsigned int i; + HRESULT hr; + + for (i = 0; i < 500; ++i) + { + if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) == S_OK) + break; + Sleep(10); + } + ok_(file, line)(hr == S_OK, "Got unexpected hr %#x.\n", hr); +} + +#endif
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45978 Signed-off-by: Paul Gofman gofmanp@gmail.com --- v4: - use wait_query function.
dlls/d3d9/tests/visual.c | 163 ++++++++++++++++++++++++++++++++- dlls/wined3d/adapter_gl.c | 7 ++ dlls/wined3d/context.c | 29 ++++++ dlls/wined3d/wined3d_gl.h | 2 + dlls/wined3d/wined3d_private.h | 23 ++++- 5 files changed, 222 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index e7076aeed6..ebec6dc27d 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -33,7 +33,7 @@
#define COBJMACROS #include <d3d9.h> -#include "wine/test.h" +#include "utils.h" #include "wine/heap.h"
struct vec2 @@ -26263,6 +26263,166 @@ static void test_draw_mapped_buffer(void) DestroyWindow(window); }
+static void test_sample_attached_rendertarget(void) +{ + D3DADAPTER_IDENTIFIER9 identifier; + IDirect3DQuery9 *event_query; + IDirect3DTexture9 *texture; + IDirect3DVertexBuffer9 *vb; + IDirect3DPixelShader9 *ps; + IDirect3DDevice9 *device; + IDirect3DSurface9 *rt; + IDirect3D9 *d3d; + unsigned int i; + ULONG refcount; + D3DCOLOR color; + BOOL is_warp; + HWND window; + HRESULT hr; + void *data; + + static const struct + { + struct vec3 posistion; + struct vec2 texcoord; + } + quad[] = + { + {{-1.0f, -1.0f, 0.1f}, {0.0f, 0.0f}}, + {{-1.0f, 1.0f, 0.1f}, {0.0f, 1.0f}}, + {{ 1.0f, -1.0f, 0.0f}, {1.0f, 0.0f}}, + {{ 1.0f, 1.0f, 0.1f}, {1.0f, 1.0f}}, + }; + + static const DWORD pixel_shader_code[] = + { + 0xffff0200, /* ps_2_0 */ + 0x05000051, 0xa00f0000, 0x3e800000, 0x3e800000, 0x3e800000, 0x3e800000, + /* def c0, 0.25, 0.25, 0.25, 0.25 */ + 0x0200001f, 0x80000000, 0xb00f0000, /* dcl t0 */ + 0x0200001f, 0x90000000, 0xa00f0800, /* dcl_2d s0 */ + 0x03000042, 0x800f0000, 0xb0e40000, 0xa0e40800, /* texld r0, t0, s0 */ + 0x03000002, 0x800f0000, 0x80e40000, 0xa0e40000, /* add r0, r0, c0 */ + 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ + 0x0000ffff + }; + + window = create_window(); + ok(!!window, "Failed to create a window.\n"); + + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + hr = IDirect3D9_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + is_warp = adapter_is_warp(&identifier); + + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateQuery(device, D3DQUERYTYPE_EVENT, NULL); + if (hr == D3DERR_NOTAVAILABLE) + { + /* Without synchronization native d3d seems to show race condition on + * render target update, similar to opengl without using texture barrier. */ + skip("Event queries are not supported, skipping test.\n"); + IDirect3DDevice9_Release(device); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateQuery(device, D3DQUERYTYPE_EVENT, &event_query); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DQuery9_Issue(event_query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), D3DUSAGE_DYNAMIC, + D3DFVF_XYZ | D3DFVF_TEX1, D3DPOOL_DEFAULT, &vb, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), &data, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(data, quad, sizeof(quad)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad[0])); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &rt); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x01010101, 0.0, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + check_rt_color(rt, 0x00010101); + + hr = IDirect3DDevice9_CreatePixelShader(device, pixel_shader_code, &ps); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetPixelShader(device, ps); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + for (i = 0; i < 3; ++i) + { + wait_query(event_query); + + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + IDirect3DQuery9_Issue(event_query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + color = getPixelColor(device, 0, 0); + if (is_warp || color == 0x00010101) + skip("Sampling attached render targets is not supported.\n"); + else + check_rt_color(rt, 0x00c1c1c1); + + IDirect3DQuery9_Release(event_query); + + IDirect3DVertexBuffer9_Release(vb); + + IDirect3DPixelShader9_Release(ps); + IDirect3DSurface9_Release(rt); + IDirect3DTexture9_Release(texture); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + IDirect3D9_Release(d3d); + DestroyWindow(window); +}
START_TEST(visual) { @@ -26409,4 +26569,5 @@ START_TEST(visual) test_desktop_window(); test_mismatched_sample_types(); test_draw_mapped_buffer(); + test_sample_attached_rendertarget(); } diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index ed1022030b..e83aebfa56 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -159,6 +159,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_ARB_vertex_shader", ARB_VERTEX_SHADER }, {"GL_ARB_vertex_type_2_10_10_10_rev", ARB_VERTEX_TYPE_2_10_10_10_REV}, {"GL_ARB_viewport_array", ARB_VIEWPORT_ARRAY }, + {"GL_ARB_texture_barrier", ARB_TEXTURE_BARRIER },
/* ATI */ {"GL_ATI_fragment_shader", ATI_FRAGMENT_SHADER }, @@ -228,6 +229,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_NV_vertex_program2", NV_VERTEX_PROGRAM2 }, {"GL_NV_vertex_program2_option", NV_VERTEX_PROGRAM2_OPTION }, {"GL_NV_vertex_program3", NV_VERTEX_PROGRAM3 }, + {"GL_NV_texture_barrier", NV_TEXTURE_BARRIER }, };
static const struct wined3d_extension_map wgl_extension_map[] = @@ -2454,6 +2456,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) USE_GL_FUNC(glViewportArrayv) USE_GL_FUNC(glViewportIndexedf) USE_GL_FUNC(glViewportIndexedfv) + /* GL_ARB_texture_barrier */ + USE_GL_FUNC(glTextureBarrier); /* GL_ATI_fragment_shader */ USE_GL_FUNC(glAlphaFragmentOp1ATI) USE_GL_FUNC(glAlphaFragmentOp2ATI) @@ -2644,6 +2648,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) USE_GL_FUNC(glCombinerParameteriNV) USE_GL_FUNC(glCombinerParameterivNV) USE_GL_FUNC(glFinalCombinerInputNV) + /* GL_NV_texture_barrier */ + USE_GL_FUNC(glTextureBarrierNV); /* WGL extensions */ USE_GL_FUNC(wglChoosePixelFormatARB) USE_GL_FUNC(wglGetExtensionsStringARB) @@ -3406,6 +3412,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, {ARB_CULL_DISTANCE, MAKEDWORD_VERSION(4, 5)}, {ARB_DERIVATIVE_CONTROL, MAKEDWORD_VERSION(4, 5)}, {ARB_SHADER_TEXTURE_IMAGE_SAMPLES, MAKEDWORD_VERSION(4, 5)}, + {ARB_TEXTURE_BARRIER, MAKEDWORD_VERSION(4, 5)},
{ARB_PIPELINE_STATISTICS_QUERY, MAKEDWORD_VERSION(4, 6)}, {ARB_POLYGON_OFFSET_CLAMP, MAKEDWORD_VERSION(4, 6)}, diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 9cd6a6e3de..e9750c41c5 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -3696,6 +3696,9 @@ static void context_preload_texture(struct wined3d_context *context, if (!(texture = state->textures[idx])) return;
+ if (wined3d_resource_check_fbo_attached(state, &texture->resource)) + context->uses_fbo_attached_resources = 1; + wined3d_texture_load(texture, context, is_srgb_enabled(state->sampler_states[idx])); }
@@ -3929,6 +3932,8 @@ static BOOL context_apply_draw_state(struct wined3d_context *context, unsigned int i, base; WORD map;
+ context->uses_fbo_attached_resources = 0; + if (!have_framebuffer_attachment(gl_info->limits.buffers, fb->render_targets, fb->depth_stencil)) { if (!gl_info->supported[ARB_FRAMEBUFFER_NO_ATTACHMENTS]) @@ -4984,6 +4989,30 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s checkGLcall("glPatchParameteri"); }
+ if (context->uses_fbo_attached_resources) + { + static unsigned int fixme_once; + + if (gl_info->supported[ARB_TEXTURE_BARRIER]) + { + GL_EXTCALL(glTextureBarrier()); + } + else if (gl_info->supported[NV_TEXTURE_BARRIER]) + { + GL_EXTCALL(glTextureBarrierNV()); + } + else + { + if (!fixme_once++) + FIXME("Sampling attached render targets is not supported.\n"); + + WARN("Sampling attached render targets is not supported, skipping draw.\n"); + context_release(context); + return; + } + checkGLcall("glTextureBarrier"); + } + if (parameters->indirect) { if (!context->use_immediate_mode_draw && !emulation) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 678ad1a4ef..3372b4b6be 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -142,6 +142,7 @@ enum wined3d_gl_extension ARB_VERTEX_SHADER, ARB_VERTEX_TYPE_2_10_10_10_REV, ARB_VIEWPORT_ARRAY, + ARB_TEXTURE_BARRIER, /* ATI */ ATI_FRAGMENT_SHADER, ATI_SEPARATE_STENCIL, @@ -204,6 +205,7 @@ enum wined3d_gl_extension NV_VERTEX_PROGRAM2, NV_VERTEX_PROGRAM2_OPTION, NV_VERTEX_PROGRAM3, + NV_TEXTURE_BARRIER, /* WGL extensions */ WGL_ARB_PIXEL_FORMAT, WGL_EXT_SWAP_CONTROL, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 307f7a42ad..88833aef70 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1961,6 +1961,7 @@ struct wined3d_context
DWORD use_immediate_mode_draw : 1; DWORD uses_uavs : 1; + DWORD uses_fbo_attached_resources : 1; DWORD transform_feedback_active : 1; DWORD transform_feedback_paused : 1; DWORD fog_coord : 1; @@ -1969,7 +1970,7 @@ struct wined3d_context DWORD destroyed : 1; DWORD destroy_delayed : 1; DWORD clip_distance_mask : 8; /* WINED3D_MAX_CLIP_DISTANCES, 8 */ - DWORD padding : 15; + DWORD padding : 14;
DWORD constant_update_mask; DWORD numbered_array_mask; @@ -5279,6 +5280,26 @@ static inline void wined3d_context_copy_bo_address(struct wined3d_context *conte dst, dst_bind_flags, src, src_bind_flags, size); }
+static inline BOOL wined3d_resource_check_fbo_attached(const struct wined3d_state *state, + const struct wined3d_resource *resource) +{ + struct wined3d_rendertarget_view * const *rts = &state->fb->render_targets[0]; + unsigned int i; + + if ((resource->bind_flags & WINED3D_BIND_DEPTH_STENCIL) + && state->fb->depth_stencil && state->fb->depth_stencil->resource == resource) + return TRUE; + + if (!(resource->bind_flags & WINED3D_BIND_RENDER_TARGET)) + return FALSE; + + for (i = 0; i < MAX_RENDER_TARGET_VIEWS; ++i) + if (rts[i] && rts[i]->resource == resource) + return TRUE; + + return FALSE; +} + /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */ #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Paul Gofman gofmanp@gmail.com --- v4: - rename bind_count_device_state variable to srv_bind_count_device; - don't use interlocked functions to updated srv_bind_count_device.
dlls/d3d11/tests/d3d11.c | 223 +++++++++++++++++++++++++++++++++ dlls/wined3d/device.c | 35 ++++++ dlls/wined3d/stateblock.c | 1 + dlls/wined3d/wined3d_private.h | 1 + 4 files changed, 260 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index da4627d7a8..bdf661cecb 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -29394,6 +29394,228 @@ static void test_desktop_window(void) ok(!refcount, "Device has %u references left.\n", refcount); }
+static void test_sample_attached_rtv(void) +{ + ID3D11ShaderResourceView *srv, *srv_test; + struct d3d11_test_context test_context; + ID3D11RenderTargetView *rtv, *rtvs[2]; + ID3D11Texture2D *texture, *texture2; + D3D11_TEXTURE2D_DESC texture_desc; + D3D11_SAMPLER_DESC sampler_desc; + ID3D11DeviceContext *context; + ID3D11SamplerState *sampler; + struct resource_readback rb; + ID3D11PixelShader *ps; + ID3D11Device *device; + unsigned int x, y; + DWORD color; + HRESULT hr; + + static const DWORD ps_ld_code[] = + { +#if 0 + Texture2D t; + + struct PS_OUTPUT + { + float4 color0: SV_Target0; + float4 color1: SV_Target1; + }; + + PS_OUTPUT main(float4 position : SV_POSITION) + { + PS_OUTPUT output; + float3 p; + + t.GetDimensions(0, p.x, p.y, p.z); + p.z = 0; + p *= float3(position.x / 640.0f, position.y / 480.0f, 1.0f); + output.color0 = output.color1 = t.Load(int3(p)) + float4(0.25, 0.25, 0.25, 0.25); + return output; + } +#endif + 0x43425844, 0x08dd0517, 0x07d7e538, 0x4cad261f, 0xa2ae5942, 0x00000001, 0x00000200, 0x00000003, + 0x0000002c, 0x00000060, 0x000000ac, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x00000044, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x00000038, 0x00000001, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, + 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x0000014c, 0x00000040, 0x00000053, 0x04001858, + 0x00107000, 0x00000000, 0x00005555, 0x04002064, 0x00101032, 0x00000000, 0x00000001, 0x03000065, + 0x001020f2, 0x00000000, 0x03000065, 0x001020f2, 0x00000001, 0x02000068, 0x00000001, 0x0700003d, + 0x001000f2, 0x00000000, 0x00004001, 0x00000000, 0x00107e46, 0x00000000, 0x07000038, 0x00100032, + 0x00000000, 0x00100046, 0x00000000, 0x00101046, 0x00000000, 0x0a000038, 0x00100032, 0x00000000, + 0x00100046, 0x00000000, 0x00004002, 0x3acccccd, 0x3b088889, 0x00000000, 0x00000000, 0x08000036, + 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0500001b, + 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, 0x0700002d, 0x001000f2, 0x00000000, 0x00100e46, + 0x00000000, 0x00107e46, 0x00000000, 0x0a000000, 0x001000f2, 0x00000000, 0x00100e46, 0x00000000, + 0x00004002, 0x3e800000, 0x3e800000, 0x3e800000, 0x3e800000, 0x05000036, 0x001020f2, 0x00000000, + 0x00100e46, 0x00000000, 0x05000036, 0x001020f2, 0x00000001, 0x00100e46, 0x00000000, 0x0100003e, + }; + + static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; + + if (!init_test_context(&test_context, NULL)) + return; + + device = test_context.device; + context = test_context.immediate_context; + + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; + sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; + sampler_desc.MipLODBias = 0.0f; + sampler_desc.MaxAnisotropy = 0; + sampler_desc.ComparisonFunc = D3D11_COMPARISON_NEVER; + sampler_desc.BorderColor[0] = 0.0f; + sampler_desc.BorderColor[1] = 0.0f; + sampler_desc.BorderColor[2] = 0.0f; + sampler_desc.BorderColor[3] = 0.0f; + sampler_desc.MinLOD = 0.0f; + sampler_desc.MaxLOD = D3D11_FLOAT32_MAX; + + hr = ID3D11Device_CreatePixelShader(device, ps_ld_code, sizeof(ps_ld_code), NULL, &ps); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0); + + texture_desc.Width = 64; + texture_desc.Height = 64; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + texture_desc.Width = 640; + texture_desc.Height = 480; + + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture2); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; + sampler_desc.MipLODBias = 0.0f; + sampler_desc.MinLOD = 0.0f; + sampler_desc.MaxLOD = 0.0f; + + hr = ID3D11Device_CreateSamplerState(device, &sampler_desc, &sampler); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + ID3D11DeviceContext_PSSetSamplers(context, 0, 1, &sampler); + + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red); + + hr = ID3D11Device_CreateRenderTargetView(device, (ID3D11Resource *)texture2, NULL, &rtv); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + rtvs[0] = test_context.backbuffer_rtv; + rtvs[1] = rtv; + + ID3D11DeviceContext_OMSetRenderTargets(context, 2, rtvs, NULL); + + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &srv); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &srv); + + draw_quad(&test_context); + + get_texture_readback(texture2, 0, &rb); + for (y = 0; y < 4; ++y) + { + for (x = 0; x < 4; ++x) + { + color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120, 0); + ok(compare_color(color, 0x40404040, 2), + "Got unexpected color 0x%08x at (%u, %u).\n", color, x, y); + } + } + release_resource_readback(&rb); + + ID3D11ShaderResourceView_Release(srv); + + ID3D11DeviceContext_ClearRenderTargetView(context, rtv, red); + + hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture2, NULL, &srv); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + /* SRV does not get bound if resource is attached as render target. */ + ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &srv); + ID3D11DeviceContext_PSGetShaderResources(context, 0, 1, &srv_test); + ok(!srv_test, "Unexpected SRV %p.\n", srv_test); + + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, red); + + draw_quad(&test_context); + draw_quad(&test_context); + + get_texture_readback(test_context.backbuffer, 0, &rb); + for (y = 0; y < 4; ++y) + { + for (x = 0; x < 4; ++x) + { + color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120, 0); + ok(compare_color(color, 0x40404040, 2), + "Got unexpected color 0x%08x at (%u, %u).\n", color, x, y); + } + } + release_resource_readback(&rb); + + get_texture_readback(texture2, 0, &rb); + for (y = 0; y < 4; ++y) + { + for (x = 0; x < 4; ++x) + { + color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120, 0); + ok(compare_color(color, 0x40404040, 2), + "Got unexpected color 0x%08x at (%u, %u).\n", color, x, y); + } + } + release_resource_readback(&rb); + + ID3D11DeviceContext_OMSetRenderTargets(context, 1, &test_context.backbuffer_rtv, NULL); + ID3D11DeviceContext_PSSetShaderResources(context, 0, 1, &srv); + ID3D11DeviceContext_PSGetShaderResources(context, 0, 1, &srv_test); + ok(!!srv_test, "Unexpected SRV %p.\n", srv_test); + ID3D11ShaderResourceView_Release(srv_test); + + draw_quad(&test_context); + get_texture_readback(test_context.backbuffer, 0, &rb); + for (y = 0; y < 4; ++y) + { + for (x = 0; x < 4; ++x) + { + color = get_readback_color(&rb, 80 + x * 160, 60 + y * 120, 0); + ok(compare_color(color, 0x80808080, 2), + "Got unexpected color 0x%08x at (%u, %u).\n", color, x, y); + } + } + release_resource_readback(&rb); + + ID3D11DeviceContext_OMSetRenderTargets(context, 2, rtvs, NULL); + + /* SRV is reset when the same resource is set as render target. */ + ID3D11DeviceContext_PSGetShaderResources(context, 0, 1, &srv_test); + ok(!srv_test, "Unexpected SRV %p.\n", srv_test); + + ID3D11RenderTargetView_Release(rtv); + ID3D11ShaderResourceView_Release(srv); + ID3D11SamplerState_Release(sampler); + ID3D11PixelShader_Release(ps); + ID3D11Texture2D_Release(texture2); + ID3D11Texture2D_Release(texture); + ID3D11SamplerState_Release(sampler); + + release_test_context(&test_context); +} + START_TEST(d3d11) { unsigned int argc, i; @@ -29553,6 +29775,7 @@ START_TEST(d3d11) queue_test(test_render_a8); queue_test(test_standard_pattern); queue_test(test_desktop_window); + queue_test(test_sample_attached_rtv);
run_queued_tests(); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 0a668c46b5..b2aa33af41 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2239,12 +2239,25 @@ static void wined3d_device_set_shader_resource_view(struct wined3d_device *devic if (view == prev) return;
+ if (view && wined3d_resource_check_fbo_attached(&device->state, view->resource)) + { + WARN("Application is trying to bind resource which is attached as render target.\n"); + view = NULL; + } + if (view) + { wined3d_shader_resource_view_incref(view); + ++view->resource->srv_bind_count_device; + } + device->state.shader_resource_view[type][idx] = view; wined3d_cs_emit_set_shader_resource_view(device->cs, type, idx, view); if (prev) + { + --prev->resource->srv_bind_count_device; wined3d_shader_resource_view_decref(prev); + } }
void CDECL wined3d_device_set_vs_resource_view(struct wined3d_device *device, @@ -4977,6 +4990,24 @@ struct wined3d_rendertarget_view * CDECL wined3d_device_get_depth_stencil_view(c return device->fb.depth_stencil; }
+static void wined3d_unbind_srv_for_rtv(struct wined3d_device *device, + const struct wined3d_rendertarget_view *view) +{ + if (view && view->resource->srv_bind_count_device) + { + const struct wined3d_resource *resource = view->resource; + const struct wined3d_shader_resource_view *srv; + unsigned int i, j; + + WARN("Application sets bound resource as render target.\n"); + + for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i) + for (j = 0; j < MAX_SHADER_RESOURCE_VIEWS; ++j) + if ((srv = device->state.shader_resource_view[i][j]) && srv->resource == resource) + wined3d_device_set_shader_resource_view(device, i, j, NULL); + } +} + HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device, unsigned int view_idx, struct wined3d_rendertarget_view *view, BOOL set_viewport) { @@ -5035,6 +5066,8 @@ HRESULT CDECL wined3d_device_set_rendertarget_view(struct wined3d_device *device if (prev) wined3d_rendertarget_view_decref(prev);
+ wined3d_unbind_srv_for_rtv(device, view); + return WINED3D_OK; }
@@ -5065,6 +5098,8 @@ HRESULT CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *devic if (prev) wined3d_rendertarget_view_decref(prev);
+ wined3d_unbind_srv_for_rtv(device, view); + return WINED3D_OK; }
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 1965a4303f..d4e08a7dee 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -503,6 +503,7 @@ void state_unbind_resources(struct wined3d_state *state) if ((srv = state->shader_resource_view[i][j])) { state->shader_resource_view[i][j] = NULL; + --srv->resource->srv_bind_count_device; wined3d_shader_resource_view_decref(srv); } } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 88833aef70..eaa6493ac4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3423,6 +3423,7 @@ struct wined3d_resource { LONG ref; LONG bind_count; + LONG srv_bind_count_device; LONG map_count; LONG access_count; struct wined3d_device *device;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58300
Your paranoid android.
=== wvistau64 (32 bit report) ===
d3d11: d3d11.c:5776: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5777: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5778: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5781: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5782: Test failed: Got unexpected CPrimitives count: 0.
=== w1064v1809_2scr (32 bit report) ===
d3d11: d3d11.c:5776: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5777: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5778: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5781: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5782: Test failed: Got unexpected CPrimitives count: 0.
=== w1064v1809_zh_CN (32 bit report) ===
d3d11: d3d11.c:5776: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5777: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5778: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5781: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5782: Test failed: Got unexpected CPrimitives count: 0.
=== debian10 (32 bit report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian10 (32 bit French report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 1, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 2, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 2, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 3, test 7: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (200, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (280, 200) has color 00000000, expected ffff0000. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (360, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (440, 200) has color 00000000, expected ff00ff00. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (200, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (280, 270) has color 00000000, expected ff0000ff. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (360, 270) has color 00000000, expected ff000000. d3d11.c:27602: Test failed: Resource type 3, test 8: pixel (440, 270) has color 00000000, expected ff000000. d3d11.c:25838: Test failed: Got depth 2.51951814e-003, expected 2.51948950e-003. d3d11.c:25838: Test failed: Got depth 2.51951814e-003, expected 2.51948950e-003. d3d11.c:25838: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25838: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25838: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25838: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25838: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25838: Test failed: Got depth 1.27950311e-003, expected 1.27948953e-003. d3d11.c:25838: Test failed: Got depth 5.03277779e-003, expected 5.03897900e-003. d3d11.c:25838: Test failed: Got depth 5.03277779e-003, expected 5.03897900e-003. d3d11.c:25838: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25838: Test failed: Got depth 7.52645731e-003, expected 7.53897894e-003. d3d11.c:25838: Test failed: Got depth 7.52645731e-003, expected 7.53897894e-003. d3d11.c:25838: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25838: Test failed: Got depth 1.25139356e-002, expected 1.25389788e-002. d3d11.c:25838: Test failed: Got depth 1.25139356e-002, expected 1.25389788e-002. d3d11.c:25838: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25838: Test failed: Got depth 6.40938997e-001, expected 6.42538965e-001. d3d11.c:25838: Test failed: Got depth 6.40938997e-001, expected 6.42538965e-001. d3d11.c:25838: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25838: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25838: Test failed: Got depth 2.54905224e-003, expected 2.54897905e-003. d3d11.c:25846: Test failed: Got value 0x149d4 (5.03277809e-003), expected 0x14a3c (5.03897697e-003). d3d11.c:25846: Test failed: Got value 0x149d4 (5.03277809e-003), expected 0x14a3c (5.03897697e-003). d3d11.c:25846: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25846: Test failed: Got value 0x1ed41 (7.52645776e-003), expected 0x1ee13 (7.53897473e-003). d3d11.c:25846: Test failed: Got value 0x1ed41 (7.52645776e-003), expected 0x1ee13 (7.53897473e-003). d3d11.c:25846: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25846: Test failed: Got value 0x3341d (1.25139363e-002), expected 0x335c1 (1.25389703e-002). d3d11.c:25846: Test failed: Got value 0x3341d (1.25139363e-002), expected 0x335c1 (1.25389703e-002). d3d11.c:25846: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25846: Test failed: Got value 0xa41493 (6.40938976e-001), expected 0xa47d6e (6.42538943e-001). d3d11.c:25846: Test failed: Got value 0xa41493 (6.40938976e-001), expected 0xa47d6e (6.42538943e-001). d3d11.c:25846: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25846: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25846: Test failed: Got value 0x5c5c2 (2.25487961e-002), expected 0x5c5c6 (2.25490345e-002). d3d11.c:25855: Test failed: Got value 0x3d8 (1.50148775e-002), expected 0x3da (1.50453956e-002). d3d11.c:25855: Test failed: Got value 0x3d8 (1.50148775e-002), expected 0x3da (1.50453956e-002). d3d11.c:25855: Test failed: Got value 0x333 (1.24971389e-002), expected 0x336 (1.25429160e-002). d3d11.c:25855: Test failed: Got value 0x333 (1.24971389e-002), expected 0x336 (1.25429160e-002). d3d11.c:25855: Test failed: Got value 0x479 (1.74715801e-002), expected 0x47d (1.75326162e-002). d3d11.c:25855: Test failed: Got value 0x479 (1.74715801e-002), expected 0x47d (1.75326162e-002). d3d11.c:25855: Test failed: Got value 0xa414 (6.40939956e-001), expected 0xa47c (6.42526894e-001). d3d11.c:25855: Test failed: Got value 0xa414 (6.40939956e-001), expected 0xa47c (6.42526894e-001).
Report errors: d3d11:d3d11 prints too much data (35706 bytes)
=== debian10 (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16860: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
=== debian10 (32 bit Chinese:China report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16860: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
=== debian10 (32 bit WoW report) ===
d3d11: d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian10 (64 bit WoW report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58298
Your paranoid android.
=== w1064v1809_2scr (32 bit report) ===
d3d9: d3d9ex.c:3119: Test failed: Received WM_WINDOWPOSCHANGED but did not expect it, i=0.
=== w1064v1809_he (32 bit report) ===
d3d9: device.c:1808: Test failed: The cursor handle is 00010003
=== debian10 (32 bit WoW report) ===
d3d9: d3d9ex.c:3133: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.