vkd3d-shader: Store the register type for reservations as a char.

Essentially because the meaning of 'b' differs between SM1-3 and SM4+.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-05-31 21:41:13 -05:00 committed by Alexandre Julliard
parent abd6ceb489
commit bb79ca76ae
2 changed files with 2 additions and 22 deletions

View File

@ -212,7 +212,7 @@ struct hlsl_src
struct hlsl_reg_reservation
{
enum vkd3d_shader_register_type type;
char type;
DWORD regnum;
};

View File

@ -782,29 +782,9 @@ static bool add_func_parameter(struct hlsl_ctx *ctx, struct list *list,
static struct hlsl_reg_reservation *parse_reg_reservation(struct hlsl_ctx *ctx, const char *reg_string)
{
enum vkd3d_shader_register_type type;
struct hlsl_reg_reservation *reg_res;
DWORD regnum = 0;
switch (reg_string[0])
{
case 'c':
type = VKD3DSPR_CONST;
break;
case 'i':
type = VKD3DSPR_CONSTINT;
break;
case 'b':
type = VKD3DSPR_CONSTBOOL;
break;
case 's':
type = VKD3DSPR_SAMPLER;
break;
default:
FIXME("Unsupported register type.\n");
return NULL;
}
if (!sscanf(reg_string + 1, "%u", &regnum))
{
FIXME("Unsupported register reservation syntax.\n");
@ -813,7 +793,7 @@ static struct hlsl_reg_reservation *parse_reg_reservation(struct hlsl_ctx *ctx,
if (!(reg_res = hlsl_alloc(ctx, sizeof(*reg_res))))
return NULL;
reg_res->type = type;
reg_res->type = reg_string[0];
reg_res->regnum = regnum;
return reg_res;
}