mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Add special allocation rules for FFACE and SAMPLE.
This commit is contained in:
committed by
Henri Verbeet
parent
2c15015ec2
commit
64bc0515e0
Notes:
Henri Verbeet
2024-11-24 00:09:47 +01:00
Approved-by: Elizabeth Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1260
@@ -5331,6 +5331,7 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var
|
||||
|
||||
enum vkd3d_shader_register_type type;
|
||||
struct vkd3d_shader_version version;
|
||||
bool special_interpolation = false;
|
||||
bool vip_allocation = false;
|
||||
uint32_t reg;
|
||||
bool builtin;
|
||||
@@ -5389,6 +5390,9 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var
|
||||
|| semantic == VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX
|
||||
|| semantic == VKD3D_SHADER_SV_PRIMITIVE_ID)
|
||||
vip_allocation = true;
|
||||
|
||||
if (semantic == VKD3D_SHADER_SV_IS_FRONT_FACE || semantic == VKD3D_SHADER_SV_SAMPLE_INDEX)
|
||||
special_interpolation = true;
|
||||
}
|
||||
|
||||
if (builtin)
|
||||
@@ -5402,6 +5406,9 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var
|
||||
? 0 : sm4_get_interpolation_mode(var->data_type, var->storage_modifiers);
|
||||
unsigned int reg_size = optimize ? var->data_type->dimx : 4;
|
||||
|
||||
if (special_interpolation)
|
||||
mode = VKD3DSIM_NONE;
|
||||
|
||||
var->regs[HLSL_REGSET_NUMERIC] = allocate_register(ctx, allocator, 1, UINT_MAX,
|
||||
reg_size, var->data_type->dimx, mode, var->force_align, vip_allocation);
|
||||
|
||||
|
Reference in New Issue
Block a user