Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/tests/d3d11.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 47c6613d904..5ab08632367 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -32364,6 +32364,15 @@ static void test_deferred_context_state(void) ID3D11DeviceContext_PSGetShaderResources(deferred, 0, 1, &ret_srv); ok(!ret_srv, "Got unexpected SRV %p.\n", ret_srv);
+ ID3D11DeviceContext_PSSetShaderResources(deferred, 0, 1, &srv); + ID3D11DeviceContext_PSGetShaderResources(deferred, 0, 1, &ret_srv); + ok(!ret_srv, "Got unexpected SRV %p.\n", ret_srv); + + ID3D11DeviceContext_PSSetShaderResources(immediate, 0, 1, &srv); + ID3D11DeviceContext_PSGetShaderResources(immediate, 0, 1, &ret_srv); + ok(ret_srv == srv, "Got unexpected SRV %p.\n", ret_srv); + ID3D11ShaderResourceView_Release(ret_srv); + ID3D11ShaderResourceView_Release(srv); ID3D11RenderTargetView_Release(rtv); ID3D11Texture2D_Release(texture);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/context.c | 19 ++++- dlls/wined3d/device.c | 23 ++++-- dlls/wined3d/resource.c | 1 - dlls/wined3d/wined3d_private.h | 125 +++++++-------------------------- 4 files changed, 61 insertions(+), 107 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 2debf50de7f..7f50126204b 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -335,6 +335,23 @@ void context_update_stream_info(struct wined3d_context *context, const struct wi } }
+static bool is_resource_rtv_bound(const struct wined3d_state *state, + const struct wined3d_resource *resource) +{ + unsigned int i; + + if (!resource->rtv_bind_count_device) + return false; + + for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i) + { + if (state->fb.render_targets[i] && state->fb.render_targets[i]->resource == resource) + return true; + } + + return false; +} + /* Context activation is done by the caller. */ static void context_preload_texture(struct wined3d_context *context, const struct wined3d_state *state, unsigned int idx) @@ -344,7 +361,7 @@ static void context_preload_texture(struct wined3d_context *context, if (!(texture = state->textures[idx])) return;
- if ((texture->resource.rtv_full_bind_count_device + texture->resource.rtv_partial_bind_count_device) + if (is_resource_rtv_bound(state, &texture->resource) || (state->fb.depth_stencil && state->fb.depth_stencil->resource == &texture->resource)) context->uses_fbo_attached_resources = 1;
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index dbb5dcf2672..2c8ebba8844 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1985,7 +1985,7 @@ void CDECL wined3d_device_context_set_shader_resource_view(struct wined3d_device if (view == prev) return;
- if (view && (wined3d_is_srv_rtv_bound(view) + if (view && (wined3d_is_srv_rtv_bound(state, view) || ((dsv = state->fb.depth_stencil) && dsv->resource == view->resource && wined3d_dsv_srv_conflict(dsv, view->format)))) { @@ -2064,22 +2064,31 @@ void CDECL wined3d_device_context_set_unordered_access_view(struct wined3d_devic static void wined3d_device_context_unbind_srv_for_rtv(struct wined3d_device_context *context, const struct wined3d_rendertarget_view *view, BOOL dsv) { - struct wined3d_state *state = context->state; + const struct wined3d_state *state = context->state; + const struct wined3d_resource *resource;
- if (view && wined3d_is_rtv_srv_bound(view)) + if (!view) + return; + resource = view->resource; + + if (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 = state->shader_resource_view[i][j]) && srv->resource == resource - && ((!dsv && wined3d_is_srv_rtv_bound(srv)) + && ((!dsv && wined3d_is_srv_rtv_bound(state, srv)) || (dsv && wined3d_dsv_srv_conflict(view, srv->format)))) + { + WARN("Application sets bound resource as render target.\n"); wined3d_device_context_set_shader_resource_view(context, i, j, NULL); + } + } + } } }
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 6e34605f547..58e3e5c77fd 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -235,7 +235,6 @@ static void wined3d_resource_destroy_object(void *object)
TRACE("resource %p.\n", resource);
- heap_free(resource->sub_resource_bind_counts_device); wined3d_resource_free_sysmem(resource); context_resource_released(resource->device, resource); wined3d_resource_release(resource); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4c308d2ac05..fadad706af4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -4084,16 +4084,8 @@ struct wined3d_resource
struct list resource_list_entry;
- struct - { - uint32_t srv; - uint32_t rtv; - } - *sub_resource_bind_counts_device; - uint32_t srv_full_bind_count_device; - uint32_t rtv_full_bind_count_device; - uint32_t srv_partial_bind_count_device; - uint32_t rtv_partial_bind_count_device; + uint32_t srv_bind_count_device; + uint32_t rtv_bind_count_device; };
static inline ULONG wined3d_resource_incref(struct wined3d_resource *resource) @@ -6214,120 +6206,57 @@ static inline bool wined3d_rtv_all_subresources(const struct wined3d_rendertarge return texture->level_count == 1 && rtv->layer_count == wined3d_bind_layer_count(texture); }
-static inline void wined3d_srv_bind_count_add(struct wined3d_shader_resource_view *srv, int value) -{ - struct wined3d_resource *resource = srv->resource; - struct wined3d_texture *texture; - unsigned int level, layer; - - if (wined3d_srv_all_subresources(srv)) - { - resource->srv_full_bind_count_device += value; - return; - } - - resource->srv_partial_bind_count_device += value; - - texture = texture_from_resource(resource); - - if (!resource->sub_resource_bind_counts_device - && !(resource->sub_resource_bind_counts_device = heap_alloc_zero(texture->level_count - * wined3d_bind_layer_count(texture) * sizeof(*resource->sub_resource_bind_counts_device)))) - return; - - for (layer = 0; layer < srv->desc.u.texture.layer_count; ++layer) - for (level = 0; level < srv->desc.u.texture.level_count; ++level) - resource->sub_resource_bind_counts_device[(layer + srv->desc.u.texture.layer_idx) - * texture->level_count + srv->desc.u.texture.level_idx + level].srv += value; -} - static inline void wined3d_srv_bind_count_inc(struct wined3d_shader_resource_view *srv) { - wined3d_srv_bind_count_add(srv, 1); + ++srv->resource->srv_bind_count_device; }
static inline void wined3d_srv_bind_count_dec(struct wined3d_shader_resource_view *srv) { - wined3d_srv_bind_count_add(srv, -1); -} - -static inline void wined3d_rtv_bind_count_add(struct wined3d_rendertarget_view *rtv, int value) -{ - struct wined3d_resource *resource = rtv->resource; - struct wined3d_texture *texture; - unsigned int layer; - - if (wined3d_rtv_all_subresources(rtv)) - { - resource->rtv_full_bind_count_device += value; - return; - } - - resource->rtv_partial_bind_count_device += value; - - texture = texture_from_resource(resource); - - if (!resource->sub_resource_bind_counts_device - && !(resource->sub_resource_bind_counts_device = heap_alloc_zero(texture->level_count - * wined3d_bind_layer_count(texture) * sizeof(*resource->sub_resource_bind_counts_device)))) - return; - - for (layer = 0; layer < rtv->layer_count; ++layer) - resource->sub_resource_bind_counts_device[rtv->sub_resource_idx + layer * texture->level_count].rtv += value; + --srv->resource->srv_bind_count_device; }
static inline void wined3d_rtv_bind_count_inc(struct wined3d_rendertarget_view *rtv) { - wined3d_rtv_bind_count_add(rtv, 1); + ++rtv->resource->rtv_bind_count_device; }
static inline void wined3d_rtv_bind_count_dec(struct wined3d_rendertarget_view *rtv) { - wined3d_rtv_bind_count_add(rtv, -1); + --rtv->resource->rtv_bind_count_device; }
-static inline bool wined3d_is_srv_rtv_bound(const struct wined3d_shader_resource_view *srv) +static inline bool wined3d_rtv_overlaps_srv(const struct wined3d_rendertarget_view *rtv, + const struct wined3d_shader_resource_view *srv) { - struct wined3d_resource *resource = srv->resource; - struct wined3d_texture *texture; - unsigned int level, layer; + if (rtv->resource != srv->resource) + return false;
- if (!(resource->rtv_full_bind_count_device + resource->rtv_partial_bind_count_device)) - return FALSE; + if (wined3d_srv_all_subresources(srv) || wined3d_rtv_all_subresources(rtv)) + return true;
- if (resource->rtv_full_bind_count_device || wined3d_srv_all_subresources(srv)) - return TRUE; - - texture = texture_from_resource(resource); - - for (layer = 0; layer < srv->desc.u.texture.layer_count; ++layer) - for (level = 0; level < srv->desc.u.texture.level_count; ++level) - if (resource->sub_resource_bind_counts_device[(layer + srv->desc.u.texture.layer_idx) - * texture->level_count + srv->desc.u.texture.level_idx + level].rtv) - return TRUE; - - return FALSE; + return rtv->sub_resource_idx >= srv->desc.u.texture.level_idx + && rtv->sub_resource_idx < srv->desc.u.texture.level_idx + srv->desc.u.texture.level_count + && rtv->layer_count >= srv->desc.u.texture.layer_idx; }
-static inline bool wined3d_is_rtv_srv_bound(const struct wined3d_rendertarget_view *rtv) +static inline bool wined3d_is_srv_rtv_bound(const struct wined3d_state *state, + const struct wined3d_shader_resource_view *srv) { - struct wined3d_resource *resource = rtv->resource; - struct wined3d_texture *texture; - unsigned int layer; + unsigned int i;
- if (!(resource->srv_full_bind_count_device + resource->srv_partial_bind_count_device)) - return FALSE; + if (!srv->resource->rtv_bind_count_device) + return false;
- if (resource->srv_full_bind_count_device || wined3d_rtv_all_subresources(rtv)) - return TRUE; + for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i) + { + const struct wined3d_rendertarget_view *rtv;
- texture = texture_from_resource(resource); + if ((rtv = state->fb.render_targets[i]) && wined3d_rtv_overlaps_srv(rtv, srv)) + return true; + }
- for (layer = 0; layer < rtv->layer_count; ++layer) - if (resource->sub_resource_bind_counts_device[rtv->sub_resource_idx + layer * texture->level_count].srv) - return TRUE; - - return FALSE; + return false; }
static inline void wined3d_viewport_get_z_range(const struct wined3d_viewport *vp, float *min_z, float *max_z)
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/tests/d3d11.c | 239 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 5ab08632367..e5d46f445a4 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -32706,6 +32706,244 @@ static void test_deferred_context_rendering(void) release_test_context(&test_context); }
+static void test_deferred_context_map(void) +{ + ID3D11DeviceContext *immediate, *deferred; + struct d3d11_test_context test_context; + D3D11_SUBRESOURCE_DATA resource_data; + D3D11_BUFFER_DESC buffer_desc = {0}; + D3D11_MAPPED_SUBRESOURCE map_desc; + ID3D11Buffer *buffer, *buffer2; + struct resource_readback rb; + ID3D11CommandList *list; + float data[16], value; + ID3D11Device *device; + float *map_data; + unsigned int i; + HRESULT hr; + + if (!init_test_context(&test_context, NULL)) + return; + + device = test_context.device; + immediate = test_context.immediate_context; + + hr = ID3D11Device_CreateDeferredContext(device, 0, &deferred); + todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr); + if (hr != S_OK) + { + release_test_context(&test_context); + return; + } + + for (i = 0; i < ARRAY_SIZE(data); ++i) + data[i] = i; + resource_data.pSysMem = data; + resource_data.SysMemPitch = 0; + resource_data.SysMemSlicePitch = 0; + + buffer_desc.ByteWidth = sizeof(data); + buffer_desc.Usage = D3D11_USAGE_DYNAMIC; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer2); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ, 0, &map_desc); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ_WRITE, 0, &map_desc); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE, 0, &map_desc); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc); + ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + map_data = map_desc.pData; + /* The previous contents of map_data are undefined and may in practice be + * uninitialized garbage. */ + for (i = 0; i < ARRAY_SIZE(data); ++i) + map_data[i] = 2 * i; + + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + map_data[i] = 2 * i; + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list); + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == 2 * i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11CommandList_Release(list); + + /* Test WRITE_NO_OVERWRITE. */ + + hr = ID3D11DeviceContext_Map(immediate, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + map_data[i] = i; + ID3D11DeviceContext_Unmap(immediate, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc); + ok(hr == D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + map_data[i] = 2 * i; + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ, 0, &map_desc); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_READ_WRITE, 0, &map_desc); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE, 0, &map_desc); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + ok(map_data[i] == 2 * i, "Got unexpected value %.8e at %u.\n", map_data[i], i); + if (i % 2) + map_data[i] = 3 * i; + } + memcpy(data, map_data, sizeof(data)); + + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + ok(map_data[i] == data[i], "Got unexpected value %.8e at %u.\n", map_data[i], i); + if (i % 3) + map_data[i] = 4 * i; + } + memcpy(data, map_data, sizeof(data)); + + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list); + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == data[i], "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11CommandList_Release(list); + + /* Do something with the mapped data from within the deferred context. */ + + hr = ID3D11DeviceContext_Map(immediate, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + map_data[i] = i; + ID3D11DeviceContext_Unmap(immediate, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + map_data[i] = 2 * i; + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + ID3D11DeviceContext_CopyResource(deferred, (ID3D11Resource *)buffer2, (ID3D11Resource *)buffer); + + hr = ID3D11DeviceContext_Map(deferred, (ID3D11Resource *)buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + map_data = map_desc.pData; + for (i = 0; i < ARRAY_SIZE(data); ++i) + map_data[i] = 3 * i; + ID3D11DeviceContext_Unmap(deferred, (ID3D11Resource *)buffer, 0); + + hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list); + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE); + + get_buffer_readback(buffer2, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == 2 * i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == 3 * i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11CommandList_Release(list); + + ID3D11Buffer_Release(buffer2); + ID3D11Buffer_Release(buffer); + ID3D11DeviceContext_Release(deferred); + release_test_context(&test_context); +} + START_TEST(d3d11) { unsigned int argc, i; @@ -32876,6 +33114,7 @@ START_TEST(d3d11) queue_test(test_deferred_context_state); queue_test(test_deferred_context_swap_state); queue_test(test_deferred_context_rendering); + queue_test(test_deferred_context_map); queue_test(test_unbound_streams);
run_queued_tests();
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=91039
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0.
=== debiant2 (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:9661: Test failed: d3d11.c:15022: Test marked todo: Test 60: Got unexpected color 0xffffffff at (0, 2). d3d11.c:9661: Test failed: Got hr 0 for WRITE. d3d11.c:9661: Test failed: d3d11.c:15113: Test marked todo: Got hr 0 for WRITE_NO_OVERWRITE. d3d11.c:9661: Test failed: d3d11.c:15022: Test marked todo: Got hr 0 for WRITE.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/tests/d3d11.c | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index e5d46f445a4..0f5ba6c3663 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -32940,6 +32940,51 @@ static void test_deferred_context_map(void)
ID3D11Buffer_Release(buffer2); ID3D11Buffer_Release(buffer); + + /* Test UpdateSubresource. */ + + for (i = 0; i < ARRAY_SIZE(data); ++i) + data[i] = i; + + buffer_desc.ByteWidth = sizeof(data); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer2); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(data); ++i) + data[i] = 2 * i; + ID3D11DeviceContext_UpdateSubresource(deferred, (ID3D11Resource *)buffer, 0, NULL, data, 0, 0); + + hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list); + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == 2 * i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11CommandList_Release(list); + + ID3D11Buffer_Release(buffer2); + ID3D11Buffer_Release(buffer); + ID3D11DeviceContext_Release(deferred); release_test_context(&test_context); }
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=91040
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0.
=== w10pro64 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5658: Test failed: Got unexpected query result 0x0000000000000000.
=== debiant2 (32 bit Arabic:Morocco report) ===
d3d11: d3d11.c:5817: Test failed: Got unexpected hr 0x1.
=== debiant2 (32 bit French report) ===
d3d11: d3d11.c:9661: Test failed: d3d11.c:15022: Test marked todo: Test 60: Got unexpected color 0xff000000 at (2, 1). d3d11.c:9661: Test failed: Got hr 0 for WRITE.
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=91037
Your paranoid android.
=== debiant2 (32 bit Hebrew:Israel report) ===
d3d11: d3d11.c:9661: Test failed: d3d11.c:15022: Test marked todo: Got hr 0 for WRITE. d3d11.c:9661: Test failed: d3d11.c:15113: Test marked todo: Got hr 0 for WRITE_NO_OVERWRITE. d3d11.c:9661: Test failed: d3d11.c:15113: Test marked todo: Got hr 0 for WRITE_DISCARD.
=== debiant2 (32 bit Chinese:China report) ===
d3d11: d3d11.c:9661: Test failed: d3d11.c:15141: Test marked todo: Got hr 0 for WRITE_DISCARD.