mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 17:50:12 +01:00
spirv: Tidy some repeated if checks by using a switch statement.
Iago suggested tidying this. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
bb04b84114
commit
1e5b09f42f
1 changed files with 9 additions and 8 deletions
|
|
@ -1064,18 +1064,19 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
|
|||
vtn_get_builtin_location(b, builtin, &nir_var->data.location, &mode);
|
||||
nir_var->data.mode = mode;
|
||||
|
||||
if (builtin == SpvBuiltInTessLevelOuter ||
|
||||
builtin == SpvBuiltInTessLevelInner) {
|
||||
switch (builtin) {
|
||||
case SpvBuiltInTessLevelOuter:
|
||||
case SpvBuiltInTessLevelInner:
|
||||
nir_var->data.compact = true;
|
||||
}
|
||||
|
||||
if (builtin == SpvBuiltInFragCoord || builtin == SpvBuiltInSamplePosition)
|
||||
break;
|
||||
case SpvBuiltInSamplePosition:
|
||||
nir_var->data.origin_upper_left = b->origin_upper_left;
|
||||
|
||||
if (builtin == SpvBuiltInFragCoord)
|
||||
/* fallthrough */
|
||||
case SpvBuiltInFragCoord:
|
||||
nir_var->data.pixel_center_integer = b->pixel_center_integer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
case SpvDecorationSpecId:
|
||||
case SpvDecorationRowMajor:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue