summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-04-09 21:03:02 -0700
committerJason Ekstrand <[email protected]>2015-04-22 18:10:40 -0700
commit94669cb53483bd58f33e439411af3cb5c006da79 (patch)
treea31ea67675d77ab1d472137461e5134541f9c883 /src
parent73cc76362dd93a2b8b35583cc12cc3a61a61ea83 (diff)
nir: Refactor tex_instr_dest_size to use a switch statement
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/nir/nir.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 74772c79825..c07a95552cd 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -960,7 +960,8 @@ typedef struct {
static inline unsigned
nir_tex_instr_dest_size(nir_tex_instr *instr)
{
- if (instr->op == nir_texop_txs) {
+ switch (instr->op) {
+ case nir_texop_txs: {
unsigned ret;
switch (instr->sampler_dim) {
case GLSL_SAMPLER_DIM_1D:
@@ -985,13 +986,15 @@ nir_tex_instr_dest_size(nir_tex_instr *instr)
return ret;
}
- if (instr->op == nir_texop_query_levels)
+ case nir_texop_query_levels:
return 2;
- if (instr->is_shadow && instr->is_new_style_shadow)
- return 1;
+ default:
+ if (instr->is_shadow && instr->is_new_style_shadow)
+ return 1;
- return 4;
+ return 4;
+ }
}
static inline unsigned