Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wine/vkd3d
  • stefan/vkd3d
  • cmccarthy/vkd3d
  • giomasce/vkd3d
  • fcasas/vkd3d
  • jactry/vkd3d
  • ReDress/vkd3d
  • mstorsjo/vkd3d
  • huw/vkd3d
  • julliard/vkd3d
  • bshanks/vkd3d
  • zfigura/vkd3d
  • hverbeet/vkd3d
  • DarkShadow44/vkd3d
  • nsivov/vkd3d
  • dhary686/vkd3d
  • Mystral/vkd3d
  • maljaf/vkd3d
  • smcv/vkd3d
  • flibitijibibo/vkd3d
  • q4a/vkd3d
  • jsikorski/vkd3d
  • alesliehughes/vkd3d-alesliehughes
  • vitorhnn/vkd3d
  • agusev/vkd3d
  • etang-cw/vkd3d
  • petrathekat/vkd3d
  • simon.mr995/vkd3d
  • sgwaki/vkd3d
  • jacek/vkd3d
  • fweimer/vkd3d
  • Clara/vkd3d
  • disini/vkd3d
  • antenabr2/vkd3d
  • gilvbp/vkd3d
  • yshui/vkd3d
  • shaunren/vkd3d
  • jennetsaryyewa96/vkd3d
  • Jamesattay/vkd3d
  • zacemmneeto77/vkd3d
  • GermanAizek/vkd3d
  • opespinach/vkd3d
  • ruslanboyka201/vkd3d
  • navi/vkd3d
  • Feifan/vkd3d
  • yashmhmdly172/vkd3d
  • Sec32fun32/vkd3d
  • ritalat/vkd3d
  • ivyl/vkd3d
  • baikaishiuc/vkd3d
  • austin987/vkd3d
  • TornadoCookie/vkd3d
52 results
Show changes
Commits on Source (4)
......@@ -7301,7 +7301,6 @@ static SpvOp spirv_compiler_map_alu_instruction(const struct vkd3d_shader_instru
{VKD3DSIH_DDIV, SpvOpFDiv},
{VKD3DSIH_DIV, SpvOpFDiv},
{VKD3DSIH_DMUL, SpvOpFMul},
{VKD3DSIH_DTOF, SpvOpFConvert},
{VKD3DSIH_DTOI, SpvOpConvertFToS},
{VKD3DSIH_DTOU, SpvOpConvertFToU},
{VKD3DSIH_FREM, SpvOpFRem},
......@@ -7939,6 +7938,7 @@ static void spirv_compiler_emit_ftoi(struct spirv_compiler *compiler,
uint32_t src_type_id, dst_type_id, condition_type_id;
enum vkd3d_shader_component_type component_type;
unsigned int component_count;
uint32_t write_mask;
VKD3D_ASSERT(instruction->dst_count == 1);
VKD3D_ASSERT(instruction->src_count == 1);
......@@ -7948,21 +7948,23 @@ static void spirv_compiler_emit_ftoi(struct spirv_compiler *compiler,
* and for NaN to yield zero. */
component_count = vsir_write_mask_component_count(dst->write_mask);
src_type_id = spirv_compiler_get_type_id_for_reg(compiler, &src->reg, dst->write_mask);
dst_type_id = spirv_compiler_get_type_id_for_dst(compiler, dst);
src_id = spirv_compiler_emit_load_src(compiler, src, dst->write_mask);
if (src->reg.data_type == VKD3D_DATA_DOUBLE)
{
write_mask = vkd3d_write_mask_from_component_count(component_count);
int_min_id = spirv_compiler_get_constant_double_vector(compiler, -2147483648.0, component_count);
float_max_id = spirv_compiler_get_constant_double_vector(compiler, 2147483648.0, component_count);
}
else
{
write_mask = dst->write_mask;
int_min_id = spirv_compiler_get_constant_float_vector(compiler, -2147483648.0f, component_count);
float_max_id = spirv_compiler_get_constant_float_vector(compiler, 2147483648.0f, component_count);
}
src_type_id = spirv_compiler_get_type_id_for_reg(compiler, &src->reg, write_mask);
dst_type_id = spirv_compiler_get_type_id_for_dst(compiler, dst);
src_id = spirv_compiler_emit_load_src(compiler, src, write_mask);
val_id = vkd3d_spirv_build_op_glsl_std450_max(builder, src_type_id, src_id, int_min_id);
/* VSIR allows the destination of a signed conversion to be unsigned. */
......@@ -7992,6 +7994,7 @@ static void spirv_compiler_emit_ftou(struct spirv_compiler *compiler,
const struct vkd3d_shader_src_param *src = instruction->src;
uint32_t src_type_id, dst_type_id, condition_type_id;
unsigned int component_count;
uint32_t write_mask;
VKD3D_ASSERT(instruction->dst_count == 1);
VKD3D_ASSERT(instruction->src_count == 1);
......@@ -8001,21 +8004,23 @@ static void spirv_compiler_emit_ftou(struct spirv_compiler *compiler,
* and for NaN to yield zero. */
component_count = vsir_write_mask_component_count(dst->write_mask);
src_type_id = spirv_compiler_get_type_id_for_reg(compiler, &src->reg, dst->write_mask);
dst_type_id = spirv_compiler_get_type_id_for_dst(compiler, dst);
src_id = spirv_compiler_emit_load_src(compiler, src, dst->write_mask);
if (src->reg.data_type == VKD3D_DATA_DOUBLE)
{
write_mask = vkd3d_write_mask_from_component_count(component_count);
zero_id = spirv_compiler_get_constant_double_vector(compiler, 0.0, component_count);
float_max_id = spirv_compiler_get_constant_double_vector(compiler, 4294967296.0, component_count);
}
else
{
write_mask = dst->write_mask;
zero_id = spirv_compiler_get_constant_float_vector(compiler, 0.0f, component_count);
float_max_id = spirv_compiler_get_constant_float_vector(compiler, 4294967296.0f, component_count);
}
src_type_id = spirv_compiler_get_type_id_for_reg(compiler, &src->reg, write_mask);
dst_type_id = spirv_compiler_get_type_id_for_dst(compiler, dst);
src_id = spirv_compiler_emit_load_src(compiler, src, write_mask);
val_id = vkd3d_spirv_build_op_glsl_std450_max(builder, src_type_id, src_id, zero_id);
uint_max_id = spirv_compiler_get_constant_uint_vector(compiler, UINT_MAX, component_count);
......@@ -8029,6 +8034,29 @@ static void spirv_compiler_emit_ftou(struct spirv_compiler *compiler,
spirv_compiler_emit_store_dst(compiler, dst, val_id);
}
static void spirv_compiler_emit_dtof(struct spirv_compiler *compiler,
const struct vkd3d_shader_instruction *instruction)
{
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
const struct vkd3d_shader_dst_param *dst = instruction->dst;
const struct vkd3d_shader_src_param *src = instruction->src;
uint32_t type_id, val_id, src_id;
unsigned int component_count;
uint32_t write_mask;
component_count = vsir_write_mask_component_count(dst->write_mask);
write_mask = vkd3d_write_mask_from_component_count(component_count);
src_id = spirv_compiler_emit_load_src(compiler, src, write_mask);
type_id = vkd3d_spirv_get_type_id(builder, VKD3D_SHADER_COMPONENT_FLOAT, component_count);
val_id = vkd3d_spirv_build_op_tr1(builder, &builder->function_stream, SpvOpFConvert, type_id, src_id);
if (instruction->flags & VKD3DSI_PRECISE_XYZW)
vkd3d_spirv_build_op_decorate(builder, val_id, SpvDecorationNoContraction, NULL, 0);
spirv_compiler_emit_store_dst(compiler, dst, val_id);
}
static void spirv_compiler_emit_bitfield_instruction(struct spirv_compiler *compiler,
const struct vkd3d_shader_instruction *instruction)
{
......@@ -10419,7 +10447,6 @@ static int spirv_compiler_handle_instruction(struct spirv_compiler *compiler,
case VKD3DSIH_DDIV:
case VKD3DSIH_DIV:
case VKD3DSIH_DMUL:
case VKD3DSIH_DTOF:
case VKD3DSIH_FREM:
case VKD3DSIH_FTOD:
case VKD3DSIH_IADD:
......@@ -10507,6 +10534,9 @@ static int spirv_compiler_handle_instruction(struct spirv_compiler *compiler,
case VKD3DSIH_FTOU:
spirv_compiler_emit_ftou(compiler, instruction);
break;
case VKD3DSIH_DTOF:
spirv_compiler_emit_dtof(compiler, instruction);
break;
case VKD3DSIH_DEQO:
case VKD3DSIH_DGEO:
case VKD3DSIH_DLT:
......
......@@ -10239,70 +10239,66 @@ static void test_shader_instructions(void)
static const DWORD ps_dtou_code[] =
{
#if 0
double src0;
double2 src0, src1;
 
void main(out uint4 dst : SV_Target)
{
dst = uint4(src0, -src0, 0, 0);
dst.xz = src0.yx;
dst.yw = -src1;
}
#endif
0x43425844, 0x6ca74abd, 0xe970e02d, 0xa65b35db, 0xd2f58586, 0x00000001, 0x00000128, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x43425844, 0xfaba33b8, 0x1e15cf47, 0xcd89f03c, 0xdf2aef62, 0x00000001, 0x000000ec, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050,
0x00000027, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
0x00000000, 0x02000068, 0x00000001, 0x060000d7, 0x00100012, 0x00000000, 0x00208446, 0x00000000,
0x00000000, 0x070000d7, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000,
0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
0x00000021, 0x00000000,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
0x00000018, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x03000065, 0x001020f2,
0x00000000, 0x060000d7, 0x00102052, 0x00000000, 0x002084e6, 0x00000000, 0x00000000, 0x070000d7,
0x001020a2, 0x00000000, 0x80208e46, 0x00000041, 0x00000000, 0x00000001, 0x0100003e, 0x30494653,
0x00000008, 0x00000021, 0x00000000,
};
static struct named_shader ps_dtou = {"dtou", ps_dtou_code, sizeof(ps_dtou_code)};
static const DWORD ps_dtoi_code[] =
{
#if 0
double src0;
double2 src0, src1;
 
void main(out uint4 dst : SV_Target)
{
dst = int4(src0, -src0, 0, 0);
dst.xz = int2(src0.yx);
dst.yw = int2(-src1);
}
#endif
0x43425844, 0x38d82727, 0x8666b36c, 0x91954b7e, 0xf376163a, 0x00000001, 0x00000128, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x43425844, 0xbc0fca8f, 0x063a975f, 0x4699eeed, 0xa39c6d2c, 0x00000001, 0x000000ec, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050,
0x00000027, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
0x00000000, 0x02000068, 0x00000001, 0x060000d6, 0x00100012, 0x00000000, 0x00208446, 0x00000000,
0x00000000, 0x070000d6, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000,
0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
0x00000021, 0x00000000,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
0x00000018, 0x0102186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x03000065, 0x001020f2,
0x00000000, 0x060000d6, 0x00102052, 0x00000000, 0x002084e6, 0x00000000, 0x00000000, 0x070000d6,
0x001020a2, 0x00000000, 0x80208e46, 0x00000041, 0x00000000, 0x00000001, 0x0100003e, 0x30494653,
0x00000008, 0x00000021, 0x00000000,
};
static const struct named_shader ps_dtoi = {"dtoi", ps_dtoi_code, sizeof(ps_dtoi_code)};
static const DWORD ps_dtof_code[] =
{
#if 0
double src0;
double2 src0, src1;
 
void main(out uint4 dst : SV_Target)
{
float2 f = float2(src0, -src0);
dst.x = asuint(f.x);
dst.y = asuint(f.y);
dst.zw = 0;
float4 f;
f.xz = src0.yx;
f.yw = -src1;
dst = asuint(f);
}
#endif
0x43425844, 0xa920927f, 0xac06725f, 0x310edf68, 0xec6ab7cd, 0x00000001, 0x00000128, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x00000118, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x43425844, 0xc72c8b4d, 0x455c6951, 0xd193c640, 0x4dce07a4, 0x00000001, 0x000000ec, 0x00000004,
0x00000030, 0x00000040, 0x00000074, 0x000000dc, 0x4e475349, 0x00000008, 0x00000000, 0x00000008,
0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000001,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x0000009c, 0x00000050,
0x00000027, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x03000065, 0x001020f2,
0x00000000, 0x02000068, 0x00000001, 0x060000c9, 0x00100012, 0x00000000, 0x00208446, 0x00000000,
0x00000000, 0x070000c9, 0x00100022, 0x00000000, 0x80208446, 0x00000041, 0x00000000, 0x00000000,
0x05000036, 0x00102032, 0x00000000, 0x00100046, 0x00000000, 0x08000036, 0x001020c2, 0x00000000,
0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0100003e, 0x30494653, 0x00000008,
0x00000001, 0x00000000,
0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x00000060, 0x00000050,
0x00000018, 0x0100186a, 0x04000059, 0x00208e46, 0x00000000, 0x00000002, 0x03000065, 0x001020f2,
0x00000000, 0x060000c9, 0x00102052, 0x00000000, 0x002084e6, 0x00000000, 0x00000000, 0x070000c9,
0x001020a2, 0x00000000, 0x80208e46, 0x00000041, 0x00000000, 0x00000001, 0x0100003e, 0x30494653,
0x00000008, 0x00000001, 0x00000000,
};
static const struct named_shader ps_dtof = {"dtof", ps_dtof_code, sizeof(ps_dtof_code)};
static const DWORD ps_utod_code[] =
......@@ -10950,14 +10946,10 @@ static void test_shader_instructions(void)
{&ps_dge, {.d = {{1.5, 1.0}}}, {{0xffffffff}}, true},
{&ps_dlt, {.d = {{0.0, 1.0}}}, {{0xffffffff}}, true},
{&ps_dlt, {.d = {{1.0, 1.0}}}, {{0x00000000}}, true},
{&ps_dtou, {.d = {{ -NAN}}}, {{ 0, 0 }}, true, false, false, true},
{&ps_dtou, {.d = {{ NAN}}}, {{ 0, 0 }}, true, false, false, true},
{&ps_dtou, {.d = {{-INFINITY}}}, {{ 0, ~0u}}, true},
{&ps_dtou, {.d = {{ INFINITY}}}, {{~0u, 0 }}, true},
{&ps_dtou, {.d = {{ -1.0}}}, {{ 0, 1 }}, true},
{&ps_dtou, {.d = {{ 1.0}}}, {{ 1, 0 }}, true},
{&ps_dtoi, {.d = {{ 1.0}}}, {.i = {1, -1}}, true},
{&ps_dtof, {.d = {{ 1.5}}}, {.f = {1.5f, -1.5f}}, true},
{&ps_dtou, {.d = {{INFINITY, -INFINITY}, {1.0, -1.0}}}, {{0, 0, UINT_MAX, 1}}, true},
{&ps_dtou, {.d = {{NAN, -NAN}, {1.0, -1.0}}}, {{0, 0, 0, 1}}, true, .todo_on_nvidia = true},
{&ps_dtoi, {.d = {{INFINITY, -INFINITY}, {1.0, -1.0}}}, {.i = {INT_MIN, -1, INT_MAX, 1}}, true},
{&ps_dtof, {.d = {{1.5, (1.0/3.0)}, {1e40, -0.0}}}, {.f = {(1.0f/3.0f), -INFINITY, 1.5f, 0.0f}}, true},
{&ps_utod, {.u = {{3, 0xffffffff}}}, {.d = {3.0, 4294967295.0}}, true},
{&ps_itod, {.u = {{3, INT_MIN}}}, {.d = {3.0, -2147483648.0}}, true},
{&ps_ftod, {.f = {{-2.5f, -2.5f}}}, {.d = {-2.5, 2.5}}, true},