mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Add a hlsl_block_add_float_constant() helper.
This commit is contained in:
committed by
Henri Verbeet
parent
e830cdee71
commit
b7ea23303e
Notes:
Henri Verbeet
2025-02-24 16:27:47 +01:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1386
@@ -1581,7 +1581,7 @@ struct hlsl_ir_node *hlsl_new_bool_constant(struct hlsl_ctx *ctx, bool b, const
|
||||
return hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_BOOL), &value, loc);
|
||||
}
|
||||
|
||||
struct hlsl_ir_node *hlsl_new_float_constant(struct hlsl_ctx *ctx, float f,
|
||||
static struct hlsl_ir_node *hlsl_new_float_constant(struct hlsl_ctx *ctx, float f,
|
||||
const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
struct hlsl_constant_value value;
|
||||
@@ -1590,6 +1590,12 @@ struct hlsl_ir_node *hlsl_new_float_constant(struct hlsl_ctx *ctx, float f,
|
||||
return hlsl_new_constant(ctx, hlsl_get_scalar_type(ctx, HLSL_TYPE_FLOAT), &value, loc);
|
||||
}
|
||||
|
||||
struct hlsl_ir_node *hlsl_block_add_float_constant(struct hlsl_ctx *ctx, struct hlsl_block *block,
|
||||
float f, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
return append_new_instr(ctx, block, hlsl_new_float_constant(ctx, f, loc));
|
||||
}
|
||||
|
||||
static struct hlsl_ir_node *hlsl_new_int_constant(struct hlsl_ctx *ctx, int32_t n,
|
||||
const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
|
Reference in New Issue
Block a user