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 2018
- 68 participants
- 1149 messages
Re: [PATCH] ole32/tests: Store GUIDs by reference.
by Huw Davies
On Tue, Jun 05, 2018 at 01:56:53PM +0200, Thomas Faber wrote:
> Fixes MSVC build.
>
> Signed-off-by: Thomas Faber <thomas.faber(a)reactos.org>
> ---
> This is an alternative to "ole32/tests: Fix MSVC build.", suggested by Dmitry.
Yes, much better. Thanks Dmitry!
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
June 5, 2018
[PATCH] ole32/tests: Store GUIDs by reference.
by Thomas Faber
Fixes MSVC build.
Signed-off-by: Thomas Faber <thomas.faber(a)reactos.org>
---
This is an alternative to "ole32/tests: Fix MSVC build.", suggested by Dmitry.
dlls/ole32/tests/marshal.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 42049032196..39867394fb5 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -560,12 +560,12 @@ static IPSFactoryBuffer PSFactoryBuffer = { &PSFactoryBufferVtbl };
struct host_object_data
{
IStream *stream;
- IID iid;
+ const IID *iid;
IUnknown *object;
MSHLFLAGS marshal_flags;
IMessageFilter *filter;
IUnknown *register_object;
- CLSID register_clsid;
+ const CLSID *register_clsid;
HANDLE marshal_event;
};
@@ -581,7 +581,7 @@ static DWORD CALLBACK host_object_proc(LPVOID p)
pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
if(data->register_object) {
- hr = CoRegisterClassObject(&data->register_clsid, data->register_object,
+ hr = CoRegisterClassObject(data->register_clsid, data->register_object,
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®istration_key);
ok(hr == S_OK, "CoRegisterClassObject failed: %08x\n", hr);
}
@@ -594,7 +594,7 @@ static DWORD CALLBACK host_object_proc(LPVOID p)
ok_ole_success(hr, CoRegisterMessageFilter);
}
- hr = CoMarshalInterface(data->stream, &data->iid, data->object, MSHCTX_INPROC, NULL, data->marshal_flags);
+ hr = CoMarshalInterface(data->stream, data->iid, data->object, MSHCTX_INPROC, NULL, data->marshal_flags);
ok_ole_success(hr, CoMarshalInterface);
/* force the message queue to be created before signaling parent thread */
@@ -639,7 +639,7 @@ static DWORD start_host_object2(struct host_object_data *object_data, HANDLE *th
static DWORD start_host_object(IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, HANDLE *thread)
{
- struct host_object_data object_data = { stream, *riid, object, marshal_flags };
+ struct host_object_data object_data = { stream, riid, object, marshal_flags };
return start_host_object2(&object_data, thread);
}
@@ -1254,9 +1254,9 @@ static void test_marshal_channel_buffer(void)
HANDLE thread;
HRESULT hr;
- struct host_object_data object_data = { NULL, IID_IOleClientSite, (IUnknown*)&Test_OleClientSite,
+ struct host_object_data object_data = { NULL, &IID_IOleClientSite, (IUnknown*)&Test_OleClientSite,
MSHLFLAGS_NORMAL, NULL, (IUnknown*)&PSFactoryBuffer,
- CLSID_WineTestPSFactoryBuffer };
+ &CLSID_WineTestPSFactoryBuffer };
cLocks = 0;
external_connections = 0;
@@ -2321,7 +2321,7 @@ static void test_message_filter(void)
IMessageFilter *prev_filter = NULL;
HANDLE thread;
- struct host_object_data object_data = { NULL, IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
+ struct host_object_data object_data = { NULL, &IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
MSHLFLAGS_NORMAL, &MessageFilter };
cLocks = 0;
@@ -4213,7 +4213,7 @@ static void test_channel_hook(void)
HANDLE thread;
HRESULT hr;
- struct host_object_data object_data = { NULL, IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
+ struct host_object_data object_data = { NULL, &IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
MSHLFLAGS_NORMAL, &MessageFilter };
hr = CoRegisterChannelHook(&EXTENTID_WineTest, &TestChannelHook);
--
2.16.1.windows.2
June 5, 2018
[PATCH vkd3d 4/4] demos: Get rid of code for compiling shaders using d3dcompiler.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
It's unused.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
demos/demo_win32.h | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/demos/demo_win32.h b/demos/demo_win32.h
index 3b61bcf8eeae..d2a54989e9a7 100644
--- a/demos/demo_win32.h
+++ b/demos/demo_win32.h
@@ -25,10 +25,6 @@
struct demo
{
- HMODULE d3dcompiler;
- HRESULT (WINAPI *compile_from_file)(const WCHAR *filename, const void *defines, void *include,
- const char *entry_point, const char *profile, UINT flags1, UINT flags2,
- ID3DBlob **code, ID3DBlob **errors);
size_t window_count;
bool quit;
@@ -198,11 +194,6 @@ static inline bool demo_init(struct demo *demo, void *user_data)
{
WNDCLASSEXW wc;
- if (!(demo->d3dcompiler = LoadLibraryW(L"d3dcompiler_47")))
- return false;
- if (!(demo->compile_from_file = (void *)GetProcAddress(demo->d3dcompiler, "D3DCompileFromFile")))
- goto fail;
-
wc.cbSize = sizeof(wc);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = demo_window_proc;
@@ -216,7 +207,7 @@ static inline bool demo_init(struct demo *demo, void *user_data)
wc.lpszClassName = DEMO_WINDOW_CLASS_NAME;
wc.hIconSm = LoadIconW(NULL, IDI_WINLOGO);
if (!RegisterClassExW(&wc))
- goto fail;
+ return false;
demo->window_count = 0;
demo->quit = false;
@@ -224,16 +215,11 @@ static inline bool demo_init(struct demo *demo, void *user_data)
demo->idle_func = NULL;
return true;
-
-fail:
- FreeLibrary(demo->d3dcompiler);
- return false;
}
static inline void demo_cleanup(struct demo *demo)
{
UnregisterClassW(DEMO_WINDOW_CLASS_NAME, GetModuleHandle(NULL));
- FreeLibrary(demo->d3dcompiler);
}
static inline void demo_set_idle_func(struct demo *demo,
--
2.16.4
June 5, 2018
[PATCH vkd3d 3/4] libs/vkd3d-shader: Factor out shader_dump_instruction().
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d-shader/trace.c | 484 ++++++++++++++++++++++++----------------------
1 file changed, 249 insertions(+), 235 deletions(-)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
index f987e3caa877..420ccea37f94 100644
--- a/libs/vkd3d-shader/trace.c
+++ b/libs/vkd3d-shader/trace.c
@@ -1340,13 +1340,260 @@ static void shader_dump_instruction_flags(struct vkd3d_string_buffer *buffer,
}
}
+static void shader_dump_instruction(struct vkd3d_string_buffer *buffer,
+ const struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_version *shader_version)
+{
+ unsigned int i;
+
+ switch (ins->handler_idx)
+ {
+ case VKD3DSIH_DCL:
+ case VKD3DSIH_DCL_UAV_TYPED:
+ shader_dump_decl_usage(buffer, &ins->declaration.semantic, ins->flags, shader_version);
+ shader_dump_ins_modifiers(buffer, &ins->declaration.semantic.reg);
+ shader_addline(buffer, " ");
+ shader_dump_dst_param(buffer, &ins->declaration.semantic.reg, shader_version);
+ break;
+
+ case VKD3DSIH_DCL_CONSTANT_BUFFER:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_src_param(buffer, &ins->declaration.src, shader_version);
+ shader_addline(buffer, ", %s",
+ ins->flags & VKD3DSI_INDEXED_DYNAMIC ? "dynamicIndexed" : "immediateIndexed");
+ break;
+
+ case VKD3DSIH_DCL_FUNCTION_BODY:
+ shader_addline(buffer, "%s fb%u",
+ shader_opcode_names[ins->handler_idx], ins->declaration.index);
+ break;
+
+ case VKD3DSIH_DCL_FUNCTION_TABLE:
+ shader_addline(buffer, "%s ft%u = {...}",
+ shader_opcode_names[ins->handler_idx], ins->declaration.index);
+ break;
+
+ case VKD3DSIH_DCL_GLOBAL_FLAGS:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_global_flags(buffer, ins->flags);
+ break;
+
+ case VKD3DSIH_DCL_HS_MAX_TESSFACTOR:
+ shader_addline(buffer, "%s %.8e", shader_opcode_names[ins->handler_idx],
+ ins->declaration.max_tessellation_factor);
+ break;
+
+ case VKD3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER:
+ shader_addline(buffer, "%s {\n", shader_opcode_names[ins->handler_idx]);
+ for (i = 0; i < ins->declaration.icb->vec4_count; ++i)
+ {
+ shader_addline(buffer, " {0x%08x, 0x%08x, 0x%08x, 0x%08x},\n",
+ ins->declaration.icb->data[4 * i + 0],
+ ins->declaration.icb->data[4 * i + 1],
+ ins->declaration.icb->data[4 * i + 2],
+ ins->declaration.icb->data[4 * i + 3]);
+ }
+ shader_addline(buffer, "}");
+ break;
+
+ case VKD3DSIH_DCL_INDEX_RANGE:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.index_range.first_register, shader_version);
+ shader_addline(buffer, " %u", ins->declaration.index_range.last_register);
+ break;
+
+ case VKD3DSIH_DCL_INDEXABLE_TEMP:
+ shader_addline(buffer, "%s x[%u][%u], %u", shader_opcode_names[ins->handler_idx],
+ ins->declaration.indexable_temp.register_idx,
+ ins->declaration.indexable_temp.register_size,
+ ins->declaration.indexable_temp.component_count);
+ break;
+
+ case VKD3DSIH_DCL_INPUT_PS:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_interpolation_mode(buffer, ins->flags);
+ shader_addline(buffer, " ");
+ shader_dump_dst_param(buffer, &ins->declaration.dst, shader_version);
+ break;
+
+ case VKD3DSIH_DCL_INPUT_PS_SGV:
+ case VKD3DSIH_DCL_INPUT_SGV:
+ case VKD3DSIH_DCL_INPUT_SIV:
+ case VKD3DSIH_DCL_OUTPUT_SIV:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.register_semantic.reg, shader_version);
+ shader_addline(buffer, ", ");
+ shader_dump_shader_input_sysval_semantic(buffer, ins->declaration.register_semantic.sysval_semantic);
+ break;
+
+ case VKD3DSIH_DCL_INPUT_PS_SIV:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_interpolation_mode(buffer, ins->flags);
+ shader_addline(buffer, " ");
+ shader_dump_dst_param(buffer, &ins->declaration.register_semantic.reg, shader_version);
+ shader_addline(buffer, ", ");
+ shader_dump_shader_input_sysval_semantic(buffer, ins->declaration.register_semantic.sysval_semantic);
+ break;
+
+ case VKD3DSIH_DCL_INPUT:
+ case VKD3DSIH_DCL_OUTPUT:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.dst, shader_version);
+ break;
+
+ case VKD3DSIH_DCL_INPUT_PRIMITIVE:
+ case VKD3DSIH_DCL_OUTPUT_TOPOLOGY:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_primitive_type(buffer, &ins->declaration.primitive_type);
+ break;
+
+ case VKD3DSIH_DCL_INTERFACE:
+ shader_addline(buffer, "%s fp[%u][%u][%u] = {...}",
+ shader_opcode_names[ins->handler_idx], ins->declaration.fp.index,
+ ins->declaration.fp.array_size, ins->declaration.fp.body_count);
+ break;
+
+ case VKD3DSIH_DCL_RESOURCE_RAW:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.dst, shader_version);
+ break;
+
+ case VKD3DSIH_DCL_RESOURCE_STRUCTURED:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.structured_resource.reg, shader_version);
+ shader_addline(buffer, ", %u", ins->declaration.structured_resource.byte_stride);
+ break;
+
+ case VKD3DSIH_DCL_SAMPLER:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.dst, shader_version);
+ if (ins->flags == VKD3DSI_SAMPLER_COMPARISON_MODE)
+ shader_addline(buffer, ", comparisonMode");
+ break;
+
+ case VKD3DSIH_DCL_TEMPS:
+ case VKD3DSIH_DCL_GS_INSTANCES:
+ case VKD3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT:
+ case VKD3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT:
+ case VKD3DSIH_DCL_INPUT_CONTROL_POINT_COUNT:
+ case VKD3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT:
+ case VKD3DSIH_DCL_VERTICES_OUT:
+ shader_addline(buffer, "%s %u", shader_opcode_names[ins->handler_idx], ins->declaration.count);
+ break;
+
+ case VKD3DSIH_DCL_TESSELLATOR_DOMAIN:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_tessellator_domain(buffer, ins->declaration.tessellator_domain);
+ break;
+
+ case VKD3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_tessellator_output_primitive(buffer, ins->declaration.tessellator_output_primitive);
+ break;
+
+ case VKD3DSIH_DCL_TESSELLATOR_PARTITIONING:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_tessellator_partitioning(buffer, ins->declaration.tessellator_partitioning);
+ break;
+
+ case VKD3DSIH_DCL_TGSM_RAW:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.tgsm_raw.reg, shader_version);
+ shader_addline(buffer, ", %u", ins->declaration.tgsm_raw.byte_count);
+ break;
+
+ case VKD3DSIH_DCL_TGSM_STRUCTURED:
+ shader_addline(buffer, "%s ", shader_opcode_names[ins->handler_idx]);
+ shader_dump_dst_param(buffer, &ins->declaration.tgsm_structured.reg, shader_version);
+ shader_addline(buffer, ", %u, %u", ins->declaration.tgsm_structured.byte_stride,
+ ins->declaration.tgsm_structured.structure_count);
+ break;
+
+ case VKD3DSIH_DCL_THREAD_GROUP:
+ shader_addline(buffer, "%s %u, %u, %u", shader_opcode_names[ins->handler_idx],
+ ins->declaration.thread_group_size.x,
+ ins->declaration.thread_group_size.y,
+ ins->declaration.thread_group_size.z);
+ break;
+
+ case VKD3DSIH_DCL_UAV_RAW:
+ shader_addline(buffer, "%s", shader_opcode_names[ins->handler_idx]);
+ shader_dump_uav_flags(buffer, ins->flags);
+ shader_addline(buffer, " ");
+ shader_dump_dst_param(buffer, &ins->declaration.dst, shader_version);
+ break;
+
+ case VKD3DSIH_DCL_UAV_STRUCTURED:
+ shader_addline(buffer, "%s", shader_opcode_names[ins->handler_idx]);
+ shader_dump_uav_flags(buffer, ins->flags);
+ shader_addline(buffer, " ");
+ shader_dump_dst_param(buffer, &ins->declaration.structured_resource.reg, shader_version);
+ shader_addline(buffer, ", %u", ins->declaration.structured_resource.byte_stride);
+ break;
+
+ case VKD3DSIH_DEF:
+ shader_addline(buffer, "def c%u = %.8e, %.8e, %.8e, %.8e",
+ shader_get_float_offset(ins->dst[0].reg.type, ins->dst[0].reg.idx[0].offset),
+ ins->src[0].reg.u.immconst_float[0], ins->src[0].reg.u.immconst_float[1],
+ ins->src[0].reg.u.immconst_float[2], ins->src[0].reg.u.immconst_float[3]);
+ break;
+
+ case VKD3DSIH_DEFI:
+ shader_addline(buffer, "defi i%u = %d, %d, %d, %d", ins->dst[0].reg.idx[0].offset,
+ ins->src[0].reg.u.immconst_uint[0], ins->src[0].reg.u.immconst_uint[1],
+ ins->src[0].reg.u.immconst_uint[2], ins->src[0].reg.u.immconst_uint[3]);
+ break;
+
+ case VKD3DSIH_DEFB:
+ shader_addline(buffer, "defb b%u = %s",
+ ins->dst[0].reg.idx[0].offset, ins->src[0].reg.u.immconst_uint[0] ? "true" : "false");
+ break;
+
+ default:
+ if (ins->predicate)
+ {
+ shader_addline(buffer, "(");
+ shader_dump_src_param(buffer, ins->predicate, shader_version);
+ shader_addline(buffer, ") ");
+ }
+
+ /* PixWin marks instructions with the coissue flag with a '+' */
+ if (ins->coissue)
+ shader_addline(buffer, "+");
+
+ shader_addline(buffer, "%s", shader_opcode_names[ins->handler_idx]);
+
+ shader_dump_instruction_flags(buffer, ins, shader_version);
+ if (vkd3d_shader_instruction_has_texel_offset(ins))
+ {
+ shader_addline(buffer, "(%d,%d,%d)",
+ ins->texel_offset.u, ins->texel_offset.v, ins->texel_offset.w);
+ }
+
+ for (i = 0; i < ins->dst_count; ++i)
+ {
+ shader_dump_ins_modifiers(buffer, &ins->dst[i]);
+ shader_addline(buffer, !i ? " " : ", ");
+ shader_dump_dst_param(buffer, &ins->dst[i], shader_version);
+ }
+
+ /* Other source tokens */
+ for (i = ins->dst_count; i < (ins->dst_count + ins->src_count); ++i)
+ {
+ shader_addline(buffer, !i ? " " : ", ");
+ shader_dump_src_param(buffer, &ins->src[i - ins->dst_count], shader_version);
+ }
+ break;
+ }
+
+ shader_addline(buffer, "\n");
+}
+
void vkd3d_shader_trace(void *data)
{
struct vkd3d_shader_version shader_version;
struct vkd3d_string_buffer buffer;
const char *p, *q;
const DWORD *ptr;
- DWORD i;
if (!string_buffer_init(&buffer))
{
@@ -1369,240 +1616,7 @@ void vkd3d_shader_trace(void *data)
continue;
}
- if (ins.handler_idx == VKD3DSIH_DCL || ins.handler_idx == VKD3DSIH_DCL_UAV_TYPED)
- {
- shader_dump_decl_usage(&buffer, &ins.declaration.semantic, ins.flags, &shader_version);
- shader_dump_ins_modifiers(&buffer, &ins.declaration.semantic.reg);
- shader_addline(&buffer, " ");
- shader_dump_dst_param(&buffer, &ins.declaration.semantic.reg, &shader_version);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_CONSTANT_BUFFER)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_src_param(&buffer, &ins.declaration.src, &shader_version);
- shader_addline(&buffer, ", %s",
- ins.flags & VKD3DSI_INDEXED_DYNAMIC ? "dynamicIndexed" : "immediateIndexed");
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_FUNCTION_BODY)
- {
- shader_addline(&buffer, "%s fb%u",
- shader_opcode_names[ins.handler_idx], ins.declaration.index);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_FUNCTION_TABLE)
- {
- shader_addline(&buffer, "%s ft%u = {...}",
- shader_opcode_names[ins.handler_idx], ins.declaration.index);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_GLOBAL_FLAGS)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_global_flags(&buffer, ins.flags);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_HS_MAX_TESSFACTOR)
- {
- shader_addline(&buffer, "%s %.8e", shader_opcode_names[ins.handler_idx],
- ins.declaration.max_tessellation_factor);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER)
- {
- shader_addline(&buffer, "%s {\n", shader_opcode_names[ins.handler_idx]);
- for (i = 0; i < ins.declaration.icb->vec4_count; ++i)
- {
- shader_addline(&buffer, " {0x%08x, 0x%08x, 0x%08x, 0x%08x},\n",
- ins.declaration.icb->data[4 * i + 0],
- ins.declaration.icb->data[4 * i + 1],
- ins.declaration.icb->data[4 * i + 2],
- ins.declaration.icb->data[4 * i + 3]);
- }
- shader_addline(&buffer, "}");
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INDEX_RANGE)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.index_range.first_register, &shader_version);
- shader_addline(&buffer, " %u", ins.declaration.index_range.last_register);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INDEXABLE_TEMP)
- {
- shader_addline(&buffer, "%s x[%u][%u], %u", shader_opcode_names[ins.handler_idx],
- ins.declaration.indexable_temp.register_idx,
- ins.declaration.indexable_temp.register_size,
- ins.declaration.indexable_temp.component_count);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INPUT_PS)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_interpolation_mode(&buffer, ins.flags);
- shader_addline(&buffer, " ");
- shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INPUT_PS_SGV
- || ins.handler_idx == VKD3DSIH_DCL_INPUT_SGV
- || ins.handler_idx == VKD3DSIH_DCL_INPUT_SIV
- || ins.handler_idx == VKD3DSIH_DCL_OUTPUT_SIV)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.register_semantic.reg, &shader_version);
- shader_addline(&buffer, ", ");
- shader_dump_shader_input_sysval_semantic(&buffer, ins.declaration.register_semantic.sysval_semantic);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INPUT_PS_SIV)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_interpolation_mode(&buffer, ins.flags);
- shader_addline(&buffer, " ");
- shader_dump_dst_param(&buffer, &ins.declaration.register_semantic.reg, &shader_version);
- shader_addline(&buffer, ", ");
- shader_dump_shader_input_sysval_semantic(&buffer, ins.declaration.register_semantic.sysval_semantic);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INPUT
- || ins.handler_idx == VKD3DSIH_DCL_OUTPUT)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INPUT_PRIMITIVE
- || ins.handler_idx == VKD3DSIH_DCL_OUTPUT_TOPOLOGY)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_primitive_type(&buffer, &ins.declaration.primitive_type);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_INTERFACE)
- {
- shader_addline(&buffer, "%s fp[%u][%u][%u] = {...}",
- shader_opcode_names[ins.handler_idx], ins.declaration.fp.index,
- ins.declaration.fp.array_size, ins.declaration.fp.body_count);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_RESOURCE_RAW)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_RESOURCE_STRUCTURED)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.structured_resource.reg, &shader_version);
- shader_addline(&buffer, ", %u", ins.declaration.structured_resource.byte_stride);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_SAMPLER)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
- if (ins.flags == VKD3DSI_SAMPLER_COMPARISON_MODE)
- shader_addline(&buffer, ", comparisonMode");
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_TEMPS
- || ins.handler_idx == VKD3DSIH_DCL_GS_INSTANCES
- || ins.handler_idx == VKD3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT
- || ins.handler_idx == VKD3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT
- || ins.handler_idx == VKD3DSIH_DCL_INPUT_CONTROL_POINT_COUNT
- || ins.handler_idx == VKD3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT
- || ins.handler_idx == VKD3DSIH_DCL_VERTICES_OUT)
- {
- shader_addline(&buffer, "%s %u", shader_opcode_names[ins.handler_idx], ins.declaration.count);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_TESSELLATOR_DOMAIN)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_tessellator_domain(&buffer, ins.declaration.tessellator_domain);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_tessellator_output_primitive(&buffer, ins.declaration.tessellator_output_primitive);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_TESSELLATOR_PARTITIONING)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_tessellator_partitioning(&buffer, ins.declaration.tessellator_partitioning);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_TGSM_RAW)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.tgsm_raw.reg, &shader_version);
- shader_addline(&buffer, ", %u", ins.declaration.tgsm_raw.byte_count);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_TGSM_STRUCTURED)
- {
- shader_addline(&buffer, "%s ", shader_opcode_names[ins.handler_idx]);
- shader_dump_dst_param(&buffer, &ins.declaration.tgsm_structured.reg, &shader_version);
- shader_addline(&buffer, ", %u, %u", ins.declaration.tgsm_structured.byte_stride,
- ins.declaration.tgsm_structured.structure_count);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_THREAD_GROUP)
- {
- shader_addline(&buffer, "%s %u, %u, %u", shader_opcode_names[ins.handler_idx],
- ins.declaration.thread_group_size.x,
- ins.declaration.thread_group_size.y,
- ins.declaration.thread_group_size.z);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_UAV_RAW)
- {
- shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]);
- shader_dump_uav_flags(&buffer, ins.flags);
- shader_addline(&buffer, " ");
- shader_dump_dst_param(&buffer, &ins.declaration.dst, &shader_version);
- }
- else if (ins.handler_idx == VKD3DSIH_DCL_UAV_STRUCTURED)
- {
- shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]);
- shader_dump_uav_flags(&buffer, ins.flags);
- shader_addline(&buffer, " ");
- shader_dump_dst_param(&buffer, &ins.declaration.structured_resource.reg, &shader_version);
- shader_addline(&buffer, ", %u", ins.declaration.structured_resource.byte_stride);
- }
- else if (ins.handler_idx == VKD3DSIH_DEF)
- {
- shader_addline(&buffer, "def c%u = %.8e, %.8e, %.8e, %.8e",
- shader_get_float_offset(ins.dst[0].reg.type, ins.dst[0].reg.idx[0].offset),
- ins.src[0].reg.u.immconst_float[0], ins.src[0].reg.u.immconst_float[1],
- ins.src[0].reg.u.immconst_float[2], ins.src[0].reg.u.immconst_float[3]);
- }
- else if (ins.handler_idx == VKD3DSIH_DEFI)
- {
- shader_addline(&buffer, "defi i%u = %d, %d, %d, %d", ins.dst[0].reg.idx[0].offset,
- ins.src[0].reg.u.immconst_uint[0], ins.src[0].reg.u.immconst_uint[1],
- ins.src[0].reg.u.immconst_uint[2], ins.src[0].reg.u.immconst_uint[3]);
- }
- else if (ins.handler_idx == VKD3DSIH_DEFB)
- {
- shader_addline(&buffer, "defb b%u = %s",
- ins.dst[0].reg.idx[0].offset, ins.src[0].reg.u.immconst_uint[0] ? "true" : "false");
- }
- else
- {
- if (ins.predicate)
- {
- shader_addline(&buffer, "(");
- shader_dump_src_param(&buffer, ins.predicate, &shader_version);
- shader_addline(&buffer, ") ");
- }
-
- /* PixWin marks instructions with the coissue flag with a '+' */
- if (ins.coissue)
- shader_addline(&buffer, "+");
-
- shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]);
-
- shader_dump_instruction_flags(&buffer, &ins, &shader_version);
- if (vkd3d_shader_instruction_has_texel_offset(&ins))
- shader_addline(&buffer, "(%d,%d,%d)", ins.texel_offset.u, ins.texel_offset.v, ins.texel_offset.w);
-
- for (i = 0; i < ins.dst_count; ++i)
- {
- shader_dump_ins_modifiers(&buffer, &ins.dst[i]);
- shader_addline(&buffer, !i ? " " : ", ");
- shader_dump_dst_param(&buffer, &ins.dst[i], &shader_version);
- }
-
- /* Other source tokens */
- for (i = ins.dst_count; i < (ins.dst_count + ins.src_count); ++i)
- {
- shader_addline(&buffer, !i ? " " : ", ");
- shader_dump_src_param(&buffer, &ins.src[i - ins.dst_count], &shader_version);
- }
- }
- shader_addline(&buffer, "\n");
+ shader_dump_instruction(&buffer, &ins, &shader_version);
}
for (p = buffer.buffer; *p; p = q)
--
2.16.4
June 5, 2018
[PATCH vkd3d 2/4] libs/vkd3d-shader: Factor out shader_dump_instruction_flags().
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d-shader/trace.c | 126 ++++++++++++++++---------------
libs/vkd3d-shader/vkd3d_shader_private.h | 12 +--
2 files changed, 73 insertions(+), 65 deletions(-)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
index ce8db46b6f21..f987e3caa877 100644
--- a/libs/vkd3d-shader/trace.c
+++ b/libs/vkd3d-shader/trace.c
@@ -1274,6 +1274,72 @@ static void shader_dump_version(struct vkd3d_string_buffer *buffer,
shader_addline(buffer, "%s_%u_%u\n", prefix, shader_version->major, shader_version->minor);
}
+static void shader_dump_instruction_flags(struct vkd3d_string_buffer *buffer,
+ const struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_version *shader_version)
+{
+ switch (ins->handler_idx)
+ {
+ case VKD3DSIH_BREAKP:
+ case VKD3DSIH_CONTINUEP:
+ case VKD3DSIH_IF:
+ case VKD3DSIH_RETP:
+ case VKD3DSIH_TEXKILL:
+ switch (ins->flags)
+ {
+ case VKD3D_SHADER_CONDITIONAL_OP_NZ: shader_addline(buffer, "_nz"); break;
+ case VKD3D_SHADER_CONDITIONAL_OP_Z: shader_addline(buffer, "_z"); break;
+ default: shader_addline(buffer, "_unrecognized(%#x)", ins->flags); break;
+ }
+ break;
+
+ case VKD3DSIH_IFC:
+ case VKD3DSIH_BREAKC:
+ switch (ins->flags)
+ {
+ case VKD3D_SHADER_REL_OP_GT: shader_addline(buffer, "_gt"); break;
+ case VKD3D_SHADER_REL_OP_EQ: shader_addline(buffer, "_eq"); break;
+ case VKD3D_SHADER_REL_OP_GE: shader_addline(buffer, "_ge"); break;
+ case VKD3D_SHADER_REL_OP_LT: shader_addline(buffer, "_lt"); break;
+ case VKD3D_SHADER_REL_OP_NE: shader_addline(buffer, "_ne"); break;
+ case VKD3D_SHADER_REL_OP_LE: shader_addline(buffer, "_le"); break;
+ default: shader_addline(buffer, "_(%u)", ins->flags);
+ }
+ break;
+
+ case VKD3DSIH_RESINFO:
+ switch (ins->flags)
+ {
+ case VKD3DSI_NONE: break;
+ case VKD3DSI_RESINFO_RCP_FLOAT: shader_addline(buffer, "_rcpFloat"); break;
+ case VKD3DSI_RESINFO_UINT: shader_addline(buffer, "_uint"); break;
+ default: shader_addline(buffer, "_unrecognized(%#x)", ins->flags);
+ }
+ break;
+
+ case VKD3DSIH_SAMPLE_INFO:
+ switch (ins->flags)
+ {
+ case VKD3DSI_NONE: break;
+ case VKD3DSI_SAMPLE_INFO_UINT: shader_addline(buffer, "_uint"); break;
+ default: shader_addline(buffer, "_unrecognized(%#x)", ins->flags);
+ }
+ break;
+
+ case VKD3DSIH_SYNC:
+ shader_dump_sync_flags(buffer, ins->flags);
+ break;
+
+ case VKD3DSIH_TEX:
+ if (shader_version->major >= 2 && (ins->flags & VKD3DSI_TEXLD_PROJECT))
+ shader_addline(buffer, "p");
+ break;
+
+ default:
+ shader_dump_precise_flags(buffer, ins->flags);
+ break;
+ }
+}
+
void vkd3d_shader_trace(void *data)
{
struct vkd3d_shader_version shader_version;
@@ -1518,65 +1584,7 @@ void vkd3d_shader_trace(void *data)
shader_addline(&buffer, "%s", shader_opcode_names[ins.handler_idx]);
- if (ins.handler_idx == VKD3DSIH_BREAKP
- || ins.handler_idx == VKD3DSIH_CONTINUEP
- || ins.handler_idx == VKD3DSIH_IF
- || ins.handler_idx == VKD3DSIH_RETP
- || ins.handler_idx == VKD3DSIH_TEXKILL)
- {
- switch (ins.flags)
- {
- case VKD3D_SHADER_CONDITIONAL_OP_NZ: shader_addline(&buffer, "_nz"); break;
- case VKD3D_SHADER_CONDITIONAL_OP_Z: shader_addline(&buffer, "_z"); break;
- default: shader_addline(&buffer, "_unrecognized(%#x)", ins.flags); break;
- }
- }
- else if (ins.handler_idx == VKD3DSIH_IFC
- || ins.handler_idx == VKD3DSIH_BREAKC)
- {
- switch (ins.flags)
- {
- case VKD3D_SHADER_REL_OP_GT: shader_addline(&buffer, "_gt"); break;
- case VKD3D_SHADER_REL_OP_EQ: shader_addline(&buffer, "_eq"); break;
- case VKD3D_SHADER_REL_OP_GE: shader_addline(&buffer, "_ge"); break;
- case VKD3D_SHADER_REL_OP_LT: shader_addline(&buffer, "_lt"); break;
- case VKD3D_SHADER_REL_OP_NE: shader_addline(&buffer, "_ne"); break;
- case VKD3D_SHADER_REL_OP_LE: shader_addline(&buffer, "_le"); break;
- default: shader_addline(&buffer, "_(%u)", ins.flags);
- }
- }
- else if (ins.handler_idx == VKD3DSIH_TEX
- && shader_version.major >= 2
- && (ins.flags & VKD3DSI_TEXLD_PROJECT))
- {
- shader_addline(&buffer, "p");
- }
- else if (ins.handler_idx == VKD3DSIH_RESINFO && ins.flags)
- {
- switch (ins.flags)
- {
- case VKD3DSI_RESINFO_RCP_FLOAT: shader_addline(&buffer, "_rcpFloat"); break;
- case VKD3DSI_RESINFO_UINT: shader_addline(&buffer, "_uint"); break;
- default: shader_addline(&buffer, "_unrecognized(%#x)", ins.flags);
- }
- }
- else if (ins.handler_idx == VKD3DSIH_SAMPLE_INFO && ins.flags)
- {
- switch (ins.flags)
- {
- case VKD3DSI_SAMPLE_INFO_UINT: shader_addline(&buffer, "_uint"); break;
- default: shader_addline(&buffer, "_unrecognized(%#x)", ins.flags);
- }
- }
- else if (ins.handler_idx == VKD3DSIH_SYNC)
- {
- shader_dump_sync_flags(&buffer, ins.flags);
- }
- else
- {
- shader_dump_precise_flags(&buffer, ins.flags);
- }
-
+ shader_dump_instruction_flags(&buffer, &ins, &shader_version);
if (vkd3d_shader_instruction_has_texel_offset(&ins))
shader_addline(&buffer, "(%d,%d,%d)", ins.texel_offset.u, ins.texel_offset.v, ins.texel_offset.w);
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index 8ed700be3756..7fc42627f820 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -480,12 +480,12 @@ enum vkd3d_tessellator_partitioning
};
-#define VKD3DSI_TEXLD_PROJECT 0x1
-
-#define VKD3DSI_INDEXED_DYNAMIC 0x4
-#define VKD3DSI_RESINFO_RCP_FLOAT 0x1
-#define VKD3DSI_RESINFO_UINT 0x2
-#define VKD3DSI_SAMPLE_INFO_UINT 0x1
+#define VKD3DSI_NONE 0x0
+#define VKD3DSI_TEXLD_PROJECT 0x1
+#define VKD3DSI_INDEXED_DYNAMIC 0x4
+#define VKD3DSI_RESINFO_RCP_FLOAT 0x1
+#define VKD3DSI_RESINFO_UINT 0x2
+#define VKD3DSI_SAMPLE_INFO_UINT 0x1
#define VKD3DSI_SAMPLER_COMPARISON_MODE 0x1
#define VKD3DSI_PRECISE_X 0x100
--
2.16.4
June 5, 2018
[PATCH vkd3d 1/4] libs/vkd3d-shader: Factor out shader_dump_version().
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d-shader/trace.c | 58 +++++++++++++++++++++++++----------------------
1 file changed, 31 insertions(+), 27 deletions(-)
diff --git a/libs/vkd3d-shader/trace.c b/libs/vkd3d-shader/trace.c
index faa009e03a4c..ce8db46b6f21 100644
--- a/libs/vkd3d-shader/trace.c
+++ b/libs/vkd3d-shader/trace.c
@@ -1234,58 +1234,62 @@ static void shader_dump_interpolation_mode(struct vkd3d_string_buffer *buffer,
}
}
-void vkd3d_shader_trace(void *data)
+static void shader_dump_version(struct vkd3d_string_buffer *buffer,
+ const struct vkd3d_shader_version *shader_version)
{
- struct vkd3d_shader_version shader_version;
- struct vkd3d_string_buffer buffer;
- const char *type_prefix;
- const char *p, *q;
- const DWORD *ptr;
- DWORD i;
+ const char *prefix;
- if (!string_buffer_init(&buffer))
- {
- ERR("Failed to initialize string buffer.\n");
- return;
- }
-
- shader_sm4_read_header(data, &ptr, &shader_version);
-
- TRACE("Parsing %p.\n", ptr);
-
- switch (shader_version.type)
+ switch (shader_version->type)
{
case VKD3D_SHADER_TYPE_VERTEX:
- type_prefix = "vs";
+ prefix = "vs";
break;
case VKD3D_SHADER_TYPE_HULL:
- type_prefix = "hs";
+ prefix = "hs";
break;
case VKD3D_SHADER_TYPE_DOMAIN:
- type_prefix = "ds";
+ prefix = "ds";
break;
case VKD3D_SHADER_TYPE_GEOMETRY:
- type_prefix = "gs";
+ prefix = "gs";
break;
case VKD3D_SHADER_TYPE_PIXEL:
- type_prefix = "ps";
+ prefix = "ps";
break;
case VKD3D_SHADER_TYPE_COMPUTE:
- type_prefix = "cs";
+ prefix = "cs";
break;
default:
- FIXME("Unhandled shader type %#x.\n", shader_version.type);
- type_prefix = "unknown";
+ FIXME("Unhandled shader type %#x.\n", shader_version->type);
+ prefix = "unknown";
break;
}
- shader_addline(&buffer, "%s_%u_%u\n", type_prefix, shader_version.major, shader_version.minor);
+ shader_addline(buffer, "%s_%u_%u\n", prefix, shader_version->major, shader_version->minor);
+}
+
+void vkd3d_shader_trace(void *data)
+{
+ struct vkd3d_shader_version shader_version;
+ struct vkd3d_string_buffer buffer;
+ const char *p, *q;
+ const DWORD *ptr;
+ DWORD i;
+
+ if (!string_buffer_init(&buffer))
+ {
+ ERR("Failed to initialize string buffer.\n");
+ return;
+ }
+
+ shader_sm4_read_header(data, &ptr, &shader_version);
+ shader_dump_version(&buffer, &shader_version);
while (!shader_sm4_is_end(data, &ptr))
{
--
2.16.4
June 5, 2018
Re: [PATCH] ole32/tests: Fix MSVC build.
by Thomas Faber
On 2018-06-05 13:28, Dmitry Timoshkov wrote:
> Thomas Faber <thomas.faber(a)reactos.org> wrote:
>
>> - struct host_object_data object_data = { NULL, IID_IOleClientSite, (IUnknown*)&Test_OleClientSite,
>> + struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IOleClientSite), (IUnknown*)&Test_OleClientSite,
>> MSHLFLAGS_NORMAL, NULL, (IUnknown*)&PSFactoryBuffer,
>> - CLSID_WineTestPSFactoryBuffer };
>> + GUID_MEMBERS(CLSID_WineTestPSFactoryBuffer) };
>
> Did you consider pass GUID by reference instead?
I had not. But looking at the code, that indeed makes sense.
I'll send the other version too, so Huw/Alexandre can pick whichever
they prefer.
Thanks!
-Thomas
June 5, 2018
[PATCH v2] ole32/tests: Fix MSVC build.
by Thomas Faber
Signed-off-by: Thomas Faber <thomas.faber(a)reactos.org>
---
v2: Add change in start_host_object that I missed the first time.
dlls/ole32/tests/marshal.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 42049032196..ba4b68a9970 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -60,6 +60,8 @@
expect_ ## func = called_ ## func = FALSE; \
}while(0)
+#define GUID_MEMBERS(g) {(g).Data1, (g).Data2, (g).Data3, {(g).Data4[0], (g).Data4[1], (g).Data4[2], (g).Data4[3], (g).Data4[4], (g).Data4[5], (g).Data4[6], (g).Data4[7]}}
+
DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x00000323,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
@@ -639,7 +641,7 @@ static DWORD start_host_object2(struct host_object_data *object_data, HANDLE *th
static DWORD start_host_object(IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, HANDLE *thread)
{
- struct host_object_data object_data = { stream, *riid, object, marshal_flags };
+ struct host_object_data object_data = { stream, GUID_MEMBERS(*riid), object, marshal_flags };
return start_host_object2(&object_data, thread);
}
@@ -1254,9 +1256,9 @@ static void test_marshal_channel_buffer(void)
HANDLE thread;
HRESULT hr;
- struct host_object_data object_data = { NULL, IID_IOleClientSite, (IUnknown*)&Test_OleClientSite,
+ struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IOleClientSite), (IUnknown*)&Test_OleClientSite,
MSHLFLAGS_NORMAL, NULL, (IUnknown*)&PSFactoryBuffer,
- CLSID_WineTestPSFactoryBuffer };
+ GUID_MEMBERS(CLSID_WineTestPSFactoryBuffer) };
cLocks = 0;
external_connections = 0;
@@ -2321,7 +2323,7 @@ static void test_message_filter(void)
IMessageFilter *prev_filter = NULL;
HANDLE thread;
- struct host_object_data object_data = { NULL, IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
+ struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IClassFactory), (IUnknown*)&Test_ClassFactory,
MSHLFLAGS_NORMAL, &MessageFilter };
cLocks = 0;
@@ -4213,7 +4215,7 @@ static void test_channel_hook(void)
HANDLE thread;
HRESULT hr;
- struct host_object_data object_data = { NULL, IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
+ struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IClassFactory), (IUnknown*)&Test_ClassFactory,
MSHLFLAGS_NORMAL, &MessageFilter };
hr = CoRegisterChannelHook(&EXTENTID_WineTest, &TestChannelHook);
--
2.16.1.windows.2
June 5, 2018
Re: [PATCH 1/5] wined3d: Slightly improve formatting of generated GLSL shader interfaces.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 5, 2018
Re: [PATCH 4/5] wined3d: Compare interpolation mode VS compilation arguments.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 5, 2018
Re: [PATCH 3/5] wined3d: Initialize glMinSampleShading() function pointer.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 5, 2018
Re: [PATCH 2/5] dxgi: Get rid of DXGI_FRAME_LATENCY_DEFAULT.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
June 5, 2018
Re: [PATCH] ole32/tests: Fix MSVC build.
by Dmitry Timoshkov
Thomas Faber <thomas.faber(a)reactos.org> wrote:
> - struct host_object_data object_data = { NULL, IID_IOleClientSite, (IUnknown*)&Test_OleClientSite,
> + struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IOleClientSite), (IUnknown*)&Test_OleClientSite,
> MSHLFLAGS_NORMAL, NULL, (IUnknown*)&PSFactoryBuffer,
> - CLSID_WineTestPSFactoryBuffer };
> + GUID_MEMBERS(CLSID_WineTestPSFactoryBuffer) };
Did you consider pass GUID by reference instead?
--
Dmitry.
June 5, 2018
Re: [PATCH 4/4] winevulkan: Update Vulkan support to 1.0.76.
by Józef Kucia
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
June 5, 2018
Re: [PATCH 2/4] winevulkan: Parse forward declared struct members.
by Józef Kucia
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
June 5, 2018
Re: [PATCH 1/4] winevulkan: Fix parsing of const function pointer members.
by Józef Kucia
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
June 5, 2018
Re: [PATCH 3/4] winevulkan: Parse extension require sections one by one.
by Józef Kucia
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
June 5, 2018
[PATCH] ole32/tests: Fix MSVC build.
by Thomas Faber
Signed-off-by: Thomas Faber <thomas.faber(a)reactos.org>
---
dlls/ole32/tests/marshal.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 42049032196..b989c746c16 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -60,6 +60,8 @@
expect_ ## func = called_ ## func = FALSE; \
}while(0)
+#define GUID_MEMBERS(g) {(g).Data1, (g).Data2, (g).Data3, {(g).Data4[0], (g).Data4[1], (g).Data4[2], (g).Data4[3], (g).Data4[4], (g).Data4[5], (g).Data4[6], (g).Data4[7]}}
+
DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x00000323,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
@@ -1254,9 +1256,9 @@ static void test_marshal_channel_buffer(void)
HANDLE thread;
HRESULT hr;
- struct host_object_data object_data = { NULL, IID_IOleClientSite, (IUnknown*)&Test_OleClientSite,
+ struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IOleClientSite), (IUnknown*)&Test_OleClientSite,
MSHLFLAGS_NORMAL, NULL, (IUnknown*)&PSFactoryBuffer,
- CLSID_WineTestPSFactoryBuffer };
+ GUID_MEMBERS(CLSID_WineTestPSFactoryBuffer) };
cLocks = 0;
external_connections = 0;
@@ -2321,7 +2323,7 @@ static void test_message_filter(void)
IMessageFilter *prev_filter = NULL;
HANDLE thread;
- struct host_object_data object_data = { NULL, IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
+ struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IClassFactory), (IUnknown*)&Test_ClassFactory,
MSHLFLAGS_NORMAL, &MessageFilter };
cLocks = 0;
@@ -4213,7 +4215,7 @@ static void test_channel_hook(void)
HANDLE thread;
HRESULT hr;
- struct host_object_data object_data = { NULL, IID_IClassFactory, (IUnknown*)&Test_ClassFactory,
+ struct host_object_data object_data = { NULL, GUID_MEMBERS(IID_IClassFactory), (IUnknown*)&Test_ClassFactory,
MSHLFLAGS_NORMAL, &MessageFilter };
hr = CoRegisterChannelHook(&EXTENTID_WineTest, &TestChannelHook);
--
2.16.1.windows.2
June 5, 2018
[PATCH] testbot: Make Step::FileName and FileType optional.
by Francois Gouget
Some steps don't have an input filename (like the Reconfig tasks) so
it makes no sense to force setting FileName or FileType to a dummy
value. However enum fields cannot be left undefined so add a 'none'
value.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
Note: This requires updating the database schema and then restarting
the TestBot Engine and website.
testbot/bin/CheckForWinetestUpdate.pl | 3 +--
testbot/ddl/update35.sql | 5 +++++
testbot/ddl/winetestbot.sql | 4 ++--
testbot/lib/WineTestBot/Steps.pm | 11 +++++++++--
testbot/lib/WineTestBot/StepsTasks.pm | 4 +++-
testbot/web/JobDetails.pl | 2 +-
6 files changed, 21 insertions(+), 8 deletions(-)
create mode 100644 testbot/ddl/update35.sql
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index a79f60c71..f41148f12 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -251,8 +251,7 @@ sub AddReconfigJob()
my $Steps = $NewJob->Steps;
my $NewStep = $Steps->Add();
$NewStep->Type("reconfig");
- $NewStep->FileName("-");
- $NewStep->FileType("patchdlls");
+ $NewStep->FileType("none");
$NewStep->InStaging(!1);
# Add a task for the build VM
diff --git a/testbot/ddl/update35.sql b/testbot/ddl/update35.sql
new file mode 100644
index 000000000..3ca3023f3
--- /dev/null
+++ b/testbot/ddl/update35.sql
@@ -0,0 +1,5 @@
+USE winetestbot;
+
+ALTER TABLE Steps
+ MODIFY FileName VARCHAR(100) NULL,
+ MODIFY FileType ENUM('none', 'exe32', 'exe64', 'patchdlls', 'patchprograms') NOT NULL;
diff --git a/testbot/ddl/winetestbot.sql b/testbot/ddl/winetestbot.sql
index 9ec428c04..9a28385a9 100644
--- a/testbot/ddl/winetestbot.sql
+++ b/testbot/ddl/winetestbot.sql
@@ -132,8 +132,8 @@ CREATE TABLE Steps
PreviousNo INT(2) NULL,
Type ENUM('suite', 'single', 'build', 'reconfig') NOT NULL,
Status ENUM('queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped') NOT NULL,
- FileName VARCHAR(100) NOT NULL,
- FileType ENUM('exe32', 'exe64', 'patchdlls', 'patchprograms') NOT NULL,
+ FileName VARCHAR(100) NULL,
+ FileType ENUM('none', 'exe32', 'exe64', 'patchdlls', 'patchprograms') NOT NULL,
InStaging ENUM('Y', 'N') NOT NULL,
DebugLevel INT(2) NOT NULL,
ReportSuccessfulTests ENUM('Y', 'N') NOT NULL,
diff --git a/testbot/lib/WineTestBot/Steps.pm b/testbot/lib/WineTestBot/Steps.pm
index 977419474..aea1aee04 100644
--- a/testbot/lib/WineTestBot/Steps.pm
+++ b/testbot/lib/WineTestBot/Steps.pm
@@ -89,6 +89,7 @@ sub InitializeNew($$)
$self->Status("queued");
$self->Type("single");
+ $self->FileType("none");
$self->InStaging(1);
$self->DebugLevel(1);
$self->ReportSuccessfulTests(!1);
@@ -117,6 +118,10 @@ sub Validate($)
{
return ("PreviousNo", "The previous step number must be less than this one's.");
}
+ if (defined $self->FileName and $self->FileType eq "none")
+ {
+ return ("FileType", "A file has been specified but no FileType");
+ }
return $self->SUPER::Validate();
}
@@ -146,6 +151,8 @@ sub GetFullFileName($)
{
my ($self) = @_;
+ return undef if (!defined $self->FileName);
+
my ($JobId, $StepNo) = @{$self->GetMasterKey()};
# FIXME: Remove legacy support once no such job remains (so after
# $JobPurgeDays).
@@ -256,8 +263,8 @@ my @PropertyDescriptors = (
CreateBasicPropertyDescriptor("PreviousNo", "Previous step", !1, !1, "N", 2),
CreateEnumPropertyDescriptor("Status", "Status", !1, 1, ['queued', 'running', 'completed', 'badpatch', 'badbuild', 'boterror', 'canceled', 'skipped']),
CreateEnumPropertyDescriptor("Type", "Step type", !1, 1, ['suite', 'single', 'build', 'reconfig']),
- CreateBasicPropertyDescriptor("FileName", "File name", !1, 1, "A", 100),
- CreateEnumPropertyDescriptor("FileType", "File type", !1, 1, ['exe32', 'exe64', 'patchdlls', 'patchprograms']),
+ CreateBasicPropertyDescriptor("FileName", "File name", !1, !1, "A", 100),
+ CreateEnumPropertyDescriptor("FileType", "File type", !1, 1, ['none', 'exe32', 'exe64', 'patchdlls', 'patchprograms']),
CreateBasicPropertyDescriptor("InStaging", "File is in staging area", !1, 1, "B", 1),
CreateBasicPropertyDescriptor("DebugLevel", "Debug level (WINETEST_DEBUG)", !1, 1, "N", 2),
CreateBasicPropertyDescriptor("ReportSuccessfulTests", "Report successful tests (WINETEST_REPORT_SUCCESS)", !1, 1, "B", 1),
diff --git a/testbot/lib/WineTestBot/StepsTasks.pm b/testbot/lib/WineTestBot/StepsTasks.pm
index b9f70d768..84c5a005f 100644
--- a/testbot/lib/WineTestBot/StepsTasks.pm
+++ b/testbot/lib/WineTestBot/StepsTasks.pm
@@ -44,6 +44,8 @@ sub GetFullFileName($)
{
my ($self) = @_;
+ return undef if (!defined $self->FileName);
+
my ($JobId, $_StepTaskId) = @{$self->GetMasterKey()};
# FIXME: Remove legacy support once no such job remains (so after
# $JobPurgeDays).
@@ -189,7 +191,7 @@ my @PropertyDescriptors = (
CreateBasicPropertyDescriptor("Status", "Status", !1, 1, "A", 32),
CreateItemrefPropertyDescriptor("VM", "VM", !1, 1, \&CreateVMs, ["VMName"]),
CreateBasicPropertyDescriptor("Timeout", "Timeout", !1, 1, "N", 4),
- CreateBasicPropertyDescriptor("FileName", "File name", !1, 1, "A", 100),
+ CreateBasicPropertyDescriptor("FileName", "File name", !1, !1, "A", 100),
CreateBasicPropertyDescriptor("FileType", "File Type", !1, 1, "A", 32),
CreateBasicPropertyDescriptor("CmdLineArg", "Command line args", !1, !1, "A", 256),
CreateBasicPropertyDescriptor("Started", "Execution started", !1, !1, "DT", 19),
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 6bf4a12e8..3e638f717 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -486,7 +486,7 @@ sub GenerateDataCell($$$$$)
elsif ($PropertyName eq "FileName")
{
my $FileName = $StepTask->GetFullFileName();
- if (-r $FileName)
+ if ($FileName and -r $FileName)
{
my $URI = "/GetFile.pl?JobKey=" . uri_escape($self->{JobId}) .
"&StepKey=" . uri_escape($StepTask->StepNo);
--
2.17.0
June 5, 2018
[PATCH] testbot: Log errors that happen when updating a Job's status.
by Francois Gouget
Such errors are important as they can prevent the Jobs from ever being
marked as completed. So trace them.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
This helps diagnose issues where the database schema and the TestBot's
ORM database model are out of sync.
testbot/lib/WineTestBot/Jobs.pm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/testbot/lib/WineTestBot/Jobs.pm b/testbot/lib/WineTestBot/Jobs.pm
index b1ffd3e48..13a389586 100644
--- a/testbot/lib/WineTestBot/Jobs.pm
+++ b/testbot/lib/WineTestBot/Jobs.pm
@@ -243,7 +243,12 @@ sub UpdateStatus($)
{
$self->Ended(time);
}
- $self->Save();
+ my ($ErrProperty, $ErrMessage) = $self->Save();
+ if (defined $ErrMessage)
+ {
+ require WineTestBot::Log;
+ WineTestBot::Log::LogMsg("Could not update job status: $ErrMessage\n");
+ }
last;
}
}
--
2.17.0
June 5, 2018
[PATCH] testbot: Add proper command line options to CheckForWinetestUpdate.pl.
by Francois Gouget
The options make it possible to test a specific job/task creation
without having to way for a new WineTest binary download each time.
Also it is now possible to specify the exact task type to create and
if none is given the script will now handle all of them. This way the
crontab commands don't need to be updated when new task types are
added.
Also the script now prints the error messages to stderr by default to
make it easier to figure things out when running it on the command
line. The --log-only option can be used when that's not desired.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
Note: This requires updating the crontab entries. Typically they can
both be replaced with a single command that will create all the relevant
jobs:
*/10 * * * * $HOME/tools/testbot/bin/CheckForWinetestUpdate.pl --log-only
testbot/bin/CheckForWinetestUpdate.pl | 273 +++++++++++++++++++-------
testbot/doc/INSTALL.txt | 3 +-
2 files changed, 199 insertions(+), 77 deletions(-)
diff --git a/testbot/bin/CheckForWinetestUpdate.pl b/testbot/bin/CheckForWinetestUpdate.pl
index 20eacec63..a79f60c71 100755
--- a/testbot/bin/CheckForWinetestUpdate.pl
+++ b/testbot/bin/CheckForWinetestUpdate.pl
@@ -6,6 +6,7 @@
# runs the full test suite on the standard Windows test VMs.
#
# Copyright 2009 Ge van Geldorp
+# Copyright 2018 Francois Gouget
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -37,6 +38,8 @@ sub BEGIN
unshift @INC, "$::RootDir/lib";
}
}
+my $Name0 = $0;
+$Name0 =~ s+^.*/++;
use File::Basename;
use File::Compare;
@@ -60,11 +63,112 @@ my %WineTestUrls = (
64 => "http://test.winehq.org/builds/winetest64-latest.exe"
);
+my %TaskTypes = (build => 1, base32 => 1, winetest32 => 1, all64 => 1);
+
+
+my $Debug;
+sub Debug(@)
+{
+ print STDERR @_ if ($Debug);
+}
+
+my $LogOnly;
+sub Error(@)
+{
+ print STDERR "$Name0:error: ", @_ if (!$LogOnly);
+ LogMsg @_;
+}
+
+
+=pod
+=over 12
+
+=item C<UpdateWineTest()>
+
+Downloads the latest WineTest executable.
+
+Returns 1 if the executable was updated, 0 if it was not, and -1 if an
+error occurred.
+
+=back
+=cut
+
+sub UpdateWineTest($$)
+{
+ my ($OptCreate, $Bits) = @_;
+
+ my $BitsSuffix = ($Bits == 64 ? "64" : "");
+ my $LatestBaseName = "winetest${BitsSuffix}-latest.exe";
+ my $LatestFileName = "$DataDir/latest/$LatestBaseName";
+ if ($OptCreate)
+ {
+ return (1, $LatestBaseName) if (-r $LatestFileName);
+ Debug("$LatestBaseName is missing\n");
+ }
+
+ # See if the online WineTest executable is newer
+ my $UA = LWP::UserAgent->new();
+ $UA->agent("WineTestBot");
+ my $Request = HTTP::Request->new(GET => $WineTestUrls{$Bits});
+ if (-r $LatestFileName)
+ {
+ my $Since = gmtime((stat $LatestFileName)[9]);
+ $Request->header("If-Modified-Since" => "$Since GMT");
+ }
+ Debug("Checking $WineTestUrls{$Bits}\n");
+ my $Response = $UA->request($Request);
+ if ($Response->code == RC_NOT_MODIFIED)
+ {
+ Debug("$LatestBaseName is already up to date\n");
+ return (0, $LatestBaseName); # Already up to date
+ }
+ if ($Response->code != RC_OK)
+ {
+ Error "Unexpected HTTP response code ", $Response->code, "\n";
+ return (-1, undef);
+ }
+
+ # Download the WineTest executable
+ Debug("Downloading $LatestBaseName\n");
+ umask 002;
+ mkdir "$DataDir/staging";
+ my ($fh, $StagingFileName) = OpenNewFile("$DataDir/staging", "_$LatestBaseName");
+ if (!$fh)
+ {
+ Error "Could not create staging file: $!\n";
+ return (-1, undef);
+ }
+ print $fh $Response->decoded_content();
+ close($fh);
+
+ if (-r $LatestFileName and compare($StagingFileName, $LatestFileName) == 0)
+ {
+ Debug("$LatestBaseName did not change\n");
+ unlink($StagingFileName);
+ return (0, $LatestBaseName); # No change after all
+ }
+
+ # Save the WineTest executable to the latest directory for the next round
+ mkdir "$DataDir/latest";
+ if (!move($StagingFileName, $LatestFileName))
+ {
+ Error "Could not move '$StagingFileName' to '$LatestFileName': $!\n";
+ unlink($StagingFileName);
+ return (-1, undef);
+ }
+ utime time, $Response->last_modified, $LatestFileName;
+
+ return (1, $LatestBaseName);
+}
sub AddJob($$$)
{
my ($BaseJob, $LatestBaseName, $Bits) = @_;
+ my $Remarks = ($Bits == 64 ? "64-bit" : $BaseJob ? "base" : "other");
+ $Remarks = "WineTest: $Remarks VMs";
+ Debug("Creating the '$Remarks' job\n");
+
my $VMs = CreateVMs();
if ($Bits == 64)
{
@@ -84,6 +188,7 @@ sub AddJob($$$)
if ($VMs->GetItemsCount() == 0)
{
# There is nothing to do
+ Debug(" Found no VM\n");
return 1;
}
@@ -97,9 +202,7 @@ sub AddJob($$$)
my $NewJob = $Jobs->Add();
$NewJob->User(GetBatchUser());
$NewJob->Priority($BaseJob && $Bits == 32 ? 8 : 9);
- $NewJob->Remarks("WineTest: " .
- ($Bits == 64 ? "64-bit" : $BaseJob ? "base" : "other") .
- " VMs");
+ $NewJob->Remarks($Remarks);
# Add a step to the job
my $Steps = $NewJob->Steps;
@@ -114,6 +217,7 @@ sub AddJob($$$)
my $Tasks = $NewStep->Tasks;
foreach my $VMKey (@{$VMs->SortKeysBySortOrder($VMs->GetKeys())})
{
+ Debug(" $VMKey\n");
my $Task = $Tasks->Add();
$Task->VM($VMs->GetItem($VMKey));
$Task->Timeout($SuiteTimeout);
@@ -123,7 +227,7 @@ sub AddJob($$$)
my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
if (defined $ErrMessage)
{
- LogMsg "Failed to save job: $ErrMessage\n";
+ Error "Failed to save job: $ErrMessage\n";
unlink($StagingFileName);
return 0;
}
@@ -133,12 +237,15 @@ sub AddJob($$$)
sub AddReconfigJob()
{
+ my $Remarks = "Update Wine to latest git";
+ Debug("Creating the '$Remarks' job\n");
+
# First create a new job
my $Jobs = CreateJobs();
my $NewJob = $Jobs->Add();
$NewJob->User(GetBatchUser());
$NewJob->Priority(3);
- $NewJob->Remarks("Update Wine to latest git");
+ $NewJob->Remarks($Remarks);
# Add a step to the job
my $Steps = $NewJob->Steps;
@@ -153,6 +260,7 @@ sub AddReconfigJob()
$VMs->AddFilter("Type", ["build"]);
$VMs->AddFilter("Role", ["base"]);
my $BuildVM = ${$VMs->GetItems()}[0];
+ Debug(" ", $BuildVM->GetKey(), "\n");
my $Task = $NewStep->Tasks->Add();
$Task->VM($BuildVM);
$Task->Timeout($ReconfigTimeout);
@@ -161,97 +269,112 @@ sub AddReconfigJob()
my ($ErrKey, $ErrProperty, $ErrMessage) = $Jobs->Save();
if (defined $ErrMessage)
{
- LogMsg "Failed to save reconfig job: $ErrMessage\n";
+ Error "Failed to save reconfig job: $ErrMessage\n";
return 0;
}
}
-my $Bits = $ARGV[0];
-if (!$Bits)
-{
- die "Usage: CheckForWinetestUpdate.pl <bits>";
-}
-if ($Bits =~ m/^(32|64)$/)
+
+#
+# Command line processing
+#
+
+my ($OptCreate, %OptTypes, $Usage);
+while (@ARGV)
{
- $Bits = $1;
+ my $Arg = shift @ARGV;
+ if ($Arg eq "--create")
+ {
+ $OptCreate = 1;
+ }
+ elsif ($TaskTypes{$Arg})
+ {
+ $OptTypes{$Arg} = 1;
+ }
+ elsif ($Arg eq "--debug")
+ {
+ $Debug = 1;
+ }
+ elsif ($Arg eq "--log-only")
+ {
+ $LogOnly = 1;
+ }
+ elsif ($Arg =~ /^(?:-\?|-h|--help)$/)
+ {
+ $Usage = 0;
+ last;
+ }
+ elsif ($Arg =~ /^-/)
+ {
+ Error "unknown option '$Arg'\n";
+ $Usage = 2;
+ last;
+ }
+ else
+ {
+ Error "unexpected argument '$Arg'\n";
+ $Usage = 2;
+ last;
+ }
}
-else
+
+# Check parameters
+if (!defined $Usage)
{
- die "Invalid number of bits $Bits";
+ map { $OptTypes{$_} = 1 } keys %TaskTypes if (!%OptTypes);
}
-my $BitsSuffix = ($Bits == 64 ? "64" : "");
-
-# Download the winetest executable if new
-my $UA = LWP::UserAgent->new();
-$UA->agent("WineTestBot");
-my $Request = HTTP::Request->new(GET => $WineTestUrls{$Bits});
-my $LatestBaseName = "winetest${BitsSuffix}-latest.exe";
-my $LatestFileName = "$DataDir/latest/$LatestBaseName";
-if (-r $LatestFileName)
+if (defined $Usage)
{
- my $Since = gmtime((stat $LatestFileName)[9]);
- $Request->header("If-Modified-Since" => "$Since GMT");
+ print "Usage: $Name0 [--debug] [--log-only] [--help] [--create] [TASKTYPE] ...\n";
+ print "\n";
+ print "Where TASKTYPE is one of: ", join(" ", sort keys %TaskTypes), "\n";
+ exit $Usage;
}
-my $Response = $UA->request($Request);
-if ($Response->code != RC_OK)
+
+
+#
+# Create the 32 bit tasks
+#
+
+my $Rc = 0;
+if ($OptTypes{build} or $OptTypes{base32} or $OptTypes{winetest32})
{
- if ($Response->code != RC_NOT_MODIFIED)
+ my ($Create, $LatestBaseName) = UpdateWineTest($OptCreate, 32);
+ if ($Create < 0)
{
- LogMsg "Unexpected HTTP response code ", $Response->code, "\n";
- exit 1;
+ $Rc = 1;
+ }
+ elsif ($Create == 1)
+ {
+ # A new executable means there have been commits so update Wine. Create
+ # this job first purely to make the WineTestBot job queue look nice, and
+ # arbitrarily do it only for 32-bit executables to avoid redundant updates.
+ $Rc = 1 if ($OptTypes{build} and !AddReconfigJob());
+ $Rc = 1 if ($OptTypes{base32} and !AddJob("base", $LatestBaseName, 32));
+ $Rc = 1 if ($OptTypes{winetest32} and !AddJob("", $LatestBaseName, 32));
}
- exit 0;
}
-# Store the new WineTest executable in the staging directory:
-# - So we can compare it to the reference one in the latest directory to
-# verify that it truly is new.
-# - Because we don't know the relevant Job and Step IDs yet and thus cannot
-# put it in the jobs directory tree.
-umask 002;
-mkdir "$DataDir/staging";
-my ($fh, $StagingFileName) = OpenNewFile("$DataDir/staging", "_$LatestBaseName");
-if (!$fh)
-{
- LogMsg "Could not create staging file: $!\n";
- exit 1;
-}
-print $fh $Response->decoded_content();
-close($fh);
-my $NewFile = 1;
-if (-r $LatestFileName)
-{
- $NewFile = compare($StagingFileName, $LatestFileName) != 0;
-}
-if (!$NewFile)
-{
- # Nothing to do
- unlink($StagingFileName);
- exit 0;
-}
+#
+# Create the 64 bit tasks
+#
-# Save the WineTest executable in the latest directory for the next round
-mkdir "$DataDir/latest";
-if (!move($StagingFileName, $LatestFileName))
+if ($OptTypes{all64})
{
- LogMsg "Could not move '$StagingFileName' to '$LatestFileName': $!\n";
- unlink($StagingFileName);
- exit 1;
+ my ($Create, $LatestBaseName) = UpdateWineTest($OptCreate, 64);
+ if ($Create < 0)
+ {
+ $Rc = 1;
+ }
+ elsif ($Create == 1)
+ {
+ $Rc = 1 if ($OptTypes{all64} and !AddJob("", $LatestBaseName, 64));
+ }
}
-utime time, $Response->last_modified, $LatestFileName;
-
-# A new executable means there have been commits so update Wine. Create this
-# job first purely to make the WineTestBot job queue look nice, and arbitrarily
-# do it only for 32-bit executables to avoid redundant updates.
-my $rc = 0;
-$rc = 1 if ($Bits == 32 and !AddReconfigJob());
-
-$rc = 1 if (!AddJob(1, $LatestBaseName, $Bits));
-$rc = 1 if ($Bits == 32 and !AddJob(!1, $LatestBaseName, $Bits));
RescheduleJobs();
LogMsg "Submitted jobs\n";
-exit $rc;
+exit $Rc;
diff --git a/testbot/doc/INSTALL.txt b/testbot/doc/INSTALL.txt
index 8827c227d..cb7c31b97 100644
--- a/testbot/doc/INSTALL.txt
+++ b/testbot/doc/INSTALL.txt
@@ -86,8 +86,7 @@ Setup for Wine's patches site:
Setup for Winetest updates:
- Use a cron job to run CheckForWinetestUpdate.pl periodically. For
instance:
- */10 * * * * $HOME/tools/testbot/bin/CheckForWinetestUpdate.pl 32
- */10 * * * * $HOME/tools/testbot/bin/CheckForWinetestUpdate.pl 64
+ */10 * * * * $HOME/tools/testbot/bin/CheckForWinetestUpdate.pl --log-only
Setup for wine-devel:
- A proper WineTestBot system should integrate with Wine's patches site.
--
2.17.0
June 5, 2018
[PATCH v2 2/2] wbemdisp/tests: Add ISWbemSecurity tests
by Hans Leidekker
From: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
v2: Add more tests for default settings.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/wbemdisp/tests/wbemdisp.c | 43 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/dlls/wbemdisp/tests/wbemdisp.c b/dlls/wbemdisp/tests/wbemdisp.c
index 171a91edb4..1ce045697a 100644
--- a/dlls/wbemdisp/tests/wbemdisp.c
+++ b/dlls/wbemdisp/tests/wbemdisp.c
@@ -265,7 +265,10 @@ static void test_locator(void)
ISWbemObject *object;
ISWbemPropertySet *prop_set;
ISWbemProperty *prop;
+ ISWbemSecurity *security;
VARIANT var;
+ WbemImpersonationLevelEnum imp_level;
+ WbemAuthenticationLevelEnum auth_level;
hr = CoCreateInstance( &CLSID_SWbemLocator, NULL, CLSCTX_INPROC_SERVER, &IID_ISWbemLocator, (void **)&locator );
ok( hr == S_OK, "got %x\n", hr );
@@ -284,6 +287,34 @@ static void test_locator(void)
SysFreeString( lang_bstr );
SysFreeString( query_bstr );
+ hr = ISWbemLocator_get_Security_( locator, &security );
+ ok( hr == S_OK, "got %x\n", hr );
+ imp_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( imp_level == wbemImpersonationLevelImpersonate, "got %u\n", imp_level );
+ hr = ISWbemSecurity_put_ImpersonationLevel( security, wbemImpersonationLevelAnonymous );
+ ok( hr == S_OK, "got %x\n", hr );
+ imp_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( imp_level == wbemImpersonationLevelAnonymous, "got %u\n", imp_level );
+
+ auth_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+ todo_wine {
+ ok( hr == WBEM_E_FAILED, "got %x\n", hr );
+ ok( auth_level == 0xdeadbeef, "got %u\n", auth_level );
+ }
+ hr = ISWbemSecurity_put_AuthenticationLevel( security, wbemAuthenticationLevelNone );
+ ok( hr == S_OK, "got %x\n", hr );
+ auth_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( auth_level == wbemAuthenticationLevelNone, "got %u\n", auth_level );
+ ISWbemSecurity_Release( security );
+ security = NULL;
+
hr = ISWbemObjectSet_get__NewEnum( object_set, (IUnknown**)&enum_var );
ok( hr == S_OK, "got %x\n", hr );
@@ -318,6 +349,18 @@ static void test_locator(void)
ok( V_VT(&var) == VT_BSTR, "got %x\n", V_VT(&var) );
VariantClear( &var );
+ hr = ISWbemServices_get_Security_( services, &security );
+ ok( hr == S_OK, "got %x\n", hr );
+ imp_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_ImpersonationLevel( security, &imp_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( imp_level == wbemImpersonationLevelImpersonate, "got %u\n", imp_level );
+ auth_level = 0xdeadbeef;
+ hr = ISWbemSecurity_get_AuthenticationLevel( security, &auth_level );
+ ok( hr == S_OK, "got %x\n", hr );
+ ok( auth_level == wbemAuthenticationLevelPktPrivacy, "got %u\n", auth_level );
+
+ ISWbemSecurity_Release(security);
ISWbemProperty_Release( prop );
ISWbemPropertySet_Release( prop_set );
ISWbemObject_Release( object );
--
2.11.0
June 5, 2018
[PATCH v2 1/2] wbemdisp: Add ISWbemSecurity stub interface.
by Hans Leidekker
From: Michael Müller <michael(a)fds-team.de>
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/wbemdisp/locator.c | 249 +++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 244 insertions(+), 5 deletions(-)
diff --git a/dlls/wbemdisp/locator.c b/dlls/wbemdisp/locator.c
index e782d1f523..cdc0ab4479 100644
--- a/dlls/wbemdisp/locator.c
+++ b/dlls/wbemdisp/locator.c
@@ -38,6 +38,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(wbemdisp);
static HRESULT EnumVARIANT_create( IEnumWbemClassObject *, IEnumVARIANT ** );
+static HRESULT ISWbemSecurity_create( ISWbemSecurity ** );
enum type_id
{
@@ -47,6 +48,7 @@ enum type_id
ISWbemProperty_tid,
ISWbemPropertySet_tid,
ISWbemServices_tid,
+ ISWbemSecurity_tid,
last_tid
};
@@ -60,7 +62,8 @@ static REFIID wbemdisp_tid_id[] =
&IID_ISWbemObjectSet,
&IID_ISWbemProperty,
&IID_ISWbemPropertySet,
- &IID_ISWbemServices
+ &IID_ISWbemServices,
+ &IID_ISWbemSecurity
};
static HRESULT get_typeinfo( enum type_id tid, ITypeInfo **ret )
@@ -1873,8 +1876,12 @@ static HRESULT WINAPI services_get_Security_(
ISWbemServices *iface,
ISWbemSecurity **objWbemSecurity )
{
- FIXME( "\n" );
- return E_NOTIMPL;
+ TRACE( "%p, %p\n", iface, objWbemSecurity );
+
+ if (!objWbemSecurity)
+ return E_INVALIDARG;
+
+ return ISWbemSecurity_create( objWbemSecurity );
}
static const ISWbemServicesVtbl services_vtbl =
@@ -2128,8 +2135,12 @@ static HRESULT WINAPI locator_get_Security_(
ISWbemLocator *iface,
ISWbemSecurity **objWbemSecurity )
{
- FIXME( "%p, %p\n", iface, objWbemSecurity );
- return E_NOTIMPL;
+ TRACE( "%p, %p\n", iface, objWbemSecurity );
+
+ if (!objWbemSecurity)
+ return E_INVALIDARG;
+
+ return ISWbemSecurity_create( objWbemSecurity );
}
static const ISWbemLocatorVtbl locator_vtbl =
@@ -2160,3 +2171,231 @@ HRESULT SWbemLocator_create( void **obj )
TRACE( "returning iface %p\n", *obj );
return S_OK;
}
+
+struct security
+{
+ ISWbemSecurity ISWbemSecurity_iface;
+ LONG refs;
+ WbemImpersonationLevelEnum implevel;
+ WbemAuthenticationLevelEnum authlevel;
+};
+
+static inline struct security *impl_from_ISWbemSecurity( ISWbemSecurity *iface )
+{
+ return CONTAINING_RECORD( iface, struct security, ISWbemSecurity_iface );
+}
+
+static ULONG WINAPI security_AddRef(
+ ISWbemSecurity *iface )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ return InterlockedIncrement( &security->refs );
+}
+
+static ULONG WINAPI security_Release(
+ ISWbemSecurity *iface )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ LONG refs = InterlockedDecrement( &security->refs );
+ if (!refs)
+ {
+ TRACE( "destroying %p\n", security );
+ heap_free( security );
+ }
+ return refs;
+}
+
+static HRESULT WINAPI security_QueryInterface(
+ ISWbemSecurity *iface,
+ REFIID riid,
+ void **ppvObject )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ TRACE( "%p, %s, %p\n", security, debugstr_guid( riid ), ppvObject );
+
+ if (IsEqualGUID( riid, &IID_ISWbemSecurity ) ||
+ IsEqualGUID( riid, &IID_IDispatch ) ||
+ IsEqualGUID( riid, &IID_IUnknown ))
+ {
+ *ppvObject = iface;
+ }
+ else
+ {
+ FIXME( "interface %s not implemented\n", debugstr_guid(riid) );
+ return E_NOINTERFACE;
+ }
+ ISWbemSecurity_AddRef( iface );
+ return S_OK;
+}
+
+static HRESULT WINAPI security_GetTypeInfoCount(
+ ISWbemSecurity *iface,
+ UINT *count )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ TRACE( "%p, %p\n", security, count );
+
+ *count = 1;
+ return S_OK;
+}
+
+static HRESULT WINAPI security_GetTypeInfo(
+ ISWbemSecurity *iface,
+ UINT index,
+ LCID lcid,
+ ITypeInfo **info )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ TRACE( "%p, %u, %u, %p\n", security, index, lcid, info );
+
+ return get_typeinfo( ISWbemSecurity_tid, info );
+}
+
+static HRESULT WINAPI security_GetIDsOfNames(
+ ISWbemSecurity *iface,
+ REFIID riid,
+ LPOLESTR *names,
+ UINT count,
+ LCID lcid,
+ DISPID *dispid )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ ITypeInfo *typeinfo;
+ HRESULT hr;
+
+ TRACE( "%p, %s, %p, %u, %u, %p\n", security, debugstr_guid(riid), names, count, lcid, dispid );
+
+ if (!names || !count || !dispid) return E_INVALIDARG;
+
+ hr = get_typeinfo( ISWbemSecurity_tid, &typeinfo );
+ if (SUCCEEDED(hr))
+ {
+ hr = ITypeInfo_GetIDsOfNames( typeinfo, names, count, dispid );
+ ITypeInfo_Release( typeinfo );
+ }
+ return hr;
+}
+
+static HRESULT WINAPI security_Invoke(
+ ISWbemSecurity *iface,
+ DISPID member,
+ REFIID riid,
+ LCID lcid,
+ WORD flags,
+ DISPPARAMS *params,
+ VARIANT *result,
+ EXCEPINFO *excep_info,
+ UINT *arg_err )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ ITypeInfo *typeinfo;
+ HRESULT hr;
+
+ TRACE( "%p, %d, %s, %d, %d, %p, %p, %p, %p\n", security, member, debugstr_guid(riid),
+ lcid, flags, params, result, excep_info, arg_err );
+
+ hr = get_typeinfo( ISWbemSecurity_tid, &typeinfo );
+ if (SUCCEEDED(hr))
+ {
+ hr = ITypeInfo_Invoke( typeinfo, &security->ISWbemSecurity_iface, member, flags,
+ params, result, excep_info, arg_err );
+ ITypeInfo_Release( typeinfo );
+ }
+ return hr;
+}
+
+static HRESULT WINAPI security_get_ImpersonationLevel(
+ ISWbemSecurity *iface,
+ WbemImpersonationLevelEnum *impersonation_level )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ FIXME( "%p, %p: stub\n", security, impersonation_level );
+
+ if (!impersonation_level)
+ return E_INVALIDARG;
+
+ *impersonation_level = security->implevel;
+ return S_OK;
+}
+
+static HRESULT WINAPI security_put_ImpersonationLevel(
+ ISWbemSecurity *iface,
+ WbemImpersonationLevelEnum impersonation_level )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ FIXME( "%p, %d: stub\n", security, impersonation_level );
+
+ security->implevel = impersonation_level;
+ return S_OK;
+}
+
+static HRESULT WINAPI security_get_AuthenticationLevel(
+ ISWbemSecurity *iface,
+ WbemAuthenticationLevelEnum *authentication_level )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ FIXME( "%p, %p: stub\n", security, authentication_level );
+
+ if (!authentication_level)
+ return E_INVALIDARG;
+
+ *authentication_level = security->authlevel;
+ return S_OK;
+}
+
+static HRESULT WINAPI security_put_AuthenticationLevel(
+ ISWbemSecurity *iface,
+ WbemAuthenticationLevelEnum authentication_level )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ FIXME( "%p, %d: stub\n", security, authentication_level );
+
+ security->authlevel = authentication_level;
+ return S_OK;
+}
+
+static HRESULT WINAPI security_get_Privileges(
+ ISWbemSecurity *iface,
+ ISWbemPrivilegeSet **privilege_set )
+{
+ struct security *security = impl_from_ISWbemSecurity( iface );
+ FIXME( "%p, %p: stub\n", security, privilege_set );
+
+ if (!privilege_set)
+ return E_INVALIDARG;
+
+ return E_NOTIMPL;
+}
+
+static const ISWbemSecurityVtbl security_vtbl =
+{
+ security_QueryInterface,
+ security_AddRef,
+ security_Release,
+ security_GetTypeInfoCount,
+ security_GetTypeInfo,
+ security_GetIDsOfNames,
+ security_Invoke,
+ security_get_ImpersonationLevel,
+ security_put_ImpersonationLevel,
+ security_get_AuthenticationLevel,
+ security_put_AuthenticationLevel,
+ security_get_Privileges
+};
+
+static HRESULT ISWbemSecurity_create( ISWbemSecurity **obj )
+{
+ struct security *security;
+
+ TRACE( "%p\n", obj );
+
+ if (!(security = heap_alloc( sizeof(*security) ))) return E_OUTOFMEMORY;
+ security->ISWbemSecurity_iface.lpVtbl = &security_vtbl;
+ security->refs = 1;
+ security->implevel = wbemImpersonationLevelImpersonate;
+ security->authlevel = wbemAuthenticationLevelPktPrivacy;
+
+ *obj = &security->ISWbemSecurity_iface;
+ TRACE( "returning iface %p\n", *obj );
+ return S_OK;
+}
--
2.11.0
June 5, 2018
Re: [PATCH 3/3] msi/tests: Test deferral of WriteRegistryValues.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
June 5, 2018
Re: [PATCH 2/3] msi/tests: Simplify and clarify WriteRegistryValues and RemoveRegistryValues tests.
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
June 5, 2018