Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2022
- 68 participants
- 3274 messages
Re: [PATCH v2 0/3] MR208: dinput/tests: Cleanup old tests and merge more dinput8 / dinput tests together.
by Rémi Bernon
Should be good now.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/208#note_1750
June 9, 2022
[PATCH] shell32: Implement SHBindToFolderIDListParent.
by Dmitry Timoshkov
Based on SHBindToParent and SHBindToObject implementations.
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/shell32/pidl.c | 56 +++++++++++++++++++++++++++++++++++++++
dlls/shell32/shell32.spec | 1 +
2 files changed, 57 insertions(+)
diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c
index f9c91a79132..f004b2ff1b6 100644
--- a/dlls/shell32/pidl.c
+++ b/dlls/shell32/pidl.c
@@ -1364,6 +1364,62 @@ HRESULT WINAPI SHBindToObject(IShellFolder *psf, LPCITEMIDLIST pidl, IBindCtx *p
}
+HRESULT WINAPI SHBindToFolderIDListParent(IShellFolder *psf, LPCITEMIDLIST pidl,
+ REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast)
+{
+ IShellFolder *psfDesktop = NULL;
+ LPITEMIDLIST pidlChild;
+ LPITEMIDLIST pidlParent;
+ HRESULT hr;
+
+ TRACE_(shell)("%p,%p,%s,%p,%p\n", psf, pidl, debugstr_guid(riid), ppv, ppidlLast);
+ pdump(pidl);
+
+ if (!ppv)
+ return E_INVALIDARG;
+
+ *ppv = NULL;
+
+ if (!psf)
+ {
+ hr = SHGetDesktopFolder(&psfDesktop);
+ if (FAILED(hr))
+ return hr;
+ psf = psfDesktop;
+ }
+
+ if (ppidlLast)
+ *ppidlLast = NULL;
+
+ if (_ILIsPidlSimple(pidl))
+ {
+ /* we are on desktop level */
+ if (ppidlLast)
+ *ppidlLast = ILClone(pidl);
+ hr = SHGetDesktopFolder((IShellFolder **)ppv);
+ }
+ else
+ {
+ pidlChild = ILClone(ILFindLastID(pidl));
+ pidlParent = ILClone(pidl);
+ ILRemoveLastID(pidlParent);
+
+ hr = IShellFolder_BindToObject(psf, pidlParent, NULL, riid, ppv);
+ if (SUCCEEDED(hr) && ppidlLast)
+ *ppidlLast = pidlChild;
+ else
+ ILFree(pidlChild);
+ ILFree(pidlParent);
+ }
+
+ if (psfDesktop)
+ IShellFolder_Release(psfDesktop);
+
+ TRACE_(shell)("-- ppv=%p ret=0x%08lx\n", *ppv, hr);
+ return hr;
+}
+
+
/*************************************************************************
* SHParseDisplayName [SHELL32.@]
*/
diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec
index f8bf8f246e8..5b812774e1f 100644
--- a/dlls/shell32/shell32.spec
+++ b/dlls/shell32/shell32.spec
@@ -334,6 +334,7 @@
@ stdcall SHAssocEnumHandlers(wstr long ptr)
@ stdcall SHBindToObject(ptr ptr ptr ptr ptr)
@ stdcall SHBindToParent(ptr ptr ptr ptr)
+@ stdcall SHBindToFolderIDListParent(ptr ptr ptr ptr ptr)
@ stdcall SHBrowseForFolder(ptr) SHBrowseForFolderA
@ stdcall SHBrowseForFolderA(ptr)
@ stdcall SHBrowseForFolderW(ptr)
--
2.36.1
June 9, 2022
[PATCH] sechost: Support decimal access rights in ConvertStringSecurityDescriptorToSecurityDescriptor.
by Dmitry Timoshkov
Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru>
---
dlls/advapi32/tests/security.c | 1 +
dlls/sechost/security.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index ed91ccc39d3..1a874de75c4 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -4240,6 +4240,7 @@ static void test_ConvertStringSecurityDescriptor(void)
{ "D:(D;;GA;;;WD )", SDDL_REVISION_1, TRUE },
/* test ACE string access rights */
{ "D:(A;;GA;;;WD)", SDDL_REVISION_1, TRUE },
+ { "D:(A;;1;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;GRGWGX;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;RCSDWDWO;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;RPWPCCDCLCSWLODTCR;;;WD)", SDDL_REVISION_1, TRUE },
diff --git a/dlls/sechost/security.c b/dlls/sechost/security.c
index 6916b3ad662..f6fcffd9cfc 100644
--- a/dlls/sechost/security.c
+++ b/dlls/sechost/security.c
@@ -903,6 +903,9 @@ static DWORD parse_ace_right( const WCHAR **string_ptr )
if (string[0] == '0' && string[1] == 'x')
return wcstoul( string, (WCHAR **)string_ptr, 16 );
+ if (iswdigit( string[0] ))
+ return wcstoul( string, (WCHAR **)string_ptr, 10 );
+
for (i = 0; i < ARRAY_SIZE(ace_rights); ++i)
{
if (!wcsncmp( string, ace_rights[i].str, 2 ))
--
2.36.1
June 9, 2022
Re: [PATCH] wbemprox: Add a few properties to Win32_QuickFixEngineering.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
June 9, 2022
Re: [PATCH v2 0/2] MR210: winhttp: Use completion port for overlapped send. - approved
by Hans Leidekker (@hans)
This merge request was approved by Hans Leidekker.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/210
June 9, 2022
Re: [PATCH vkd3d v6 1/9] tests/shader_runner: Allow creating UAV resources.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Il 09/06/22 01:18, Zebediah Figura ha scritto:
> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
> ---
> v6: avoid magic numbers...
>
> tests/shader_runner.c | 38 +++++++++++++++++++---------
> tests/shader_runner.h | 2 ++
> tests/shader_runner_d3d11.c | 31 ++++++++++++++++++-----
> tests/shader_runner_d3d12.c | 37 +++++++++++++++++++++------
> tests/shader_runner_d3d9.c | 12 ++++++---
> tests/shader_runner_vulkan.c | 48 ++++++++++++++++++++++++++++--------
> 6 files changed, 130 insertions(+), 38 deletions(-)
>
> diff --git a/tests/shader_runner.c b/tests/shader_runner.c
> index 05e2a8a41..83f804ad3 100644
> --- a/tests/shader_runner.c
> +++ b/tests/shader_runner.c
> @@ -78,14 +78,13 @@ enum parse_state
> STATE_PREPROC,
> STATE_PREPROC_INVALID,
> STATE_REQUIRE,
> + STATE_RESOURCE,
> STATE_SAMPLER,
> STATE_SHADER_INVALID_PIXEL,
> STATE_SHADER_INVALID_PIXEL_TODO,
> STATE_SHADER_PIXEL,
> STATE_SHADER_VERTEX,
> - STATE_TEXTURE,
> STATE_TEST,
> - STATE_VERTEX_BUFFER,
> };
>
> static bool match_string(const char *line, const char *token, const char **const rest)
> @@ -314,6 +313,13 @@ static void parse_input_layout_directive(struct shader_runner *runner, const cha
> element->index = 0;
> }
>
> +void init_resource(struct resource *resource, const struct resource_params *params)
> +{
> + resource->type = params->type;
> + resource->slot = params->slot;
> + resource->size = params->data_size;
> +}
> +
> static void set_resource(struct shader_runner *runner, struct resource *resource)
> {
> size_t i;
> @@ -617,8 +623,7 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const
> goto out;
> break;
>
> - case STATE_TEXTURE:
> - case STATE_VERTEX_BUFFER:
> + case STATE_RESOURCE:
> set_resource(runner, runner->ops->create_resource(runner, ¤t_resource));
> free(current_resource.data);
> break;
> @@ -766,7 +771,7 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const
> }
> else if (sscanf(line, "[texture %u]\n", &index))
> {
> - state = STATE_TEXTURE;
> + state = STATE_RESOURCE;
>
> memset(¤t_resource, 0, sizeof(current_resource));
>
> @@ -776,9 +781,21 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const
> current_resource.data_type = TEXTURE_DATA_FLOAT;
> current_resource.texel_size = 16;
> }
> + else if (sscanf(line, "[uav %u]\n", &index))
> + {
> + state = STATE_RESOURCE;
> +
> + memset(¤t_resource, 0, sizeof(current_resource));
> +
> + current_resource.slot = index;
> + current_resource.type = RESOURCE_TYPE_UAV;
> + current_resource.format = DXGI_FORMAT_R32G32B32A32_FLOAT;
> + current_resource.data_type = TEXTURE_DATA_FLOAT;
> + current_resource.texel_size = 16;
> + }
> else if (sscanf(line, "[vertex buffer %u]\n", &index))
> {
> - state = STATE_VERTEX_BUFFER;
> + state = STATE_RESOURCE;
>
> memset(¤t_resource, 0, sizeof(current_resource));
>
> @@ -844,13 +861,12 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const
> parse_require_directive(runner, line);
> break;
>
> - case STATE_SAMPLER:
> - parse_sampler_directive(current_sampler, line);
> + case STATE_RESOURCE:
> + parse_resource_directive(¤t_resource, line);
> break;
>
> - case STATE_TEXTURE:
> - case STATE_VERTEX_BUFFER:
> - parse_resource_directive(¤t_resource, line);
> + case STATE_SAMPLER:
> + parse_sampler_directive(current_sampler, line);
> break;
>
> case STATE_TEST:
> diff --git a/tests/shader_runner.h b/tests/shader_runner.h
> index 6ed0109e6..60f894583 100644
> --- a/tests/shader_runner.h
> +++ b/tests/shader_runner.h
> @@ -54,6 +54,7 @@ struct sampler
> enum resource_type
> {
> RESOURCE_TYPE_TEXTURE,
> + RESOURCE_TYPE_UAV,
> RESOURCE_TYPE_VERTEX_BUFFER,
> };
>
> @@ -130,6 +131,7 @@ struct shader_runner_ops
> void fatal_error(const char *format, ...) VKD3D_NORETURN VKD3D_PRINTF_FUNC(1, 2);
>
> unsigned int get_vb_stride(const struct shader_runner *runner, unsigned int slot);
> +void init_resource(struct resource *resource, const struct resource_params *params);
>
> void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const struct shader_runner_ops *ops);
>
> diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c
> index 6edbdf75e..b80a8b65f 100644
> --- a/tests/shader_runner_d3d11.c
> +++ b/tests/shader_runner_d3d11.c
> @@ -44,6 +44,7 @@ struct d3d11_resource
>
> ID3D11Resource *resource;
> ID3D11ShaderResourceView *srv;
> + ID3D11UnorderedAccessView *uav;
> };
>
> static struct d3d11_resource *d3d11_resource(struct resource *r)
> @@ -374,13 +375,12 @@ static struct resource *d3d11_runner_create_resource(struct shader_runner *r, co
> HRESULT hr;
>
> resource = calloc(1, sizeof(*resource));
> -
> - resource->r.slot = params->slot;
> - resource->r.type = params->type;
> + init_resource(&resource->r, params);
>
> switch (params->type)
> {
> case RESOURCE_TYPE_TEXTURE:
> + case RESOURCE_TYPE_UAV:
> {
> D3D11_TEXTURE2D_DESC desc = {0};
>
> @@ -391,7 +391,10 @@ static struct resource *d3d11_runner_create_resource(struct shader_runner *r, co
> desc.Format = params->format;
> desc.SampleDesc.Count = 1;
> desc.Usage = D3D11_USAGE_DEFAULT;
> - desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
> + if (params->type == RESOURCE_TYPE_UAV)
> + desc.BindFlags = D3D11_BIND_UNORDERED_ACCESS;
> + else
> + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
>
> resource_data.pSysMem = params->data;
> resource_data.SysMemPitch = params->width * params->texel_size;
> @@ -399,8 +402,11 @@ static struct resource *d3d11_runner_create_resource(struct shader_runner *r, co
>
> hr = ID3D11Device_CreateTexture2D(device, &desc, &resource_data, (ID3D11Texture2D **)&resource->resource);
> ok(hr == S_OK, "Failed to create texture, hr %#lx.\n", hr);
> - hr = ID3D11Device_CreateShaderResourceView(device, resource->resource, NULL, &resource->srv);
> - ok(hr == S_OK, "Failed to create shader resource view, hr %#lx.\n", hr);
> + if (params->type == RESOURCE_TYPE_UAV)
> + hr = ID3D11Device_CreateUnorderedAccessView(device, resource->resource, NULL, &resource->uav);
> + else
> + hr = ID3D11Device_CreateShaderResourceView(device, resource->resource, NULL, &resource->srv);
> + ok(hr == S_OK, "Failed to create view, hr %#lx.\n", hr);
> break;
> }
>
> @@ -420,14 +426,18 @@ static void d3d11_runner_destroy_resource(struct shader_runner *r, struct resour
> ID3D11Resource_Release(resource->resource);
> if (resource->srv)
> ID3D11ShaderResourceView_Release(resource->srv);
> + if (resource->uav)
> + ID3D11UnorderedAccessView_Release(resource->uav);
> free(resource);
> }
>
> static bool d3d11_runner_draw(struct shader_runner *r,
> D3D_PRIMITIVE_TOPOLOGY primitive_topology, unsigned int vertex_count)
> {
> + ID3D11UnorderedAccessView *uavs[D3D11_PS_CS_UAV_REGISTER_COUNT] = {0};
> struct d3d11_shader_runner *runner = d3d11_shader_runner(r);
> ID3D11DeviceContext *context = runner->immediate_context;
> + unsigned int min_uav_slot = ARRAY_SIZE(uavs);
> ID3D11Device *device = runner->device;
> ID3D10Blob *vs_code, *ps_code;
> ID3D11Buffer *cb = NULL;
> @@ -472,6 +482,11 @@ static bool d3d11_runner_draw(struct shader_runner *r,
> ID3D11DeviceContext_PSSetShaderResources(context, resource->r.slot, 1, &resource->srv);
> break;
>
> + case RESOURCE_TYPE_UAV:
> + uavs[resource->r.slot] = resource->uav;
> + min_uav_slot = min(min_uav_slot, resource->r.slot);
> + break;
> +
> case RESOURCE_TYPE_VERTEX_BUFFER:
> ID3D11DeviceContext_IASetVertexBuffers(context, resource->r.slot, 1,
> (ID3D11Buffer **)&resource->resource, &stride, &offset);
> @@ -479,6 +494,10 @@ static bool d3d11_runner_draw(struct shader_runner *r,
> }
> }
>
> + ID3D11DeviceContext_OMSetRenderTargetsAndUnorderedAccessViews(context,
> + D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL, NULL, NULL,
> + min_uav_slot, ARRAY_SIZE(uavs) - min_uav_slot, &uavs[min_uav_slot], NULL);
> +
> for (i = 0; i < runner->r.sampler_count; ++i)
> {
> struct sampler *sampler = &runner->r.samplers[i];
> diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c
> index 22c9b2266..ec08fea54 100644
> --- a/tests/shader_runner_d3d12.c
> +++ b/tests/shader_runner_d3d12.c
> @@ -79,7 +79,7 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons
> return blob;
> }
>
> -#define MAX_RESOURCE_DESCRIPTORS 256
> +#define MAX_RESOURCE_DESCRIPTORS (MAX_RESOURCES * 2)
>
> static struct resource *d3d12_runner_create_resource(struct shader_runner *r, const struct resource_params *params)
> {
> @@ -90,9 +90,7 @@ static struct resource *d3d12_runner_create_resource(struct shader_runner *r, co
> struct d3d12_resource *resource;
>
> resource = calloc(1, sizeof(*resource));
> - resource->r.slot = params->slot;
> - resource->r.type = params->type;
> - resource->r.size = params->data_size;
> + init_resource(&resource->r, params);
>
> switch (params->type)
> {
> @@ -101,9 +99,6 @@ static struct resource *d3d12_runner_create_resource(struct shader_runner *r, co
> runner->heap = create_gpu_descriptor_heap(device,
> D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, MAX_RESOURCE_DESCRIPTORS);
>
> - if (params->slot >= MAX_RESOURCE_DESCRIPTORS)
> - fatal_error("Resource slot %u is too high; please increase MAX_RESOURCE_DESCRIPTORS.\n", params->slot);
> -
> resource->resource = create_default_texture(device, params->width, params->height,
> params->format, 0, D3D12_RESOURCE_STATE_COPY_DEST);
> resource_data.pData = params->data;
> @@ -116,6 +111,23 @@ static struct resource *d3d12_runner_create_resource(struct shader_runner *r, co
> NULL, get_cpu_descriptor_handle(test_context, runner->heap, resource->r.slot));
> break;
>
> + case RESOURCE_TYPE_UAV:
> + if (!runner->heap)
> + runner->heap = create_gpu_descriptor_heap(device,
> + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, MAX_RESOURCE_DESCRIPTORS);
> +
> + resource->resource = create_default_texture(device, params->width, params->height,
> + params->format, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_DEST);
> + resource_data.pData = params->data;
> + resource_data.SlicePitch = resource_data.RowPitch = params->width * params->texel_size;
> + upload_texture_data(resource->resource, &resource_data, 1, test_context->queue, test_context->list);
> + reset_command_list(test_context->list, test_context->allocator);
> + transition_resource_state(test_context->list, resource->resource,
> + D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
> + ID3D12Device_CreateUnorderedAccessView(device, resource->resource,
> + NULL, NULL, get_cpu_descriptor_handle(test_context, runner->heap, resource->r.slot + MAX_RESOURCES));
> + break;
> +
> case RESOURCE_TYPE_VERTEX_BUFFER:
> resource->resource = create_upload_buffer(device, params->data_size, params->data);
> break;
> @@ -192,6 +204,7 @@ static bool d3d12_runner_draw(struct shader_runner *r,
> switch (resource->r.type)
> {
> case RESOURCE_TYPE_TEXTURE:
> + case RESOURCE_TYPE_UAV:
> range = &resource->descriptor_range;
>
> resource->root_index = root_signature_desc.NumParameters++;
> @@ -201,7 +214,10 @@ static bool d3d12_runner_draw(struct shader_runner *r,
> root_param->DescriptorTable.pDescriptorRanges = range;
> root_param->ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
>
> - range->RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV;
> + if (resource->r.type == RESOURCE_TYPE_UAV)
> + range->RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_UAV;
> + else
> + range->RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV;
> range->NumDescriptors = 1;
> range->BaseShaderRegister = resource->r.slot;
> range->RegisterSpace = 0;
> @@ -281,6 +297,11 @@ static bool d3d12_runner_draw(struct shader_runner *r,
> get_gpu_descriptor_handle(test_context, runner->heap, resource->r.slot));
> break;
>
> + case RESOURCE_TYPE_UAV:
> + ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(command_list, resource->root_index,
> + get_gpu_descriptor_handle(test_context, runner->heap, resource->r.slot + MAX_RESOURCES));
> + break;
> +
> case RESOURCE_TYPE_VERTEX_BUFFER:
> vbv.BufferLocation = ID3D12Resource_GetGPUVirtualAddress(resource->resource);
> vbv.StrideInBytes = get_vb_stride(&runner->r, resource->r.slot);
> diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c
> index b9ec55b4e..417d68750 100644
> --- a/tests/shader_runner_d3d9.c
> +++ b/tests/shader_runner_d3d9.c
> @@ -222,9 +222,7 @@ static struct resource *d3d9_runner_create_resource(struct shader_runner *r, con
> void *data;
>
> resource = calloc(1, sizeof(*resource));
> - resource->r.slot = params->slot;
> - resource->r.type = params->type;
> - resource->r.size = params->data_size;
> + init_resource(&resource->r, params);
>
> switch (params->type)
> {
> @@ -257,6 +255,10 @@ static struct resource *d3d9_runner_create_resource(struct shader_runner *r, con
> ok(hr == D3D_OK, "Failed to unmap texture, hr %#lx.\n", hr);
> break;
>
> + case RESOURCE_TYPE_UAV:
> + fatal_error("UAVs are not supported.\n");
> + break;
> +
> case RESOURCE_TYPE_VERTEX_BUFFER:
> hr = IDirect3DDevice9_CreateVertexBuffer(device, params->data_size,
> D3DUSAGE_DYNAMIC, 0, D3DPOOL_DEFAULT, &resource->vb, NULL);
> @@ -366,6 +368,10 @@ static bool d3d9_runner_draw(struct shader_runner *r,
> ok(hr == D3D_OK, "Failed to set texture, hr %#lx.\n", hr);
> break;
>
> + case RESOURCE_TYPE_UAV:
> + assert(0);
> + break;
> +
> case RESOURCE_TYPE_VERTEX_BUFFER:
> for (j = 0; j < runner->r.input_element_count; ++j)
> {
> diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c
> index 601eb5a17..f5a0e7ec3 100644
> --- a/tests/shader_runner_vulkan.c
> +++ b/tests/shader_runner_vulkan.c
> @@ -245,17 +245,25 @@ static struct resource *vulkan_runner_create_resource(struct shader_runner *r, c
> void *data;
>
> resource = calloc(1, sizeof(*resource));
> -
> - resource->r.slot = params->slot;
> - resource->r.type = params->type;
> + init_resource(&resource->r, params);
>
> switch (params->type)
> {
> case RESOURCE_TYPE_TEXTURE:
> + case RESOURCE_TYPE_UAV:
> + {
> + VkImageUsageFlagBits usage = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
> + VkImageLayout layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
> +
> format = vkd3d_get_vk_format(params->format);
>
> - resource->image = create_2d_image(runner, params->width, params->height,
> - VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT, format, &resource->memory);
> + if (params->type == RESOURCE_TYPE_UAV)
> + {
> + layout = VK_IMAGE_LAYOUT_GENERAL;
> + usage |= VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
> + }
> +
> + resource->image = create_2d_image(runner, params->width, params->height, usage, format, &resource->memory);
> resource->view = create_2d_image_view(runner, resource->image, format);
>
> staging_buffer = create_buffer(runner, params->data_size,
> @@ -277,14 +285,14 @@ static struct resource *vulkan_runner_create_resource(struct shader_runner *r, c
> VK_CALL(vkCmdCopyBufferToImage(runner->cmd_buffer, staging_buffer, resource->image,
> VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion));
>
> - transition_image_layout(runner, resource->image,
> - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
> + transition_image_layout(runner, resource->image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, layout);
>
> end_command_buffer(runner);
>
> VK_CALL(vkFreeMemory(device, staging_memory, NULL));
> VK_CALL(vkDestroyBuffer(device, staging_buffer, NULL));
> break;
> + }
>
> case RESOURCE_TYPE_VERTEX_BUFFER:
> resource->buffer = create_buffer(runner, params->data_size, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT,
> @@ -383,8 +391,12 @@ static bool compile_shader(const struct vulkan_shader_runner *runner, const char
> break;
>
> case RESOURCE_TYPE_TEXTURE:
> + case RESOURCE_TYPE_UAV:
> binding = &bindings[interface_info.binding_count++];
> - binding->type = VKD3D_SHADER_DESCRIPTOR_TYPE_SRV;
> + if (resource->r.type == RESOURCE_TYPE_UAV)
> + binding->type = VKD3D_SHADER_DESCRIPTOR_TYPE_UAV;
> + else
> + binding->type = VKD3D_SHADER_DESCRIPTOR_TYPE_SRV;
> binding->register_space = 0;
> binding->register_index = resource->r.slot;
> binding->shader_visibility = VKD3D_SHADER_VISIBILITY_ALL;
> @@ -557,6 +569,7 @@ static VkPipeline create_pipeline(const struct vulkan_shader_runner *runner,
> switch (resource->r.type)
> {
> case RESOURCE_TYPE_TEXTURE:
> + case RESOURCE_TYPE_UAV:
> break;
>
> case RESOURCE_TYPE_VERTEX_BUFFER:
> @@ -662,12 +675,16 @@ static VkDescriptorSetLayout create_descriptor_set_layout(struct vulkan_shader_r
> break;
>
> case RESOURCE_TYPE_TEXTURE:
> + case RESOURCE_TYPE_UAV:
> binding = &bindings[set_desc.bindingCount++];
>
> resource->binding = binding_index++;
>
> binding->binding = resource->binding;
> - binding->descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
> + if (resource->r.type == RESOURCE_TYPE_UAV)
> + binding->descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
> + else
> + binding->descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
> binding->descriptorCount = 1;
> binding->stageFlags = VK_SHADER_STAGE_ALL;
> binding->pImmutableSamplers = NULL;
> @@ -729,6 +746,7 @@ static void bind_resources(struct vulkan_shader_runner *runner, VkPipelineBindPo
> switch (resource->r.type)
> {
> case RESOURCE_TYPE_TEXTURE:
> + case RESOURCE_TYPE_UAV:
> image_info.imageView = resource->view;
> image_info.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
>
> @@ -739,6 +757,12 @@ static void bind_resources(struct vulkan_shader_runner *runner, VkPipelineBindPo
> write.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
> write.pImageInfo = &image_info;
>
> + if (resource->r.type == RESOURCE_TYPE_UAV)
> + {
> + image_info.imageLayout = VK_IMAGE_LAYOUT_GENERAL;
> + write.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
> + }
> +
> VK_CALL(vkUpdateDescriptorSets(runner->device, 1, &write, 0, NULL));
> break;
>
> @@ -967,7 +991,7 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
> VkInstanceCreateInfo instance_desc = {.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO};
> VkDeviceCreateInfo device_desc = {.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO};
> VkPhysicalDeviceFeatures ret_features, features;
> - VkDescriptorPoolSize descriptor_pool_sizes[2];
> + VkDescriptorPoolSize descriptor_pool_sizes[3];
> VkAttachmentDescription attachment_desc = {0};
> static const float queue_priority = 1.0f;
> VkSubpassDescription subpass_desc = {0};
> @@ -1049,7 +1073,9 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
> } \
> features.x = VK_TRUE
>
> + ENABLE_FEATURE(fragmentStoresAndAtomics);
> ENABLE_FEATURE(shaderImageGatherExtended);
> + ENABLE_FEATURE(shaderStorageImageWriteWithoutFormat);
>
> if ((vr = VK_CALL(vkCreateDevice(runner->phys_device, &device_desc, NULL, &device))))
> {
> @@ -1115,6 +1141,8 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
> descriptor_pool_sizes[0].descriptorCount = MAX_RESOURCES;
> descriptor_pool_sizes[1].type = VK_DESCRIPTOR_TYPE_SAMPLER;
> descriptor_pool_sizes[1].descriptorCount = MAX_SAMPLERS;
> + descriptor_pool_sizes[2].type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE;
> + descriptor_pool_sizes[2].descriptorCount = MAX_RESOURCES;
>
> descriptor_pool_desc.maxSets = 1;
> descriptor_pool_desc.poolSizeCount = ARRAY_SIZE(descriptor_pool_sizes);
June 9, 2022
Re: [PATCH 0/7] MR211: win32u: user32 conversion - approved
by Huw Davies (@huw)
This merge request was approved by Huw Davies.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/211
June 9, 2022
Re: HLSL offsetting
by Matteo Bruni
First of all, thanks for starting this thread: very nice overview of
the problem and what we tried and figured out over time.
On Thu, Jun 9, 2022 at 3:33 AM Zebediah Figura <zfigura(a)codeweavers.com> wrote:
>
> The following thread is based partly on, and makes reference to, private
> conversation, but for the sake of openness I've elected to post it to
> wine-devel.
>
> A long time ago, HLSL_IR_LOAD—then called HLSL_IR_DEREF—was this:
>
> enum hlsl_ir_deref_type
> {
> HLSL_IR_DEREF_VAR,
> HLSL_IR_DEREF_ARRAY,
> HLSL_IR_DEREF_RECORD,
> };
>
> struct hlsl_deref
> {
> enum hlsl_ir_deref_type type;
> union
> {
> struct hlsl_ir_var *var;
> struct
> {
> struct hlsl_ir_node *array;
> struct hlsl_ir_node *index;
> } array;
> struct
> {
> struct hlsl_ir_node *record;
> struct hlsl_struct_field *field;
> } record;
> } v;
> };
>
> struct hlsl_ir_deref
> {
> struct hlsl_ir_node node;
> struct hlsl_deref src;
> };
>
> Now, one problem with this is that it was kind of mean to RA and
> liveness analysis. For example, a line of HLSL like
>
> var.a.b = 2.0;
>
> produced the following IR:
>
> 2: 2.0
> 3: deref(var)
> 4: @3.b
> 5: @4.c = @2
>
> This is annoying because:
>
> * to discover that "var" is written, @5 needs to reach upwards through
> a deref chain;
>
> * reaching through the deref chain requires lots of assert() statements;
>
> * @3 implies that "var" is read, which it isn't (and, if we reach
> upwards through the deref chain, @4 implies the same thing).
>
> I proposed that instead of using generic node pointers, we could have
> arbitrarily long deref chains encoded in the hlsl_deref structure
> itself. [1]
>
> There was some discussion on that—which is mostly concentrated in that
> thread, and also IRC. Most of the concern is about being nicer to
> liveness analysis and RA.
>
> What ultimately ended up happening is that Matteo proposed numeric
> (register) offsets calculated at parse time, which is fundamentally
> similar to my idea except that it's a lot simpler to work with.
>
> Interestingly, the problem of multiple register sets was brought up [2]:
>
> From my testing it essentially does, yes, i.e. if you have
>
> struct { int unused; float f; bool b; } s;
> float4 main(float4 pos : POSITION) : POSITION
> {
> if (s.b)
> return s.f;
> return pos;
> }
>
> then "s" gets allocated to registers b0-b2 and c0-c1, but only b2
> and c1 are ever used.
>
> So yeah, it makes things pretty simple. I can see how it would have
> been a lot uglier otherwise.
>
> I guess we've finally run into that ugliness now :-(
>
> The ultimate conclusions to draw from this historical exercise are:
>
> - what I said about "we used to have derefs handled like that" is mostly
> correct, although not quite. We did used to have more rich type
> information, and we did decide that offsets calculated at parse time
> were preferable to that type information, although I thought we at one
> point had something like [1] in the tree, which we didn't. Anyway the
> decision to use offsets calculated at parse time seems to have been
> motivated only by simplicity. To be fair, at the time, it *was* simpler.
It still is simpler, baseline. Unfortunately it's now clear that in
general it comes with a cost i.e. register offsets aka SM-dependent
details leaking through the higher level IR. I don't think that should
automatically make the current solution null and void though.
I'll also note that we could potentially support two different ways to
do "derefs", the current one and something similar to the old way (or
one of the replacements mentioned later). Probably not worth the
complexity but it is a possibility.
> - [1] and the later patch that replaced it were mostly motivated by RA.
> We will probably end up doing RA after SMxIR translation, but we may
> very likely do RA *before* it as well (tracking e.g. SMx instructions
> with register numbers instead of having def-use chains.)
Yes. We should at the very least keep the door open to that.
> A more salient
> concern is that I still don't like the idea of having instructions in
> the tree that aren't actually translated (or translatable) to SMxIR,
> which means that we shouldn't have instructions that yield e.g. structs.
It seems like a fair design choice.
>
> The ugliness that we've run into is: how do we emit IR for the following
> variable load?
>
> struct apple
> {
> int a;
> struct
> {
> Texture2D b;
> int c;
> } s;
> } a;
>
> /* in some expression */
> func(a.s);
>
> Unlike the SM1 example above, the register numbers don't match up.
> Separately, it's kind of ugly that backend-specific details regarding
> register size and alignment are leaking into the frontend so much.
I think most of that can be hidden or contained with some proper
abstraction. And generous handwaving.
But basically, that probably could be represented in the IR as copying
around individual fields of the structure separately, rather than a
single "struct deref". Clearly it can become more complex depending on
the type of the variable but I think it should be doable.
> Similarly, the amount of code that has to deal with matrix majority is
> unfortunate.
That personally seems more annoying. Although it's not clear to me
that handling matrix majority at a later stage is necessarily any
better.
> The former problem can potentially be solved by embedding multiple
> register offsets into hlsl_deref (one per register type). Neither this
> nor the latter problem are prohibitive, and I was at one point in favour
> of continuing to use register offsets everywhere, but at this point my
> feeling has changed, and I think using register offsets is looking more
> ugly than the alternatives. I get the impression that Francisco
> disagrees, though, which is why we should probably hash this out now.
As I mention below, I currently see two options as the most appealing.
This one (multiple register offsets) sits somewhat in the middle and
it feels like it would be best to go to one of the extremes instead.
It's also possible that this middle ground solution would end up being
nicer in practice. At any rate, I certainly wouldn't flat out discount
it.
> Nor do I think we should use both register offsets and component offsets
> (either in the same node type, or in different node types). That just
> makes the IR way more complicated. Rather, I think we should be doing
> everything in *just* component offsets until translation from HLSL IR to
> SMx IR.
I touched on this earlier and I agree that the additional complexity
is unlikely to be worth it. Admittedly we're in a limbo right now
where SMxIR isn't quite there yet, which makes reasoning on some of
these details a bit fuzzy.
> In order to deal with the problem of translating dynamic offsets from
> components to registers, I see three options:
>
> (a) emit code at runtime, or do some sophisticated lowering,
>
> (b) use special offsetof and sizeof nodes,
>
> (c) introduce a structured deref type, much like [1]. Francisco was
> actually proposing something like this, although with an array instead
> of a recursive structure, which strikes me as an improvement.
>
> My guess is that (a) is very hard. I haven't really tried to reason it
> out, though.
>
> Given a choice between (b) and (c), I'm more inclined to pick (c). It
> makes the IR structure more restrictive, and those restrictions
> fundamentally match the structured nature of the language we're working
> with, both things I tend to like.
After giving it some thought I think that's certainly fine *for the
higher level IR*. At the same time it seems to me that, if we go that
route, eventually we also want to have real SMxIR with register
offsets, and make sure that we can optimize constant offsets (thus
expressions) at that level.
As I see it (as of current time and date, can't guarantee that I won't
change my mind again...) we either push the backend-specific info up
(register offsets all the way) or down (component offsets with
structured deref / type info in the generic IR, transformation into
register offsets in the SMxIR). I think either option works and it's
mostly a matter of preference and which one fits / feels better with
the rest of the compiler.
> Note that either way we're going to need specialized functions to
> resolve deref offsets in one step. I also think that should depend on
> the domain—e.g. for copy-prop we'll actually want to do everything in
> component counts, but when translating to SMxIR we'll evaluate given the
> register alignment constraints of the shader model. In the case of (b)
> it's not going to be as simple as running the existing constant folding
> pass, because we can't actually fold the sizeof/offsetof constants
> (unless we dup the node list, evaluate, and then fold, which seems very
> hairy and more work than the alternative).
Right, each option will have different tradeoffs WRT optimization
passes. But e.g. copy-prop should be doable even with register
offsets, we "just" need to make sure to always map the component
offsets to their respective register offsets.
> I invite thoughts—especially from Matteo, since we discussed this sort
> of problem ages ago.
Yep, hope that my comments make sense. I want to hear from the others too.
>
> ἔρρωσθε,
> Zeb
>
>
> [1] https://www.winehq.org/pipermail/wine-devel/2020-April/164399.html
>
> [2] https://www.winehq.org/pipermail/wine-devel/2020-April/165493.html
>
June 9, 2022
Re: [PATCH 0/1] MR213: nls: Add some of the missing codepage files.
by Nikolay Sivov (@nsivov)
Most likely not, it was posted here https://bugs.winehq.org/show_bug.cgi?id=39298 . If we're not going for complete set just because we have data for it, please close this.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/213#note_1746
June 9, 2022
Re: [PATCH 7/7] d3d11: Create dxgi resource objects for buffers.
by Marvin
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=116530
Your paranoid android.
=== w1064_tsign (32 bit report) ===
d3d11:
d3d11.c:5908: Test failed: Got unexpected query result 0x0000000000000000.
June 9, 2022