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
August 2018
- 62 participants
- 1399 messages
[PATCH vkd3d 05/14] libs/vkd3d-shader: Translate sincos instructions.
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/spirv.c | 68 ++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 65 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index a0f084cea366..21d6a1a33288 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -1427,12 +1427,29 @@ static void vkd3d_spirv_build_op_memory_barrier(struct vkd3d_spirv_builder *buil
SpvOpMemoryBarrier, memory_id, memory_semantics_id);
}
+static uint32_t vkd3d_spirv_build_op_glsl_std450_tr1(struct vkd3d_spirv_builder *builder,
+ enum GLSLstd450 op, uint32_t result_type, uint32_t operand)
+{
+ uint32_t id = vkd3d_spirv_get_glsl_std450_instr_set(builder);
+ return vkd3d_spirv_build_op_ext_inst(builder, result_type, id, op, &operand, 1);
+}
+
static uint32_t vkd3d_spirv_build_op_glsl_std450_fabs(struct vkd3d_spirv_builder *builder,
uint32_t result_type, uint32_t operand)
{
- uint32_t glsl_std450_id = vkd3d_spirv_get_glsl_std450_instr_set(builder);
- return vkd3d_spirv_build_op_ext_inst(builder, result_type, glsl_std450_id,
- GLSLstd450FAbs, &operand, 1);
+ return vkd3d_spirv_build_op_glsl_std450_tr1(builder, GLSLstd450FAbs, result_type, operand);
+}
+
+static uint32_t vkd3d_spirv_build_op_glsl_std450_sin(struct vkd3d_spirv_builder *builder,
+ uint32_t result_type, uint32_t operand)
+{
+ return vkd3d_spirv_build_op_glsl_std450_tr1(builder, GLSLstd450Sin, result_type, operand);
+}
+
+static uint32_t vkd3d_spirv_build_op_glsl_std450_cos(struct vkd3d_spirv_builder *builder,
+ uint32_t result_type, uint32_t operand)
+{
+ return vkd3d_spirv_build_op_glsl_std450_tr1(builder, GLSLstd450Cos, result_type, operand);
}
static uint32_t vkd3d_spirv_build_op_glsl_std450_nclamp(struct vkd3d_spirv_builder *builder,
@@ -4284,6 +4301,48 @@ static void vkd3d_dxbc_compiler_emit_rcp(struct vkd3d_dxbc_compiler *compiler,
vkd3d_dxbc_compiler_emit_store_dst(compiler, dst, val_id);
}
+static void vkd3d_dxbc_compiler_emit_sincos(struct vkd3d_dxbc_compiler *compiler,
+ const struct vkd3d_shader_instruction *instruction)
+{
+ const struct vkd3d_shader_dst_param *dst_sin = &instruction->dst[0];
+ const struct vkd3d_shader_dst_param *dst_cos = &instruction->dst[1];
+ struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
+ const struct vkd3d_shader_src_param *src = instruction->src;
+ uint32_t type_id, src_id, sin_id = 0, cos_id = 0;
+ unsigned int component_count;
+
+ if (dst_sin->reg.type != VKD3DSPR_NULL)
+ {
+ component_count = vkd3d_write_mask_component_count(dst_sin->write_mask);
+ type_id = vkd3d_spirv_get_type_id(builder,
+ vkd3d_component_type_from_data_type(dst_sin->reg.data_type), component_count);
+
+ src_id = vkd3d_dxbc_compiler_emit_load_src(compiler, src, dst_sin->write_mask);
+
+ sin_id = vkd3d_spirv_build_op_glsl_std450_sin(builder, type_id, src_id);
+ }
+
+ if (dst_cos->reg.type != VKD3DSPR_NULL)
+ {
+ if (dst_sin->reg.type == VKD3DSPR_NULL || dst_cos->write_mask != dst_sin->write_mask)
+ {
+ component_count = vkd3d_write_mask_component_count(dst_cos->write_mask);
+ type_id = vkd3d_spirv_get_type_id(builder,
+ vkd3d_component_type_from_data_type(dst_cos->reg.data_type), component_count);
+
+ src_id = vkd3d_dxbc_compiler_emit_load_src(compiler, src, dst_cos->write_mask);
+ }
+
+ cos_id = vkd3d_spirv_build_op_glsl_std450_cos(builder, type_id, src_id);
+ }
+
+ if (sin_id)
+ vkd3d_dxbc_compiler_emit_store_dst(compiler, dst_sin, sin_id);
+
+ if (cos_id)
+ vkd3d_dxbc_compiler_emit_store_dst(compiler, dst_cos, cos_id);
+}
+
static void vkd3d_dxbc_compiler_emit_imul(struct vkd3d_dxbc_compiler *compiler,
const struct vkd3d_shader_instruction *instruction)
{
@@ -5951,6 +6010,9 @@ void vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler
case VKD3DSIH_RCP:
vkd3d_dxbc_compiler_emit_rcp(compiler, instruction);
break;
+ case VKD3DSIH_SINCOS:
+ vkd3d_dxbc_compiler_emit_sincos(compiler, instruction);
+ break;
case VKD3DSIH_IMUL:
vkd3d_dxbc_compiler_emit_imul(compiler, instruction);
break;
--
2.16.4
Aug. 1, 2018
[PATCH vkd3d 04/14] tests: Add test for round_ne instruction.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
tests/d3d12.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 608ff68c3af2..83ec6c83b6b4 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -5540,6 +5540,24 @@ static void test_shader_instructions(void)
0x00000000, 0x00000000, 0x05000036, 0x00102082, 0x00000000, 0x00004001, 0x00000000, 0x0100003e,
};
static const D3D12_SHADER_BYTECODE ps_round = {ps_round_code, sizeof(ps_round_code)};
+ static const DWORD ps_round_ne_code[] =
+ {
+#if 0
+ float4 src0;
+
+ void main(out float4 dst : SV_Target)
+ {
+ dst = round(src0);
+ }
+#endif
+ 0x43425844, 0xa2be1ad3, 0xf1389007, 0xc8221829, 0xcbef8ed0, 0x00000001, 0x000000bc, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
+ 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000044, 0x00000050, 0x00000011,
+ 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000,
+ 0x06000040, 0x001020f2, 0x00000000, 0x00208e46, 0x00000000, 0x00000000, 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE ps_round_ne = {ps_round_ne_code, sizeof(ps_round_ne_code)};
static const DWORD ps_frc_code[] =
{
#if 0
@@ -6427,6 +6445,16 @@ static void test_shader_instructions(void)
{&ps_round, {{ INFINITY}}, {{ INFINITY, INFINITY, INFINITY}}},
{&ps_round, {{-INFINITY}}, {{-INFINITY, -INFINITY, -INFINITY}}},
+ {&ps_round_ne, {{ 0.0f, -0.0f, 0.5f, -0.5f}}, {{ 0.0f, -0.0f, 0.0f, -0.0f}}},
+ {&ps_round_ne, {{ 2.0f, 3.0f, 4.0f, 5.0f}}, {{ 2.0f, 3.0f, 4.0f, 5.0f}}},
+ {&ps_round_ne, {{ 2.4f, 3.4f, 4.4f, 5.4f}}, {{ 2.0f, 3.0f, 4.0f, 5.0f}}},
+ {&ps_round_ne, {{ 2.5f, 3.5f, 4.5f, 5.5f}}, {{ 2.0f, 4.0f, 4.0f, 6.0f}}},
+ {&ps_round_ne, {{ 2.6f, 3.6f, 4.6f, 5.6f}}, {{ 3.0f, 4.0f, 5.0f, 6.0f}}},
+ {&ps_round_ne, {{-2.5f, -3.5f, -4.5f, -5.5f}}, {{-2.0f, -4.0f, -4.0f, -6.0f}}},
+ {&ps_round_ne, {{-2.4f, -3.4f, -4.4f, -5.4f}}, {{-2.0f, -3.0f, -4.0f, -5.0f}}},
+ {&ps_round_ne, {{ INFINITY}}, {{ INFINITY}}},
+ {&ps_round_ne, {{-INFINITY}}, {{-INFINITY}}},
+
{&ps_frc, {{ 0.0f}}, {{0.0f, 0.0f}}},
{&ps_frc, {{-0.0f}}, {{0.0f, 0.0f}}},
{&ps_frc, {{ 1.0f}}, {{0.0f, 0.0f}}},
--
2.16.4
Aug. 1, 2018
[PATCH vkd3d 03/14] libs/vkd3d-shader: Translate round_ne instructions.
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/spirv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index d236db9dc23c..a0f084cea366 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -4063,6 +4063,7 @@ static enum GLSLstd450 vkd3d_dxbc_compiler_map_ext_glsl_instruction(
{VKD3DSIH_MAD, GLSLstd450Fma},
{VKD3DSIH_MAX, GLSLstd450NMax},
{VKD3DSIH_MIN, GLSLstd450NMin},
+ {VKD3DSIH_ROUND_NE, GLSLstd450RoundEven},
{VKD3DSIH_ROUND_NI, GLSLstd450Floor},
{VKD3DSIH_ROUND_PI, GLSLstd450Ceil},
{VKD3DSIH_ROUND_Z, GLSLstd450Trunc},
@@ -5932,6 +5933,7 @@ void vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler
case VKD3DSIH_MAD:
case VKD3DSIH_MAX:
case VKD3DSIH_MIN:
+ case VKD3DSIH_ROUND_NE:
case VKD3DSIH_ROUND_NI:
case VKD3DSIH_ROUND_PI:
case VKD3DSIH_ROUND_Z:
--
2.16.4
Aug. 1, 2018
[PATCH vkd3d 02/14] libs/vkd3d: Add support for more formats.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d/utils.c | 103 ++++++++++++++++++++++++++++-------------------------
1 file changed, 54 insertions(+), 49 deletions(-)
diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c
index 87688f7752ad..98b764a169d1 100644
--- a/libs/vkd3d/utils.c
+++ b/libs/vkd3d/utils.c
@@ -24,55 +24,60 @@
#define DEPTH_STENCIL (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)
static const struct vkd3d_format vkd3d_formats[] =
{
- {DXGI_FORMAT_R32G32B32A32_FLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, 16, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT, 16, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_SINT, 16, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R32G32B32_FLOAT, VK_FORMAT_R32G32B32_SFLOAT, 12, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R32G32_FLOAT, VK_FORMAT_R32G32_SFLOAT, 8, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R16G16B16A16_FLOAT, VK_FORMAT_R16G16B16A16_SFLOAT, 8, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UINT, 8, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R10G10B10A2_UNORM, VK_FORMAT_A2B10G10R10_UNORM_PACK32, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R11G11B10_FLOAT, VK_FORMAT_B10G11R11_UFLOAT_PACK32, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R8G8B8A8_TYPELESS, VK_FORMAT_R8G8B8A8_UNORM, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, VK_FORMAT_R8G8B8A8_SRGB, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R16G16_FLOAT, VK_FORMAT_R16G16_SFLOAT, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R16G16_UNORM, VK_FORMAT_R16G16_UNORM, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R32_TYPELESS, VK_FORMAT_R32_UINT, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_D32_FLOAT, VK_FORMAT_D32_SFLOAT, 4, 1, 1, 1, DEPTH},
- {DXGI_FORMAT_R32_FLOAT, VK_FORMAT_R32_SFLOAT, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R32_UINT, VK_FORMAT_R32_UINT, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R32_SINT, VK_FORMAT_R32_SINT, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R16_TYPELESS, VK_FORMAT_R16_UINT, 2, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R16_FLOAT, VK_FORMAT_R16_SFLOAT, 2, 1, 1, 1, COLOR},
- {DXGI_FORMAT_D16_UNORM, VK_FORMAT_D16_UNORM, 2, 1, 1, 1, DEPTH},
- {DXGI_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, 2, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, 1, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R8_UINT, VK_FORMAT_R8_UINT, 1, 1, 1, 1, COLOR},
- {DXGI_FORMAT_R8_SNORM, VK_FORMAT_R8_SNORM, 1, 1, 1, 1, COLOR},
- {DXGI_FORMAT_A8_UNORM, VK_FORMAT_R8_UNORM, 1, 1, 1, 1, COLOR},
- {DXGI_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_UNORM, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_B8G8R8A8_TYPELESS, VK_FORMAT_B8G8R8A8_UNORM, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, VK_FORMAT_B8G8R8A8_SRGB, 4, 1, 1, 1, COLOR},
- {DXGI_FORMAT_BC1_TYPELESS, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
- {DXGI_FORMAT_BC1_UNORM, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
- {DXGI_FORMAT_BC1_UNORM_SRGB, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, 1, 4, 4, 8, COLOR},
- {DXGI_FORMAT_BC2_TYPELESS, VK_FORMAT_BC2_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC2_UNORM, VK_FORMAT_BC2_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC2_UNORM_SRGB, VK_FORMAT_BC2_SRGB_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC3_TYPELESS, VK_FORMAT_BC3_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC3_UNORM, VK_FORMAT_BC3_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC3_UNORM_SRGB, VK_FORMAT_BC3_SRGB_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC4_TYPELESS, VK_FORMAT_BC4_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
- {DXGI_FORMAT_BC4_UNORM, VK_FORMAT_BC4_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
- {DXGI_FORMAT_BC4_SNORM, VK_FORMAT_BC4_SNORM_BLOCK, 1, 4, 4, 8, COLOR},
- {DXGI_FORMAT_BC5_TYPELESS, VK_FORMAT_BC5_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC5_UNORM, VK_FORMAT_BC5_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC5_SNORM, VK_FORMAT_BC5_SNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC6H_UF16, VK_FORMAT_BC6H_UFLOAT_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC6H_SF16, VK_FORMAT_BC6H_SFLOAT_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC7_UNORM, VK_FORMAT_BC7_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
- {DXGI_FORMAT_BC7_UNORM_SRGB, VK_FORMAT_BC7_SRGB_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_R32G32B32A32_TYPELESS, VK_FORMAT_R32G32B32A32_SFLOAT, 16, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32G32B32A32_FLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, 16, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT, 16, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_SINT, 16, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32G32B32_FLOAT, VK_FORMAT_R32G32B32_SFLOAT, 12, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32G32_FLOAT, VK_FORMAT_R32G32_SFLOAT, 8, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16G16B16A16_TYPELESS, VK_FORMAT_R16G16B16A16_SFLOAT, 8, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16G16B16A16_FLOAT, VK_FORMAT_R16G16B16A16_SFLOAT, 8, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UINT, 8, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R10G10B10A2_UNORM, VK_FORMAT_A2B10G10R10_UNORM_PACK32, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R11G11B10_FLOAT, VK_FORMAT_B10G11R11_UFLOAT_PACK32, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8G8_UNORM, VK_FORMAT_R8G8_UNORM, 2, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8G8B8A8_TYPELESS, VK_FORMAT_R8G8B8A8_UNORM, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, VK_FORMAT_R8G8B8A8_SRGB, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UINT, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16G16_TYPELESS, VK_FORMAT_R16G16_SFLOAT, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16G16_FLOAT, VK_FORMAT_R16G16_SFLOAT, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16G16_UNORM, VK_FORMAT_R16G16_UNORM, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32_TYPELESS, VK_FORMAT_R32_UINT, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_D32_FLOAT, VK_FORMAT_D32_SFLOAT, 4, 1, 1, 1, DEPTH},
+ {DXGI_FORMAT_R32_FLOAT, VK_FORMAT_R32_SFLOAT, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32_UINT, VK_FORMAT_R32_UINT, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R32_SINT, VK_FORMAT_R32_SINT, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16_TYPELESS, VK_FORMAT_R16_UINT, 2, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R16_FLOAT, VK_FORMAT_R16_SFLOAT, 2, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_D16_UNORM, VK_FORMAT_D16_UNORM, 2, 1, 1, 1, DEPTH},
+ {DXGI_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, 2, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, 1, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8_UINT, VK_FORMAT_R8_UINT, 1, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_R8_SNORM, VK_FORMAT_R8_SNORM, 1, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_A8_UNORM, VK_FORMAT_R8_UNORM, 1, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_UNORM, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_B8G8R8A8_TYPELESS, VK_FORMAT_B8G8R8A8_UNORM, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, VK_FORMAT_B8G8R8A8_SRGB, 4, 1, 1, 1, COLOR},
+ {DXGI_FORMAT_BC1_TYPELESS, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
+ {DXGI_FORMAT_BC1_UNORM, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
+ {DXGI_FORMAT_BC1_UNORM_SRGB, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, 1, 4, 4, 8, COLOR},
+ {DXGI_FORMAT_BC2_TYPELESS, VK_FORMAT_BC2_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC2_UNORM, VK_FORMAT_BC2_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC2_UNORM_SRGB, VK_FORMAT_BC2_SRGB_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC3_TYPELESS, VK_FORMAT_BC3_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC3_UNORM, VK_FORMAT_BC3_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC3_UNORM_SRGB, VK_FORMAT_BC3_SRGB_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC4_TYPELESS, VK_FORMAT_BC4_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
+ {DXGI_FORMAT_BC4_UNORM, VK_FORMAT_BC4_UNORM_BLOCK, 1, 4, 4, 8, COLOR},
+ {DXGI_FORMAT_BC4_SNORM, VK_FORMAT_BC4_SNORM_BLOCK, 1, 4, 4, 8, COLOR},
+ {DXGI_FORMAT_BC5_TYPELESS, VK_FORMAT_BC5_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC5_UNORM, VK_FORMAT_BC5_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC5_SNORM, VK_FORMAT_BC5_SNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC6H_UF16, VK_FORMAT_BC6H_UFLOAT_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC6H_SF16, VK_FORMAT_BC6H_SFLOAT_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC7_UNORM, VK_FORMAT_BC7_UNORM_BLOCK, 1, 4, 4, 16, COLOR},
+ {DXGI_FORMAT_BC7_UNORM_SRGB, VK_FORMAT_BC7_SRGB_BLOCK, 1, 4, 4, 16, COLOR},
};
/* Each depth/stencil format is only compatible with itself in Vulkan. */
--
2.16.4
Aug. 1, 2018
[PATCH v2 vkd3d 01/14] tests: Add test for creating heaps.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
Version 2: Use "line" in ok() calls.
---
tests/d3d12.c | 173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 173 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 83dc8f903c81..608ff68c3af2 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -157,6 +157,53 @@ static void check_interface_(unsigned int line, IUnknown *iface, REFIID riid, bo
IUnknown_Release(unk);
}
+#define check_heap_properties(a, b) check_heap_properties_(__LINE__, a, b)
+static void check_heap_properties_(unsigned int line,
+ const D3D12_HEAP_PROPERTIES *properties, const D3D12_HEAP_PROPERTIES *expected_properties)
+{
+ D3D12_HEAP_PROPERTIES expected = *expected_properties;
+
+ if (!expected.CreationNodeMask)
+ expected.CreationNodeMask = 0x1;
+ if (!expected.VisibleNodeMask)
+ expected.VisibleNodeMask = 0x1;
+
+ ok_(line)(properties->Type == expected.Type,
+ "Got type %#x, expected %#x.\n", properties->Type, expected.Type);
+ ok_(line)(properties->CPUPageProperty == expected.CPUPageProperty,
+ "Got CPU page properties %#x, expected %#x.\n",
+ properties->CPUPageProperty, expected.CPUPageProperty);
+ ok_(line)(properties->MemoryPoolPreference == expected.MemoryPoolPreference,
+ "Got memory pool %#x, expected %#x.\n",
+ properties->MemoryPoolPreference, expected.MemoryPoolPreference);
+ ok_(line)(properties->CreationNodeMask == expected.CreationNodeMask,
+ "Got creation node mask %#x, expected %#x.\n",
+ properties->CreationNodeMask, expected.CreationNodeMask);
+ ok_(line)(properties->VisibleNodeMask == expected.VisibleNodeMask,
+ "Got visible node mask %#x, expected %#x.\n",
+ properties->VisibleNodeMask, expected.VisibleNodeMask);
+}
+
+#define check_heap_desc(a, b) check_heap_desc_(__LINE__, a, b)
+static void check_heap_desc_(unsigned int line, const D3D12_HEAP_DESC *desc,
+ const D3D12_HEAP_DESC *expected_desc)
+{
+ D3D12_HEAP_DESC expected = *expected_desc;
+
+ if (!expected.Alignment)
+ expected.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
+
+ ok_(line)(desc->SizeInBytes == expected.SizeInBytes,
+ "Got size %"PRIu64", expected %"PRIu64".\n",
+ desc->SizeInBytes, expected.SizeInBytes);
+ check_heap_properties_(line, &desc->Properties, &expected.Properties);
+ ok_(line)(desc->Alignment == expected.Alignment,
+ "Got alignment %"PRIu64", expected %"PRIu64".\n",
+ desc->Alignment, expected.Alignment);
+ ok_(line)(desc->Flags == expected.Flags,
+ "Got flags %#x, expected %#x.\n", desc->Flags, expected.Flags);
+}
+
static void uav_barrier(ID3D12GraphicsCommandList *list, ID3D12Resource *resource)
{
D3D12_RESOURCE_BARRIER barrier;
@@ -1731,6 +1778,131 @@ static void test_create_committed_resource(void)
ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
}
+static void test_create_heap(void)
+{
+ D3D12_FEATURE_DATA_D3D12_OPTIONS options;
+ D3D12_HEAP_DESC desc, result_desc;
+ ID3D12Device *device, *tmp_device;
+ unsigned int i, j;
+ ID3D12Heap *heap;
+ ULONG refcount;
+ HRESULT hr;
+
+ static const struct
+ {
+ UINT64 alignment;
+ HRESULT expected_hr;
+ }
+ tests[] =
+ {
+ {D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT, S_OK},
+ {D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT, S_OK},
+ {2 * D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT, E_INVALIDARG},
+ {2 * D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT, E_INVALIDARG},
+ {D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT, E_INVALIDARG},
+ };
+ static const struct
+ {
+ D3D12_HEAP_FLAGS flags;
+ const char *name;
+ }
+ heap_flags[] =
+ {
+ {D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS, "buffers"},
+ {D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES, "textures"},
+ {D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES, "rt_ds_textures"},
+ };
+
+ if (!(device = create_device()))
+ {
+ skip("Failed to create device.\n");
+ return;
+ }
+
+ desc.SizeInBytes = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
+ memset(&desc.Properties, 0, sizeof(desc.Properties));
+ desc.Properties.Type = D3D12_HEAP_TYPE_DEFAULT;
+ desc.Alignment = 0;
+ desc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES;
+ hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap);
+ ok(hr == S_OK, "Failed to create heap, hr %#x.\n", hr);
+
+ refcount = get_refcount(device);
+ ok(refcount == 2, "Got unexpected refcount %u.\n", (unsigned int)refcount);
+ hr = ID3D12Heap_GetDevice(heap, &IID_ID3D12Device, (void **)&tmp_device);
+ ok(hr == S_OK, "Failed to get device, hr %#x.\n", hr);
+ refcount = get_refcount(device);
+ ok(refcount == 3, "Got unexpected refcount %u.\n", (unsigned int)refcount);
+ refcount = ID3D12Device_Release(tmp_device);
+ ok(refcount == 2, "Got unexpected refcount %u.\n", (unsigned int)refcount);
+
+ check_interface(heap, &IID_ID3D12Object, TRUE);
+ check_interface(heap, &IID_ID3D12DeviceChild, TRUE);
+ check_interface(heap, &IID_ID3D12Pageable, TRUE);
+ check_interface(heap, &IID_ID3D12Heap, TRUE);
+
+ result_desc = ID3D12Heap_GetDesc(heap);
+ check_heap_desc(&result_desc, &desc);
+
+ refcount = ID3D12Heap_Release(heap);
+ ok(!refcount, "ID3D12Heap has %u references left.\n", (unsigned int)refcount);
+
+ desc.SizeInBytes = 0;
+ hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+
+ desc.SizeInBytes = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
+ desc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES | D3D12_HEAP_FLAG_ALLOW_DISPLAY;
+ hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+ desc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES | D3D12_HEAP_FLAG_ALLOW_DISPLAY;
+ hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap);
+ ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ for (j = 0; j < ARRAY_SIZE(heap_flags); ++j)
+ {
+ desc.SizeInBytes = 10 * tests[i].alignment;
+ desc.Alignment = tests[i].alignment;
+ desc.Flags = heap_flags[j].flags;
+ hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap);
+ ok(hr == tests[i].expected_hr, "Test %u, %s: Got hr %#x, expected %#x.\n",
+ i, heap_flags[j].name, hr, tests[i].expected_hr);
+ if (FAILED(hr))
+ continue;
+
+ result_desc = ID3D12Heap_GetDesc(heap);
+ check_heap_desc(&result_desc, &desc);
+
+ refcount = ID3D12Heap_Release(heap);
+ ok(!refcount, "ID3D12Heap has %u references left.\n", (unsigned int)refcount);
+ }
+ }
+
+ hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options));
+ ok(hr == S_OK, "Failed to check feature support, hr %#x.\n", hr);
+ if (options.ResourceHeapTier < D3D12_RESOURCE_HEAP_TIER_2)
+ {
+ skip("Resource heap tier %u.\n", options.ResourceHeapTier);
+ goto done;
+ }
+
+ desc.SizeInBytes = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
+ desc.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT;
+ desc.Flags = D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES;
+ hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap);
+ ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
+ result_desc = ID3D12Heap_GetDesc(heap);
+ check_heap_desc(&result_desc, &desc);
+ refcount = ID3D12Heap_Release(heap);
+ ok(!refcount, "ID3D12Heap has %u references left.\n", (unsigned int)refcount);
+
+done:
+ refcount = ID3D12Device_Release(device);
+ ok(!refcount, "ID3D12Device has %u references left.\n", (unsigned int)refcount);
+}
+
static void test_create_descriptor_heap(void)
{
D3D12_DESCRIPTOR_HEAP_DESC heap_desc;
@@ -17652,6 +17824,7 @@ START_TEST(d3d12)
run_test(test_create_command_list);
run_test(test_create_command_queue);
run_test(test_create_committed_resource);
+ run_test(test_create_heap);
run_test(test_create_descriptor_heap);
run_test(test_create_sampler);
run_test(test_create_unordered_access_view);
--
2.16.4
Aug. 1, 2018
Re: [PATCH 11/13 v2] msvcp90: Add implementation of _Concurrent_vector_Internal_compact.
by Piotr Caban
Hi Hua,
On 07/31/18 17:18, Hua Meng wrote:
> @@ -1997,12 +2004,40 @@ MSVCP_size_t __thiscall _Concurrent_vector_base_v4__Internal_clear(
> /* ?_Internal_compact(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAPEAX_KPEAXP6AX10(a)ZP6AX1PEBX0@Z(a)Z */
> DEFINE_THISCALL_WRAPPER(_Concurrent_vector_base_v4__Internal_compact, 20)
> void * __thiscall _Concurrent_vector_base_v4__Internal_compact(
> - _Concurrent_vector_base_v4 *this, MSVCP_size_t len, void *v,
> + _Concurrent_vector_base_v4 *this, MSVCP_size_t element_size, void *v,
> void (__cdecl *clear)(void*, MSVCP_size_t),
> void (__cdecl *copy)(void*, const void*, MSVCP_size_t))
> {
> - FIXME("(%p %ld %p %p %p) stub\n", this, len, v, clear, copy);
> - return NULL;
> + compact_block *b;
> + MSVCP_size_t size, seg_no, copy_element, clear_element;
> + int i;
> +
> + TRACE("(%p %ld %p %p %p)\n", this, element_size, v, clear, copy);
> +
> + size = this->early_size;
> + seg_no = _vector_base_v4__Segment_index_of(size - 1);
It will not work if size==0.
> + if(this->first_block == seg_no + 1) return v;
The vector still needs to be compacted when there is unused space
allocated. You should compare this->first_block with index of last
allocated segment. The function is also returning NULL in this case.
Thanks,
Piotr
Aug. 1, 2018
Re: [PATCH 04/13 v2] msvcp90: Add implementaion of _Concurrent_vector_Internal_reserve.
by Piotr Caban
Hi Hua,
On 07/31/18 17:16, Hua Meng wrote:
> +/* ?_Internal_reserve(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEXIII(a)Z */
> +/* ?_Internal_reserve(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAX_K00(a)Z */
> +DEFINE_THISCALL_WRAPPER(_Concurrent_vector_base_v4__Internal_reserve, 16)
> +void __thiscall _Concurrent_vector_base_v4__Internal_reserve(
> + _Concurrent_vector_base_v4 *this, MSVCP_size_t size,
> + MSVCP_size_t element_size, MSVCP_size_t max_size)
> +{
> + MSVCP_size_t block_idx, capacity;
> + int i;
> + void **new_segment;
> +
> + TRACE("(%p %ld %ld %ld)\n", this, size, element_size, max_size);
> +
> + if(size > max_size) _vector_base_v4__Internal_throw_exception(this, 0);
> + capacity = _Concurrent_vector_base_v4__Internal_capacity(this);
> + if(size <= capacity) return;
> + block_idx = _vector_base_v4__Segment_index_of(size - 1);
> + if(!this->first_block)
> + InterlockedCompareExchangeSizeT(&this->first_block, block_idx + 1, 0);
> + i = _vector_base_v4__Segment_index_of(capacity);
> + if(this->storage == this->segment) {
> + for(; i <= block_idx && i < STORAGE_SIZE; i++)
> + concurrent_vector_alloc_segment(this, i, element_size);
> + if(block_idx >= STORAGE_SIZE) {
> + new_segment = malloc(SEGMENT_SIZE * sizeof(void*));
> + if(new_segment == NULL) _vector_base_v4__Internal_throw_exception(this, 2);
> + memset(new_segment, 0, SEGMENT_SIZE * sizeof(void*));
Please change it to:
memset(new_segment, 0, SEGMENT_SIZE * sizeof(*new_segment));
> + memcpy(new_segment, this->storage, STORAGE_SIZE * element_size);
Copied data size is wrong here. There should be:
memcpy(new_segment, this->storage, STORAGE_SIZE * sizeof(*new_segment));
> + if(InterlockedCompareExchangePointer((void*)&this->segment, new_segment,
> + this->storage) != this->storage)
> + free(new_segment);
> + }
> + }
> + for(; i <= block_idx; i++)
> + concurrent_vector_alloc_segment(this, i, element_size);
> +}
Thanks,
Piotr
Aug. 1, 2018
Re: [PATCH] kernel32: Set environment variable %PUBLIC% on the process start-up.
by Alistair Leslie-Hughes
Hi Dmitry,
On 01/08/18 13:12, Dmitry Timoshkov wrote:
>
> Yes, I'm aware of that difference. However since Wine already has the code
> path to set ALLUSERSPROFILE=C:\Users\Public I decided to reuse it path to
> set PUBLIC=C:\Users\Public. Changing ALLUSERSPROFILE to point to another
> place is not the subject of my patch.
>
Thanks. In other words, a bug with ALLUSERSPROFILE ;)
Alistair.
Aug. 1, 2018
Re: [PATCH] kernel32: Set environment variable %PUBLIC% on the process start-up.
by Dmitry Timoshkov
Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> wrote:
> > This patch fixes an installer that has "[%PUBLIC]\Documents" entry
> > for some of the targets being copied from a cabinet file. Under
> > Windows %PUBLIC% environment variable is set to C:\Users\Public.
>
> On windows, these are set to different values.
>
> ALLUSERSPROFILE=C:\ProgramData
>
> PUBLIC=C:\Users\Public
>
>
> Why have you made them the same?
Yes, I'm aware of that difference. However since Wine already has the code
path to set ALLUSERSPROFILE=C:\Users\Public I decided to reuse it path to
set PUBLIC=C:\Users\Public. Changing ALLUSERSPROFILE to point to another
place is not the subject of my patch.
--
Dmitry.
Aug. 1, 2018