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
January 2022
- 86 participants
- 2418 messages
[PATCH v2 1/4] wine.inf: Start PlugPlay service on prefix initialization.
by Rémi Bernon
Device drivers may be installed and started on prefix initialization but
if PlugPlay is missing they won't be able to send plugplay notifications
until the prefix is restarted.
The service has StartType=2, and should start automatically.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
---
loader/wine.inf.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index c0251934dfc..3af8dabca64 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -178,7 +178,7 @@ AddService=RpcSs,0,RpcSsService
AddService=Spooler,0,SpoolerService
AddService=StiSvc,0,StiService
AddService=TermService,0,TerminalServices
-AddService=PlugPlay,0,PlugPlayService
+AddService=PlugPlay,0x800,PlugPlayService
AddService=FontCache3.0.0.0,0,WPFFontCacheService
AddService=LanmanServer,0,LanmanServerService
AddService=FontCache,0,FontCacheService
@@ -197,7 +197,7 @@ AddService=RpcSs,0,RpcSsService
AddService=Spooler,0,SpoolerService
AddService=StiSvc,0,StiService
AddService=TermService,0,TerminalServices
-AddService=PlugPlay,0,PlugPlayService
+AddService=PlugPlay,0x800,PlugPlayService
AddService=FontCache3.0.0.0,0,WPFFontCacheService
AddService=LanmanServer,0,LanmanServerService
AddService=FontCache,0,FontCacheService
@@ -216,7 +216,7 @@ AddService=RpcSs,0,RpcSsService
AddService=Spooler,0,SpoolerService
AddService=StiSvc,0,StiService
AddService=TermService,0,TerminalServices
-AddService=PlugPlay,0,PlugPlayService
+AddService=PlugPlay,0x800,PlugPlayService
AddService=FontCache3.0.0.0,0,WPFFontCacheService
AddService=LanmanServer,0,LanmanServerService
AddService=FontCache,0,FontCacheService
@@ -235,7 +235,7 @@ AddService=RpcSs,0,RpcSsService
AddService=Spooler,0,SpoolerService
AddService=StiSvc,0,StiService
AddService=TermService,0,TerminalServices
-AddService=PlugPlay,0,PlugPlayService
+AddService=PlugPlay,0x800,PlugPlayService
AddService=FontCache3.0.0.0,0,WPFFontCacheService
AddService=LanmanServer,0,LanmanServerService
AddService=FontCache,0,FontCacheService
--
2.34.1
Jan. 26, 2022
[PATCH vkd3d v2 6/6] vkd3d-shader/hlsl: Parse bitwise OR.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl.y | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index edebb23c..60b22c3a 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -3505,7 +3505,7 @@ bitor_expr:
bitxor_expr
| bitor_expr '|' bitxor_expr
{
- hlsl_fixme(ctx, &@$, "Bitwise OR.");
+ $$ = add_binary_bitwise_expr_merge(ctx, $1, $3, HLSL_OP2_BIT_OR, &@2);
}
logicand_expr:
--
2.34.1
Jan. 26, 2022
[PATCH vkd3d v2 5/6] vkd3d-shader/hlsl: Parse bitwise XOR.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl.y | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index 11d00f53..edebb23c 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -3498,7 +3498,7 @@ bitxor_expr:
bitand_expr
| bitxor_expr '^' bitand_expr
{
- hlsl_fixme(ctx, &@$, "Bitwise XOR.");
+ $$ = add_binary_bitwise_expr_merge(ctx, $1, $3, HLSL_OP2_BIT_XOR, &@2);
}
bitor_expr:
--
2.34.1
Jan. 26, 2022
[PATCH vkd3d v2 4/6] vkd3d-shader/hlsl: Parse bitwise AND.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
* Emit error messages.
---
libs/vkd3d-shader/hlsl.y | 45 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 44 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y
index cff56a74..11d00f53 100644
--- a/libs/vkd3d-shader/hlsl.y
+++ b/libs/vkd3d-shader/hlsl.y
@@ -1057,6 +1057,49 @@ static struct list *add_binary_arithmetic_expr_merge(struct hlsl_ctx *ctx, struc
return list1;
}
+static struct hlsl_ir_expr *add_binary_bitwise_expr(struct hlsl_ctx *ctx, struct list *instrs,
+ enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2,
+ const struct vkd3d_shader_location *loc)
+{
+ if (arg1->data_type->base_type == HLSL_TYPE_HALF || arg1->data_type->base_type == HLSL_TYPE_FLOAT)
+ {
+ struct vkd3d_string_buffer *type_str = hlsl_type_to_string(ctx, arg1->data_type);
+
+ if (type_str)
+ hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
+ "The first argument has type '%s', which is not integer.",
+ type_str->buffer);
+ hlsl_release_string_buffer(ctx, type_str);
+ return NULL;
+ }
+
+ if (arg2->data_type->base_type == HLSL_TYPE_HALF || arg2->data_type->base_type == HLSL_TYPE_FLOAT)
+ {
+ struct vkd3d_string_buffer *type_str = hlsl_type_to_string(ctx, arg2->data_type);
+
+ if (type_str)
+ hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE,
+ "The second argument has type '%s', which is not integer.",
+ type_str->buffer);
+ hlsl_release_string_buffer(ctx, type_str);
+ return NULL;
+ }
+
+ return add_binary_arithmetic_expr(ctx, instrs, op, arg1, arg2, loc);
+}
+
+static struct list *add_binary_bitwise_expr_merge(struct hlsl_ctx *ctx, struct list *list1, struct list *list2,
+ enum hlsl_ir_expr_op op, const struct vkd3d_shader_location *loc)
+{
+ struct hlsl_ir_node *arg1 = node_from_list(list1), *arg2 = node_from_list(list2);
+
+ list_move_tail(list1, list2);
+ vkd3d_free(list2);
+ add_binary_bitwise_expr(ctx, list1, op, arg1, arg2, loc);
+
+ return list1;
+}
+
static struct hlsl_ir_expr *add_binary_comparison_expr(struct hlsl_ctx *ctx, struct list *instrs,
enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2,
struct vkd3d_shader_location *loc)
@@ -3448,7 +3491,7 @@ bitand_expr:
equality_expr
| bitand_expr '&' equality_expr
{
- hlsl_fixme(ctx, &@$, "Bitwise AND.");
+ $$ = add_binary_bitwise_expr_merge(ctx, $1, $3, HLSL_OP2_BIT_AND, &@2);
}
bitxor_expr:
--
2.34.1
Jan. 26, 2022
[PATCH vkd3d v2 3/6] vkd3d-shader/hlsl: Write SM4 unsigned multiplication instructions.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
* Rename to write_sm4_binary_op_with_two_destinations().
* Fix writemask mapping (before it always used the writemask from
destination 1, but of course it has to use dst_idx).
---
libs/vkd3d-shader/hlsl_sm4.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
index 8fc4e738..dfd5dd5c 100644
--- a/libs/vkd3d-shader/hlsl_sm4.c
+++ b/libs/vkd3d-shader/hlsl_sm4.c
@@ -745,7 +745,7 @@ struct sm4_instruction
{
struct sm4_register reg;
unsigned int writemask;
- } dsts[1];
+ } dsts[2];
unsigned int dst_count;
struct
@@ -1169,6 +1169,31 @@ static void write_sm4_binary_op(struct vkd3d_bytecode_buffer *buffer, enum vkd3d
write_sm4_instruction(buffer, &instr);
}
+static void write_sm4_binary_op_with_two_destinations(struct vkd3d_bytecode_buffer *buffer,
+ enum vkd3d_sm4_opcode opcode, const struct hlsl_ir_node *dst, unsigned dst_idx,
+ const struct hlsl_ir_node *src1, const struct hlsl_ir_node *src2)
+{
+ struct sm4_instruction instr;
+ unsigned int writemask;
+
+ memset(&instr, 0, sizeof(instr));
+ instr.opcode = opcode;
+
+ instr.dsts[1 - dst_idx].reg.type = VKD3D_SM4_RT_NULL;
+ instr.dsts[1 - dst_idx].reg.dim = VKD3D_SM4_DIMENSION_NONE;
+ instr.dsts[1 - dst_idx].reg.idx_count = 0;
+ sm4_register_from_node(&instr.dsts[dst_idx].reg, &instr.dsts[dst_idx].writemask, NULL, dst);
+ instr.dst_count = 2;
+
+ sm4_register_from_node(&instr.srcs[0].reg, &writemask, &instr.srcs[0].swizzle_type, src1);
+ instr.srcs[0].swizzle = hlsl_map_swizzle(hlsl_swizzle_from_writemask(writemask), instr.dsts[dst_idx].writemask);
+ sm4_register_from_node(&instr.srcs[1].reg, &writemask, &instr.srcs[1].swizzle_type, src2);
+ instr.srcs[1].swizzle = hlsl_map_swizzle(hlsl_swizzle_from_writemask(writemask), instr.dsts[dst_idx].writemask);
+ instr.src_count = 2;
+
+ write_sm4_instruction(buffer, &instr);
+}
+
static void write_sm4_constant(struct hlsl_ctx *ctx,
struct vkd3d_bytecode_buffer *buffer, const struct hlsl_ir_constant *constant)
{
@@ -1482,6 +1507,13 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
write_sm4_binary_op(buffer, VKD3D_SM4_OP_UMIN, &expr->node, arg1, arg2);
break;
+ case HLSL_OP2_MUL:
+ /* Using IMUL instead of UMUL because we're taking
+ * the low bits, and the native compiler generates
+ * IMUL. */
+ write_sm4_binary_op_with_two_destinations(buffer, VKD3D_SM4_OP_IMUL, &expr->node, 1, arg1, arg2);
+ break;
+
default:
hlsl_fixme(ctx, &expr->node.loc, "SM4 uint \"%s\" expression.\n", debug_hlsl_expr_op(expr->op));
break;
--
2.34.1
Jan. 26, 2022
[PATCH vkd3d v2 2/6] tests: Test a number of simple HLSL operations.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
--
v2:
* Split to many individual tests
---
Makefile.am | 2 +
tests/hlsl-operations.shader_test | 367 ++++++++++++++++++++++++++++++
2 files changed, 369 insertions(+)
create mode 100644 tests/hlsl-operations.shader_test
diff --git a/Makefile.am b/Makefile.am
index 67225f91..2f36f3a1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -75,6 +75,7 @@ vkd3d_shader_tests = \
tests/hlsl-mul.shader_test \
tests/hlsl-nested-arrays.shader_test \
tests/hlsl-numeric-types.shader_test \
+ tests/hlsl-operations.shader_test \
tests/hlsl-return-implicit-conversion.shader_test \
tests/hlsl-return-void.shader_test \
tests/hlsl-shape.shader_test \
@@ -300,6 +301,7 @@ XFAIL_TESTS = \
tests/hlsl-mul.shader_test \
tests/hlsl-nested-arrays.shader_test \
tests/hlsl-numeric-types.shader_test \
+ tests/hlsl-operations.shader_test \
tests/hlsl-return-implicit-conversion.shader_test \
tests/hlsl-return-void.shader_test \
tests/hlsl-shape.shader_test \
diff --git a/tests/hlsl-operations.shader_test b/tests/hlsl-operations.shader_test
new file mode 100644
index 00000000..717899b5
--- /dev/null
+++ b/tests/hlsl-operations.shader_test
@@ -0,0 +1,367 @@
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float x = 5.0;
+ float y = 15.0;
+
+ return float4(x + y, x - y, x * y, x / y);
+}
+
+[test]
+draw quad
+probe all rgba (20.0, -10.0, 75.0, 0.33333333)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float x = 5.0;
+ float y = 15.0;
+
+ return float4(x % y, +x, -x, y / x);
+}
+
+[test]
+draw quad
+probe all rgba (5.0, 5.0, -5.0, 3.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float x = 5.0;
+ float y = 15.0;
+
+ return float4(x == y, x != y, x < y, x <= y);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float x = 5.0;
+ float y = 15.0;
+ float zero = 0.0;
+
+ return float4(x > y, x >= y, !x, !zero);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float zero = 0.0;
+ float one = 1.0;
+
+ return float4(zero && zero, zero && one, one && zero, one && one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ float zero = 0.0;
+ float one = 1.0;
+
+ return float4(zero || zero, zero || one, one || zero, one || one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int x = 5;
+ int y = 15;
+
+ return float4(x + y, x - y, x * y, x / y);
+}
+
+[test]
+draw quad
+probe all rgba (20.0, -10.0, 75.0, 0.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int x = 5;
+ int y = 15;
+
+ return float4(x % y, +x, -x, y / x);
+}
+
+[test]
+draw quad
+probe all rgba (5.0, 5.0, -5.0, 3.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int x = 5;
+ int y = 15;
+
+ return float4(x == y, x != y, x < y, x <= y);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int x = 5;
+ int y = 15;
+ int zero = 0;
+
+ return float4(x > y, x >= y, !x, !zero);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int x = 5;
+ int y = 15;
+
+ return float4(x >> y, y >> x, x << y, y << x);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 163840.0, 480.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int x = 5;
+ int y = 15;
+
+ return float4(x & y, x | y, x ^ y, ~x);
+}
+
+[test]
+draw quad
+probe all rgba (5.0, 15.0, 10.0, -6.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int zero = 0;
+ int one = 1;
+
+ return float4(zero && zero, zero && one, one && zero, one && one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int zero = 0;
+ int one = 1;
+
+ return float4(zero || zero, zero || one, one || zero, one || one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int zero = 0;
+ int one = 1;
+
+ return float4(zero & zero, zero & one, one & zero, one & one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int zero = 0;
+ int one = 1;
+
+ return float4(zero | zero, zero | one, one | zero, one | one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ int zero = 0;
+ int one = 1;
+
+ return float4(zero ^ zero, zero ^ one, one ^ zero, one ^ one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 0.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint x = 5;
+ uint y = 15;
+
+ return float4(x + y, x - y, x * y, x / y);
+}
+
+[test]
+draw quad
+probe all rgba (20.0, 4294967300.0, 75.0, 0.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint x = 5;
+ uint y = 15;
+
+ return float4(x % y, +x, -x, y / x);
+}
+
+[test]
+draw quad
+probe all rgba (5.0, 5.0, 4294967300.0, 3.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint x = 5;
+ uint y = 15;
+
+ return float4(x == y, x != y, x < y, x <= y);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint x = 5;
+ uint y = 15;
+ uint zero = 0;
+
+ return float4(x > y, x >= y, !x, !zero);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint x = 5;
+ uint y = 15;
+
+ return float4(x >> y, y >> x, x << y, y << x);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 163840.0, 480.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint x = 5;
+ uint y = 15;
+
+ return float4(x & y, x | y, x ^ y, ~x);
+}
+
+[test]
+draw quad
+probe all rgba (5.0, 15.0, 10.0, 4294967300.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint zero = 0;
+ uint one = 1;
+
+ return float4(zero && zero, zero && one, one && zero, one && one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint zero = 0;
+ uint one = 1;
+
+ return float4(zero || zero, zero || one, one || zero, one || one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint zero = 0;
+ uint one = 1;
+
+ return float4(zero & zero, zero & one, one & zero, one & one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 0.0, 0.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint zero = 0;
+ uint one = 1;
+
+ return float4(zero | zero, zero | one, one | zero, one | one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 1.0)
+
+[pixel shader]
+float4 main() : SV_TARGET
+{
+ uint zero = 0;
+ uint one = 1;
+
+ return float4(zero ^ zero, zero ^ one, one ^ zero, one ^ one);
+}
+
+[test]
+draw quad
+probe all rgba (0.0, 1.0, 1.0, 0.0)
--
2.34.1
Jan. 26, 2022
[PATCH vkd3d v2 1/6] tests: Test matrix multiplication.
by Giovanni Mascellani
Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
---
v2:
* Split to many individual tests
---
Makefile.am | 2 +
tests/hlsl-mul.shader_test | 290 +++++++++++++++++++++++++++++++++++++
2 files changed, 292 insertions(+)
create mode 100644 tests/hlsl-mul.shader_test
diff --git a/Makefile.am b/Makefile.am
index 3b2e7d71..67225f91 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,6 +72,7 @@ vkd3d_shader_tests = \
tests/hlsl-invalid.shader_test \
tests/hlsl-majority-pragma.shader_test \
tests/hlsl-majority-typedef.shader_test \
+ tests/hlsl-mul.shader_test \
tests/hlsl-nested-arrays.shader_test \
tests/hlsl-numeric-types.shader_test \
tests/hlsl-return-implicit-conversion.shader_test \
@@ -296,6 +297,7 @@ XFAIL_TESTS = \
tests/hlsl-intrinsic-override.shader_test \
tests/hlsl-majority-pragma.shader_test \
tests/hlsl-majority-typedef.shader_test \
+ tests/hlsl-mul.shader_test \
tests/hlsl-nested-arrays.shader_test \
tests/hlsl-numeric-types.shader_test \
tests/hlsl-return-implicit-conversion.shader_test \
diff --git a/tests/hlsl-mul.shader_test b/tests/hlsl-mul.shader_test
new file mode 100644
index 00000000..7b453187
--- /dev/null
+++ b/tests/hlsl-mul.shader_test
@@ -0,0 +1,290 @@
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float4 y = float4(1.0, 2.0, 3.0, 4.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (30.0, 70.0, 110.0, 150.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4 x = float4(1.0, 2.0, 3.0, 4.0);
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (90.0, 100.0, 110.0, 120.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float3 y = float3(1.0, 2.0, 3.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (14.0, 38.0, 62.0, 86.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float3 x = float3(1.0, 2.0, 3.0);
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (38.0, 44.0, 50.0, 56.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float3x3 x = float3x3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+ float4 y = float4(1.0, 2.0, 3.0, 4.0);
+
+ return float4(mul(x, y), 0.0);
+}
+
+[test]
+draw quad
+probe all rgba (14.0, 32.0, 50.0, 0.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4 x = float4(1.0, 2.0, 3.0, 4.0);
+ float3x3 y = float3x3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ return float4(mul(x, y), 0.0);
+}
+
+[test]
+draw quad
+probe all rgba (30.0, 36.0, 42.0, 0.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float x = 10.0;
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y)[1];
+}
+
+[test]
+draw quad
+probe all rgba (50.0, 60.0, 70.0, 80.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float y = 10.0;
+
+ return mul(x, y)[1];
+}
+
+[test]
+draw quad
+probe all rgba (50.0, 60.0, 70.0, 80.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float1 x = float1(10.0);
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (10.0, 20.0, 30.0, 40.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float1 y = float1(10.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (10.0, 50.0, 90.0, 130.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float1x1 x = float1x1(10.0);
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (10.0, 20.0, 30.0, 40.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float1x1 y = float1x1(10.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (10.0, 50.0, 90.0, 130.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float1x4 x = float1x4(1.0, 2.0, 3.0, 4.0);
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (90.0, 100.0, 110.0, 120.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float1x4 y = float1x4(1.0, 2.0, 3.0, 4.0);
+
+ return mul(x, y)[1];
+}
+
+[test]
+draw quad
+probe all rgba (5.0, 10.0, 15.0, 20.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x1 x = float4x1(1.0, 2.0, 3.0, 4.0);
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y)[1];
+}
+
+[test]
+draw quad
+probe all rgba (2.0, 4.0, 6.0, 8.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float4x1 y = float4x1(1.0, 2.0, 3.0, 4.0);
+
+ return mul(x, y);
+}
+
+[test]
+draw quad
+probe all rgba (30.0, 70.0, 110.0, 150.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float3x3 x = float3x3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+ float4x4 y = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ return mul(x, y)[1];
+}
+
+[test]
+draw quad
+probe all rgba (83.0, 98.0, 113.0, 128.0)
+
+[pixel shader]
+float4 main(float4 pos : sv_position) : sv_target
+{
+ float4x4 x = float4x4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float3x3 y = float3x3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ return float4(mul(x, y)[1], 0.0);
+}
+
+[test]
+draw quad
+probe all rgba (78.0, 96.0, 114.0, 0.0)
--
2.34.1
Jan. 26, 2022
Re: [PATCH 1/3] plugplay: Avoid requiring rpcss.exe for PnP RPC notifications.
by Rémi Bernon
After a better look it seems like this is not actually required for
things to work properly, and what I thought was a dependency on rpcss
was apparently an unfortunate and rare race condition during services
shutdown (winedevice.exe getting stuck calling QueryServiceStatusEx),
which has been resolved by terminating the services.
I still believe this is somehow a valid change though the title is
incorrect:
According to MSDN, "\pipe\xxx" endpoints are only supposed to be used
with ncacn_np whereas ncalrpc is supposed so be used with arbitrary
"port" which must not contain any \.
The ncalrpc transport actually builds an internal \\.\pipe\lrpc\xxx pipe
name from the arbitrary port name, and this ends up being
\\.\pipe\lrpc\\pipe\wine_plugplay for the plugplay service. It works,
but maybe it's not even supposed to.
I'll update the commit message and resend the series, reordered.
--
Rémi Bernon <rbernon(a)codeweavers.com>
Jan. 26, 2022
[PATCH] mf/tests: Add another format to Video Processor supported formats list.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mf/tests/mf.c | 1 +
include/mfapi.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index 8b3e0dd65b2..f628a1116e4 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -3382,6 +3382,7 @@ static BOOL is_supported_video_type(const GUID *guid)
|| IsEqualGUID(guid, &MFVideoFormat_IYUV)
|| IsEqualGUID(guid, &MFVideoFormat_YV12)
|| IsEqualGUID(guid, &MFVideoFormat_NV12)
+ || IsEqualGUID(guid, &MFVideoFormat_NV21)
|| IsEqualGUID(guid, &MFVideoFormat_420O)
|| IsEqualGUID(guid, &MFVideoFormat_P010)
|| IsEqualGUID(guid, &MFVideoFormat_P016)
diff --git a/include/mfapi.h b/include/mfapi.h
index 5b60833f529..d4493501624 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -109,6 +109,7 @@ DEFINE_MEDIATYPE_GUID(MFVideoFormat_MSS1, MAKEFOURCC('M','S','S','1'));
DEFINE_MEDIATYPE_GUID(MFVideoFormat_MSS2, MAKEFOURCC('M','S','S','2'));
DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV11, MAKEFOURCC('N','V','1','1'));
DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV12, MAKEFOURCC('N','V','1','2'));
+DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV21, MAKEFOURCC('N','V','2','1'));
DEFINE_MEDIATYPE_GUID(MFVideoFormat_ORAW, MAKEFOURCC('O','R','A','W'));
DEFINE_MEDIATYPE_GUID(MFVideoFormat_P010, MAKEFOURCC('P','0','1','0'));
DEFINE_MEDIATYPE_GUID(MFVideoFormat_P016, MAKEFOURCC('P','0','1','6'));
--
2.34.1
Jan. 26, 2022
[PATCH] mf: Move standard quality manager stub to a separate file.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/mf/Makefile.in | 1 +
dlls/mf/quality.c | 311 ++++++++++++++++++++++++++++++++++++++++++++
dlls/mf/session.c | 283 ----------------------------------------
3 files changed, 312 insertions(+), 283 deletions(-)
create mode 100644 dlls/mf/quality.c
diff --git a/dlls/mf/Makefile.in b/dlls/mf/Makefile.in
index 77d85ad041b..36727d4d4e3 100644
--- a/dlls/mf/Makefile.in
+++ b/dlls/mf/Makefile.in
@@ -10,6 +10,7 @@ C_SRCS = \
copier.c \
evr.c \
main.c \
+ quality.c \
samplegrabber.c \
sar.c \
session.c \
diff --git a/dlls/mf/quality.c b/dlls/mf/quality.c
new file mode 100644
index 00000000000..6c71a5a71c6
--- /dev/null
+++ b/dlls/mf/quality.c
@@ -0,0 +1,311 @@
+/*
+ * Copyright 2022 Nikolay Sivov for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "windef.h"
+#include "mf_private.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
+
+enum quality_manager_state
+{
+ QUALITY_MANAGER_READY = 0,
+ QUALITY_MANAGER_SHUT_DOWN,
+};
+
+struct quality_manager
+{
+ IMFQualityManager IMFQualityManager_iface;
+ IMFClockStateSink IMFClockStateSink_iface;
+ LONG refcount;
+
+ IMFTopology *topology;
+ IMFPresentationClock *clock;
+ unsigned int state;
+ CRITICAL_SECTION cs;
+};
+
+static struct quality_manager *impl_from_IMFQualityManager(IMFQualityManager *iface)
+{
+ return CONTAINING_RECORD(iface, struct quality_manager, IMFQualityManager_iface);
+}
+
+static struct quality_manager *impl_from_IMFClockStateSink(IMFClockStateSink *iface)
+{
+ return CONTAINING_RECORD(iface, struct quality_manager, IMFClockStateSink_iface);
+}
+
+static HRESULT WINAPI standard_quality_manager_QueryInterface(IMFQualityManager *iface, REFIID riid, void **out)
+{
+ struct quality_manager *manager = impl_from_IMFQualityManager(iface);
+
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out);
+
+ if (IsEqualIID(riid, &IID_IMFQualityManager) ||
+ IsEqualIID(riid, &IID_IUnknown))
+ {
+ *out = iface;
+ }
+ else if (IsEqualIID(riid, &IID_IMFClockStateSink))
+ {
+ *out = &manager->IMFClockStateSink_iface;
+ }
+ else
+ {
+ WARN("Unsupported %s.\n", debugstr_guid(riid));
+ *out = NULL;
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown *)*out);
+ return S_OK;
+}
+
+static ULONG WINAPI standard_quality_manager_AddRef(IMFQualityManager *iface)
+{
+ struct quality_manager *manager = impl_from_IMFQualityManager(iface);
+ ULONG refcount = InterlockedIncrement(&manager->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
+{
+ struct quality_manager *manager = impl_from_IMFQualityManager(iface);
+ ULONG refcount = InterlockedDecrement(&manager->refcount);
+
+ TRACE("%p, refcount %u.\n", iface, refcount);
+
+ if (!refcount)
+ {
+ if (manager->clock)
+ IMFPresentationClock_Release(manager->clock);
+ if (manager->topology)
+ IMFTopology_Release(manager->topology);
+ DeleteCriticalSection(&manager->cs);
+ free(manager);
+ }
+
+ return refcount;
+}
+
+static void standard_quality_manager_set_topology(struct quality_manager *manager, IMFTopology *topology)
+{
+ if (manager->topology)
+ IMFTopology_Release(manager->topology);
+ manager->topology = topology;
+ if (manager->topology)
+ IMFTopology_AddRef(manager->topology);
+}
+
+static HRESULT WINAPI standard_quality_manager_NotifyTopology(IMFQualityManager *iface, IMFTopology *topology)
+{
+ struct quality_manager *manager = impl_from_IMFQualityManager(iface);
+ HRESULT hr = S_OK;
+
+ TRACE("%p, %p.\n", iface, topology);
+
+ EnterCriticalSection(&manager->cs);
+ if (manager->state == QUALITY_MANAGER_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else
+ {
+ standard_quality_manager_set_topology(manager, topology);
+ }
+ LeaveCriticalSection(&manager->cs);
+
+ return hr;
+}
+
+static void standard_quality_manager_release_clock(struct quality_manager *manager)
+{
+ if (manager->clock)
+ {
+ IMFPresentationClock_RemoveClockStateSink(manager->clock, &manager->IMFClockStateSink_iface);
+ IMFPresentationClock_Release(manager->clock);
+ }
+ manager->clock = NULL;
+}
+
+static HRESULT WINAPI standard_quality_manager_NotifyPresentationClock(IMFQualityManager *iface,
+ IMFPresentationClock *clock)
+{
+ struct quality_manager *manager = impl_from_IMFQualityManager(iface);
+ HRESULT hr = S_OK;
+
+ TRACE("%p, %p.\n", iface, clock);
+
+ EnterCriticalSection(&manager->cs);
+ if (manager->state == QUALITY_MANAGER_SHUT_DOWN)
+ hr = MF_E_SHUTDOWN;
+ else if (!clock)
+ hr = E_POINTER;
+ else
+ {
+ standard_quality_manager_release_clock(manager);
+ manager->clock = clock;
+ IMFPresentationClock_AddRef(manager->clock);
+ if (FAILED(IMFPresentationClock_AddClockStateSink(manager->clock, &manager->IMFClockStateSink_iface)))
+ WARN("Failed to set state sink.\n");
+ }
+ LeaveCriticalSection(&manager->cs);
+
+ return hr;
+}
+
+static HRESULT WINAPI standard_quality_manager_NotifyProcessInput(IMFQualityManager *iface, IMFTopologyNode *node,
+ LONG input_index, IMFSample *sample)
+{
+ TRACE("%p, %p, %d, %p stub.\n", iface, node, input_index, sample);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI standard_quality_manager_NotifyProcessOutput(IMFQualityManager *iface, IMFTopologyNode *node,
+ LONG output_index, IMFSample *sample)
+{
+ TRACE("%p, %p, %d, %p stub.\n", iface, node, output_index, sample);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI standard_quality_manager_NotifyQualityEvent(IMFQualityManager *iface, IUnknown *object,
+ IMFMediaEvent *event)
+{
+ FIXME("%p, %p, %p stub.\n", iface, object, event);
+
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI standard_quality_manager_Shutdown(IMFQualityManager *iface)
+{
+ struct quality_manager *manager = impl_from_IMFQualityManager(iface);
+
+ TRACE("%p.\n", iface);
+
+ EnterCriticalSection(&manager->cs);
+ if (manager->state != QUALITY_MANAGER_SHUT_DOWN)
+ {
+ standard_quality_manager_release_clock(manager);
+ standard_quality_manager_set_topology(manager, NULL);
+ manager->state = QUALITY_MANAGER_SHUT_DOWN;
+ }
+ LeaveCriticalSection(&manager->cs);
+
+ return S_OK;
+}
+
+static const IMFQualityManagerVtbl standard_quality_manager_vtbl =
+{
+ standard_quality_manager_QueryInterface,
+ standard_quality_manager_AddRef,
+ standard_quality_manager_Release,
+ standard_quality_manager_NotifyTopology,
+ standard_quality_manager_NotifyPresentationClock,
+ standard_quality_manager_NotifyProcessInput,
+ standard_quality_manager_NotifyProcessOutput,
+ standard_quality_manager_NotifyQualityEvent,
+ standard_quality_manager_Shutdown,
+};
+
+static HRESULT WINAPI standard_quality_manager_sink_QueryInterface(IMFClockStateSink *iface,
+ REFIID riid, void **obj)
+{
+ struct quality_manager *manager = impl_from_IMFClockStateSink(iface);
+ return IMFQualityManager_QueryInterface(&manager->IMFQualityManager_iface, riid, obj);
+}
+
+static ULONG WINAPI standard_quality_manager_sink_AddRef(IMFClockStateSink *iface)
+{
+ struct quality_manager *manager = impl_from_IMFClockStateSink(iface);
+ return IMFQualityManager_AddRef(&manager->IMFQualityManager_iface);
+}
+
+static ULONG WINAPI standard_quality_manager_sink_Release(IMFClockStateSink *iface)
+{
+ struct quality_manager *manager = impl_from_IMFClockStateSink(iface);
+ return IMFQualityManager_Release(&manager->IMFQualityManager_iface);
+}
+
+static HRESULT WINAPI standard_quality_manager_sink_OnClockStart(IMFClockStateSink *iface,
+ MFTIME systime, LONGLONG offset)
+{
+ return S_OK;
+}
+
+static HRESULT WINAPI standard_quality_manager_sink_OnClockStop(IMFClockStateSink *iface,
+ MFTIME systime)
+{
+ return S_OK;
+}
+
+static HRESULT WINAPI standard_quality_manager_sink_OnClockPause(IMFClockStateSink *iface,
+ MFTIME systime)
+{
+ return S_OK;
+}
+
+static HRESULT WINAPI standard_quality_manager_sink_OnClockRestart(IMFClockStateSink *iface,
+ MFTIME systime)
+{
+ return S_OK;
+}
+
+static HRESULT WINAPI standard_quality_manager_sink_OnClockSetRate(IMFClockStateSink *iface,
+ MFTIME systime, float rate)
+{
+ return S_OK;
+}
+
+static const IMFClockStateSinkVtbl standard_quality_manager_sink_vtbl =
+{
+ standard_quality_manager_sink_QueryInterface,
+ standard_quality_manager_sink_AddRef,
+ standard_quality_manager_sink_Release,
+ standard_quality_manager_sink_OnClockStart,
+ standard_quality_manager_sink_OnClockStop,
+ standard_quality_manager_sink_OnClockPause,
+ standard_quality_manager_sink_OnClockRestart,
+ standard_quality_manager_sink_OnClockSetRate,
+};
+
+HRESULT WINAPI MFCreateStandardQualityManager(IMFQualityManager **manager)
+{
+ struct quality_manager *object;
+
+ TRACE("%p.\n", manager);
+
+ if (!(object = calloc(1, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ object->IMFQualityManager_iface.lpVtbl = &standard_quality_manager_vtbl;
+ object->IMFClockStateSink_iface.lpVtbl = &standard_quality_manager_sink_vtbl;
+ object->refcount = 1;
+ InitializeCriticalSection(&object->cs);
+
+ *manager = &object->IMFQualityManager_iface;
+
+ return S_OK;
+}
diff --git a/dlls/mf/session.c b/dlls/mf/session.c
index c8ec1b5c33f..c365495ee48 100644
--- a/dlls/mf/session.c
+++ b/dlls/mf/session.c
@@ -254,24 +254,6 @@ struct media_session
CRITICAL_SECTION cs;
};
-enum quality_manager_state
-{
- QUALITY_MANAGER_READY = 0,
- QUALITY_MANAGER_SHUT_DOWN,
-};
-
-struct quality_manager
-{
- IMFQualityManager IMFQualityManager_iface;
- IMFClockStateSink IMFClockStateSink_iface;
- LONG refcount;
-
- IMFTopology *topology;
- IMFPresentationClock *clock;
- unsigned int state;
- CRITICAL_SECTION cs;
-};
-
static inline struct media_session *impl_from_IMFMediaSession(IMFMediaSession *iface)
{
return CONTAINING_RECORD(iface, struct media_session, IMFMediaSession_iface);
@@ -317,16 +299,6 @@ static struct session_op *impl_op_from_IUnknown(IUnknown *iface)
return CONTAINING_RECORD(iface, struct session_op, IUnknown_iface);
}
-static struct quality_manager *impl_from_IMFQualityManager(IMFQualityManager *iface)
-{
- return CONTAINING_RECORD(iface, struct quality_manager, IMFQualityManager_iface);
-}
-
-static struct quality_manager *impl_from_qm_IMFClockStateSink(IMFClockStateSink *iface)
-{
- return CONTAINING_RECORD(iface, struct quality_manager, IMFClockStateSink_iface);
-}
-
static struct topo_node *impl_node_from_IMFVideoSampleAllocatorNotify(IMFVideoSampleAllocatorNotify *iface)
{
return CONTAINING_RECORD(iface, struct topo_node, u.sink.notify_cb);
@@ -3856,258 +3828,3 @@ failed:
IMFMediaSession_Release(&object->IMFMediaSession_iface);
return hr;
}
-
-static HRESULT WINAPI standard_quality_manager_QueryInterface(IMFQualityManager *iface, REFIID riid, void **out)
-{
- struct quality_manager *manager = impl_from_IMFQualityManager(iface);
-
- TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), out);
-
- if (IsEqualIID(riid, &IID_IMFQualityManager) ||
- IsEqualIID(riid, &IID_IUnknown))
- {
- *out = iface;
- }
- else if (IsEqualIID(riid, &IID_IMFClockStateSink))
- {
- *out = &manager->IMFClockStateSink_iface;
- }
- else
- {
- WARN("Unsupported %s.\n", debugstr_guid(riid));
- *out = NULL;
- return E_NOINTERFACE;
- }
-
- IUnknown_AddRef((IUnknown *)*out);
- return S_OK;
-}
-
-static ULONG WINAPI standard_quality_manager_AddRef(IMFQualityManager *iface)
-{
- struct quality_manager *manager = impl_from_IMFQualityManager(iface);
- ULONG refcount = InterlockedIncrement(&manager->refcount);
-
- TRACE("%p, refcount %u.\n", iface, refcount);
-
- return refcount;
-}
-
-static ULONG WINAPI standard_quality_manager_Release(IMFQualityManager *iface)
-{
- struct quality_manager *manager = impl_from_IMFQualityManager(iface);
- ULONG refcount = InterlockedDecrement(&manager->refcount);
-
- TRACE("%p, refcount %u.\n", iface, refcount);
-
- if (!refcount)
- {
- if (manager->clock)
- IMFPresentationClock_Release(manager->clock);
- if (manager->topology)
- IMFTopology_Release(manager->topology);
- DeleteCriticalSection(&manager->cs);
- free(manager);
- }
-
- return refcount;
-}
-
-static void standard_quality_manager_set_topology(struct quality_manager *manager, IMFTopology *topology)
-{
- if (manager->topology)
- IMFTopology_Release(manager->topology);
- manager->topology = topology;
- if (manager->topology)
- IMFTopology_AddRef(manager->topology);
-}
-
-static HRESULT WINAPI standard_quality_manager_NotifyTopology(IMFQualityManager *iface, IMFTopology *topology)
-{
- struct quality_manager *manager = impl_from_IMFQualityManager(iface);
- HRESULT hr = S_OK;
-
- TRACE("%p, %p.\n", iface, topology);
-
- EnterCriticalSection(&manager->cs);
- if (manager->state == QUALITY_MANAGER_SHUT_DOWN)
- hr = MF_E_SHUTDOWN;
- else
- {
- standard_quality_manager_set_topology(manager, topology);
- }
- LeaveCriticalSection(&manager->cs);
-
- return hr;
-}
-
-static void standard_quality_manager_release_clock(struct quality_manager *manager)
-{
- if (manager->clock)
- {
- IMFPresentationClock_RemoveClockStateSink(manager->clock, &manager->IMFClockStateSink_iface);
- IMFPresentationClock_Release(manager->clock);
- }
- manager->clock = NULL;
-}
-
-static HRESULT WINAPI standard_quality_manager_NotifyPresentationClock(IMFQualityManager *iface,
- IMFPresentationClock *clock)
-{
- struct quality_manager *manager = impl_from_IMFQualityManager(iface);
- HRESULT hr = S_OK;
-
- TRACE("%p, %p.\n", iface, clock);
-
- EnterCriticalSection(&manager->cs);
- if (manager->state == QUALITY_MANAGER_SHUT_DOWN)
- hr = MF_E_SHUTDOWN;
- else if (!clock)
- hr = E_POINTER;
- else
- {
- standard_quality_manager_release_clock(manager);
- manager->clock = clock;
- IMFPresentationClock_AddRef(manager->clock);
- if (FAILED(IMFPresentationClock_AddClockStateSink(manager->clock, &manager->IMFClockStateSink_iface)))
- WARN("Failed to set state sink.\n");
- }
- LeaveCriticalSection(&manager->cs);
-
- return hr;
-}
-
-static HRESULT WINAPI standard_quality_manager_NotifyProcessInput(IMFQualityManager *iface, IMFTopologyNode *node,
- LONG input_index, IMFSample *sample)
-{
- TRACE("%p, %p, %d, %p stub.\n", iface, node, input_index, sample);
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI standard_quality_manager_NotifyProcessOutput(IMFQualityManager *iface, IMFTopologyNode *node,
- LONG output_index, IMFSample *sample)
-{
- TRACE("%p, %p, %d, %p stub.\n", iface, node, output_index, sample);
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI standard_quality_manager_NotifyQualityEvent(IMFQualityManager *iface, IUnknown *object,
- IMFMediaEvent *event)
-{
- FIXME("%p, %p, %p stub.\n", iface, object, event);
-
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI standard_quality_manager_Shutdown(IMFQualityManager *iface)
-{
- struct quality_manager *manager = impl_from_IMFQualityManager(iface);
-
- TRACE("%p.\n", iface);
-
- EnterCriticalSection(&manager->cs);
- if (manager->state != QUALITY_MANAGER_SHUT_DOWN)
- {
- standard_quality_manager_release_clock(manager);
- standard_quality_manager_set_topology(manager, NULL);
- manager->state = QUALITY_MANAGER_SHUT_DOWN;
- }
- LeaveCriticalSection(&manager->cs);
-
- return S_OK;
-}
-
-static const IMFQualityManagerVtbl standard_quality_manager_vtbl =
-{
- standard_quality_manager_QueryInterface,
- standard_quality_manager_AddRef,
- standard_quality_manager_Release,
- standard_quality_manager_NotifyTopology,
- standard_quality_manager_NotifyPresentationClock,
- standard_quality_manager_NotifyProcessInput,
- standard_quality_manager_NotifyProcessOutput,
- standard_quality_manager_NotifyQualityEvent,
- standard_quality_manager_Shutdown,
-};
-
-static HRESULT WINAPI standard_quality_manager_sink_QueryInterface(IMFClockStateSink *iface,
- REFIID riid, void **obj)
-{
- struct quality_manager *manager = impl_from_qm_IMFClockStateSink(iface);
- return IMFQualityManager_QueryInterface(&manager->IMFQualityManager_iface, riid, obj);
-}
-
-static ULONG WINAPI standard_quality_manager_sink_AddRef(IMFClockStateSink *iface)
-{
- struct quality_manager *manager = impl_from_qm_IMFClockStateSink(iface);
- return IMFQualityManager_AddRef(&manager->IMFQualityManager_iface);
-}
-
-static ULONG WINAPI standard_quality_manager_sink_Release(IMFClockStateSink *iface)
-{
- struct quality_manager *manager = impl_from_qm_IMFClockStateSink(iface);
- return IMFQualityManager_Release(&manager->IMFQualityManager_iface);
-}
-
-static HRESULT WINAPI standard_quality_manager_sink_OnClockStart(IMFClockStateSink *iface,
- MFTIME systime, LONGLONG offset)
-{
- return S_OK;
-}
-
-static HRESULT WINAPI standard_quality_manager_sink_OnClockStop(IMFClockStateSink *iface,
- MFTIME systime)
-{
- return S_OK;
-}
-
-static HRESULT WINAPI standard_quality_manager_sink_OnClockPause(IMFClockStateSink *iface,
- MFTIME systime)
-{
- return S_OK;
-}
-
-static HRESULT WINAPI standard_quality_manager_sink_OnClockRestart(IMFClockStateSink *iface,
- MFTIME systime)
-{
- return S_OK;
-}
-
-static HRESULT WINAPI standard_quality_manager_sink_OnClockSetRate(IMFClockStateSink *iface,
- MFTIME systime, float rate)
-{
- return S_OK;
-}
-
-static const IMFClockStateSinkVtbl standard_quality_manager_sink_vtbl =
-{
- standard_quality_manager_sink_QueryInterface,
- standard_quality_manager_sink_AddRef,
- standard_quality_manager_sink_Release,
- standard_quality_manager_sink_OnClockStart,
- standard_quality_manager_sink_OnClockStop,
- standard_quality_manager_sink_OnClockPause,
- standard_quality_manager_sink_OnClockRestart,
- standard_quality_manager_sink_OnClockSetRate,
-};
-
-HRESULT WINAPI MFCreateStandardQualityManager(IMFQualityManager **manager)
-{
- struct quality_manager *object;
-
- TRACE("%p.\n", manager);
-
- if (!(object = calloc(1, sizeof(*object))))
- return E_OUTOFMEMORY;
-
- object->IMFQualityManager_iface.lpVtbl = &standard_quality_manager_vtbl;
- object->IMFClockStateSink_iface.lpVtbl = &standard_quality_manager_sink_vtbl;
- object->refcount = 1;
- InitializeCriticalSection(&object->cs);
-
- *manager = &object->IMFQualityManager_iface;
-
- return S_OK;
-}
--
2.34.1
Jan. 26, 2022