mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader: Unify static string arrays initialization pattern.
This commit is contained in:
parent
9ccba35dde
commit
69f32796b0
Notes:
Alexandre Julliard
2023-06-28 23:04:06 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/233
@ -44,11 +44,11 @@ extern const char *const vkd3d_dbg_env_name;
|
||||
|
||||
static const char *const debug_level_names[] =
|
||||
{
|
||||
/* VKD3D_DBG_LEVEL_NONE */ "none",
|
||||
/* VKD3D_DBG_LEVEL_ERR */ "err",
|
||||
/* VKD3D_DBG_LEVEL_FIXME */ "fixme",
|
||||
/* VKD3D_DBG_LEVEL_WARN */ "warn",
|
||||
/* VKD3D_DBG_LEVEL_TRACE */ "trace",
|
||||
[VKD3D_DBG_LEVEL_NONE ] = "none",
|
||||
[VKD3D_DBG_LEVEL_ERR ] = "err",
|
||||
[VKD3D_DBG_LEVEL_FIXME] = "fixme",
|
||||
[VKD3D_DBG_LEVEL_WARN ] = "warn",
|
||||
[VKD3D_DBG_LEVEL_TRACE] = "trace",
|
||||
};
|
||||
|
||||
enum vkd3d_dbg_level vkd3d_dbg_get_level(void)
|
||||
|
@ -578,17 +578,17 @@ static void shader_dump_resource_type(struct vkd3d_d3d_asm_compiler *compiler, e
|
||||
{
|
||||
static const char *const resource_type_names[] =
|
||||
{
|
||||
/* VKD3D_SHADER_RESOURCE_NONE */ "none",
|
||||
/* VKD3D_SHADER_RESOURCE_BUFFER */ "buffer",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_1D */ "texture1d",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_2D */ "texture2d",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_2DMS */ "texture2dms",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_3D */ "texture3d",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_CUBE */ "texturecube",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_1DARRAY */ "texture1darray",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY */ "texture2darray",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY */ "texture2dmsarray",
|
||||
/* VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY */ "texturecubearray",
|
||||
[VKD3D_SHADER_RESOURCE_NONE ] = "none",
|
||||
[VKD3D_SHADER_RESOURCE_BUFFER ] = "buffer",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_1D ] = "texture1d",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_2D ] = "texture2d",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_2DMS ] = "texture2dms",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_3D ] = "texture3d",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_CUBE ] = "texturecube",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_1DARRAY ] = "texture1darray",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY ] = "texture2darray",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY] = "texture2dmsarray",
|
||||
[VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY] = "texturecubearray",
|
||||
};
|
||||
|
||||
if (type < ARRAY_SIZE(resource_type_names))
|
||||
@ -601,19 +601,19 @@ static void shader_dump_data_type(struct vkd3d_d3d_asm_compiler *compiler, const
|
||||
{
|
||||
static const char *const data_type_names[] =
|
||||
{
|
||||
/* VKD3D_DATA_FLOAT */ "float",
|
||||
/* VKD3D_DATA_INT */ "int",
|
||||
/* VKD3D_DATA_RESOURCE */ "resource",
|
||||
/* VKD3D_DATA_SAMPLER */ "sampler",
|
||||
/* VKD3D_DATA_UAV */ "uav",
|
||||
/* VKD3D_DATA_UINT */ "uint",
|
||||
/* VKD3D_DATA_UNORM */ "unorm",
|
||||
/* VKD3D_DATA_SNORM */ "snorm",
|
||||
/* VKD3D_DATA_OPAQUE */ "opaque",
|
||||
/* VKD3D_DATA_MIXED */ "mixed",
|
||||
/* VKD3D_DATA_DOUBLE */ "double",
|
||||
/* VKD3D_DATA_CONTINUED */ "<continued>",
|
||||
/* VKD3D_DATA_UNUSED */ "<unused>",
|
||||
[VKD3D_DATA_FLOAT ] = "float",
|
||||
[VKD3D_DATA_INT ] = "int",
|
||||
[VKD3D_DATA_RESOURCE ] = "resource",
|
||||
[VKD3D_DATA_SAMPLER ] = "sampler",
|
||||
[VKD3D_DATA_UAV ] = "uav",
|
||||
[VKD3D_DATA_UINT ] = "uint",
|
||||
[VKD3D_DATA_UNORM ] = "unorm",
|
||||
[VKD3D_DATA_SNORM ] = "snorm",
|
||||
[VKD3D_DATA_OPAQUE ] = "opaque",
|
||||
[VKD3D_DATA_MIXED ] = "mixed",
|
||||
[VKD3D_DATA_DOUBLE ] = "double",
|
||||
[VKD3D_DATA_CONTINUED] = "<continued>",
|
||||
[VKD3D_DATA_UNUSED ] = "<unused>",
|
||||
};
|
||||
const char *name;
|
||||
int i;
|
||||
|
@ -2124,18 +2124,18 @@ const char *hlsl_node_type_to_string(enum hlsl_ir_node_type type)
|
||||
{
|
||||
static const char * const names[] =
|
||||
{
|
||||
"HLSL_IR_CALL",
|
||||
"HLSL_IR_CONSTANT",
|
||||
"HLSL_IR_EXPR",
|
||||
"HLSL_IR_IF",
|
||||
"HLSL_IR_INDEX",
|
||||
"HLSL_IR_LOAD",
|
||||
"HLSL_IR_LOOP",
|
||||
"HLSL_IR_JUMP",
|
||||
"HLSL_IR_RESOURCE_LOAD",
|
||||
"HLSL_IR_RESOURCE_STORE",
|
||||
"HLSL_IR_STORE",
|
||||
"HLSL_IR_SWIZZLE",
|
||||
[HLSL_IR_CALL ] = "HLSL_IR_CALL",
|
||||
[HLSL_IR_CONSTANT ] = "HLSL_IR_CONSTANT",
|
||||
[HLSL_IR_EXPR ] = "HLSL_IR_EXPR",
|
||||
[HLSL_IR_IF ] = "HLSL_IR_IF",
|
||||
[HLSL_IR_INDEX ] = "HLSL_IR_INDEX",
|
||||
[HLSL_IR_LOAD ] = "HLSL_IR_LOAD",
|
||||
[HLSL_IR_LOOP ] = "HLSL_IR_LOOP",
|
||||
[HLSL_IR_JUMP ] = "HLSL_IR_JUMP",
|
||||
[HLSL_IR_RESOURCE_LOAD ] = "HLSL_IR_RESOURCE_LOAD",
|
||||
[HLSL_IR_RESOURCE_STORE] = "HLSL_IR_RESOURCE_STORE",
|
||||
[HLSL_IR_STORE ] = "HLSL_IR_STORE",
|
||||
[HLSL_IR_SWIZZLE ] = "HLSL_IR_SWIZZLE",
|
||||
};
|
||||
|
||||
if (type >= ARRAY_SIZE(names))
|
||||
@ -2147,11 +2147,11 @@ const char *hlsl_jump_type_to_string(enum hlsl_ir_jump_type type)
|
||||
{
|
||||
static const char * const names[] =
|
||||
{
|
||||
[HLSL_IR_JUMP_BREAK] = "HLSL_IR_JUMP_BREAK",
|
||||
[HLSL_IR_JUMP_CONTINUE] = "HLSL_IR_JUMP_CONTINUE",
|
||||
[HLSL_IR_JUMP_BREAK] = "HLSL_IR_JUMP_BREAK",
|
||||
[HLSL_IR_JUMP_CONTINUE] = "HLSL_IR_JUMP_CONTINUE",
|
||||
[HLSL_IR_JUMP_DISCARD_NEG] = "HLSL_IR_JUMP_DISCARD_NEG",
|
||||
[HLSL_IR_JUMP_DISCARD_NZ] = "HLSL_IR_JUMP_DISCARD_NZ",
|
||||
[HLSL_IR_JUMP_RETURN] = "HLSL_IR_JUMP_RETURN",
|
||||
[HLSL_IR_JUMP_DISCARD_NZ] = "HLSL_IR_JUMP_DISCARD_NZ",
|
||||
[HLSL_IR_JUMP_RETURN] = "HLSL_IR_JUMP_RETURN",
|
||||
};
|
||||
|
||||
assert(type < ARRAY_SIZE(names));
|
||||
|
Loading…
Reference in New Issue
Block a user