From: Zebediah Figura zfigura@codeweavers.com
--- dlls/d3d11/tests/d3d11.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 221f17679b0..613dac57f5f 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -35619,15 +35619,18 @@ static void test_high_resource_count(void) D3D11_BUFFER_DESC buffer_desc = {0}; ID3D11ShaderResourceView *srvs[100]; ID3D11Texture2D *textures[50], *rt; + D3D11_MAPPED_SUBRESOURCE map_desc; ID3D11SamplerState *samplers[2]; ID3D11DeviceContext *context; ID3D11RenderTargetView *rtv; ID3D11Buffer *buffers[50]; ID3D11PixelShader *ps; ID3D11Device *device; + float *data_ptr; HRESULT hr;
static const struct vec4 expect = {1274.0f, 637.0f, 1225.0f, 0.0f}; + static const struct vec4 expect2 = {1274.0f, 637.0f, 1325.0f, 0.0f};
static const DWORD ps_code[] = { @@ -36097,7 +36100,8 @@ static void test_high_resource_count(void) D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc;
buffer_desc.ByteWidth = sizeof(data); - buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.Usage = D3D11_USAGE_DYNAMIC; + buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; buffer_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &data_desc, &buffers[i]); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -36134,6 +36138,18 @@ static void test_high_resource_count(void)
check_texture_vec4(rt, &expect, 0);
+ /* Discard the data in one of the buffers and draw again. */ + + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)buffers[1], 0, D3D11_MAP_WRITE_DISCARD, 0, &map_desc); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + data_ptr = map_desc.pData; + data_ptr[0] = 102.0f; + data_ptr[1] = 0.0f; + ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)buffers[1], 0); + draw_quad(&test_context); + + todo_wine_if (!damavand) check_texture_vec4(rt, &expect2, 0); + ID3D11Texture2D_Release(rt); ID3D11RenderTargetView_Release(rtv); for (unsigned int i = 0; i < ARRAY_SIZE(srvs); ++i)
From: Zebediah Figura zfigura@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56438 --- dlls/d3d11/tests/d3d11.c | 2 +- dlls/wined3d/view.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 613dac57f5f..24fdb32b829 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -36148,7 +36148,7 @@ static void test_high_resource_count(void) ID3D11DeviceContext_Unmap(context, (ID3D11Resource *)buffers[1], 0); draw_quad(&test_context);
- todo_wine_if (!damavand) check_texture_vec4(rt, &expect2, 0); + check_texture_vec4(rt, &expect2, 0);
ID3D11Texture2D_Release(rt); ID3D11RenderTargetView_Release(rtv); diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index a829a3b5ca2..09d1bfd32a1 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -269,7 +269,17 @@ static void create_buffer_texture(struct wined3d_gl_view *view, struct wined3d_c
view->target = GL_TEXTURE_BUFFER; if (!view->name) + { gl_info->gl_ops.gl.p_glGenTextures(1, &view->name); + } + else if (gl_info->supported[ARB_BINDLESS_TEXTURE]) + { + /* If we already bound this view to a shader, we acquired a handle to + * it, and it's now immutable. This means we can't bind a new buffer + * storage to it, so recreate the texture. */ + gl_info->gl_ops.gl.p_glDeleteTextures(1, &view->name); + gl_info->gl_ops.gl.p_glGenTextures(1, &view->name); + }
wined3d_context_gl_bind_texture(context_gl, GL_TEXTURE_BUFFER, view->name); if (gl_info->supported[ARB_TEXTURE_BUFFER_RANGE])
From: Zebediah Figura zfigura@codeweavers.com
This can happen legitimately if the sampler access was optimized out. --- dlls/wined3d/glsl_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 9ba9b2e1d4c..698f8ceb13a 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -10784,7 +10784,7 @@ static void shader_glsl_load_bindless_samplers(struct shader_glsl_priv *priv, st string_buffer_sprintf(sampler_name, "%s_sampler%u", prefix, entry->bind_idx); name_loc = GL_EXTCALL(glGetUniformLocation(ctx_data->glsl_program->id, sampler_name->buffer)); if (name_loc == -1) - ERR("No uniform location for shader %#x, binding %u, name %s.\n", shader_type, i, sampler_name->buffer); + continue;
if ((view = state->shader_resource_view[shader_type][entry->resource_idx])) {
This merge request was approved by Matteo Bruni.
This merge request was approved by Jan Sikorski.