mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/d3d-asm: Handle i64 immediate constants.
This commit is contained in:
Notes:
Henri Verbeet
2025-09-16 16:19:58 +02:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1727
@@ -593,6 +593,18 @@ static void shader_print_uint_literal(struct vkd3d_d3d_asm_compiler *compiler,
|
||||
prefix, compiler->colours.literal, i, compiler->colours.reset, suffix);
|
||||
}
|
||||
|
||||
static void shader_print_int64_literal(struct vkd3d_d3d_asm_compiler *compiler,
|
||||
const char *prefix, int64_t i, const char *suffix)
|
||||
{
|
||||
/* Note that we need to handle INT64_MIN here as well. */
|
||||
if (i < 0)
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "%s-%s%"PRIu64"%s%s",
|
||||
prefix, compiler->colours.literal, -(uint64_t)i, compiler->colours.reset, suffix);
|
||||
else
|
||||
vkd3d_string_buffer_printf(&compiler->buffer, "%s%s%"PRId64"%s%s",
|
||||
prefix, compiler->colours.literal, i, compiler->colours.reset, suffix);
|
||||
}
|
||||
|
||||
static void shader_print_uint64_literal(struct vkd3d_d3d_asm_compiler *compiler,
|
||||
const char *prefix, uint64_t i, const char *suffix)
|
||||
{
|
||||
@@ -793,6 +805,12 @@ static void shader_print_register(struct vkd3d_d3d_asm_compiler *compiler, const
|
||||
if (reg->dimension == VSIR_DIMENSION_VEC4)
|
||||
shader_print_double_literal(compiler, ", ", reg->u.immconst_f64[1], "");
|
||||
}
|
||||
else if (reg->data_type == VSIR_DATA_I64)
|
||||
{
|
||||
shader_print_int64_literal(compiler, "", reg->u.immconst_u64[0], "");
|
||||
if (reg->dimension == VSIR_DIMENSION_VEC4)
|
||||
shader_print_int64_literal(compiler, "", reg->u.immconst_u64[1], "");
|
||||
}
|
||||
else if (reg->data_type == VSIR_DATA_U64)
|
||||
{
|
||||
shader_print_uint64_literal(compiler, "", reg->u.immconst_u64[0], "");
|
||||
|
||||
Reference in New Issue
Block a user