}
}
- if (c->key->tex[unit].forced_first_level) {
- lod = qir_uniform_f(c, c->key->tex[unit].forced_first_level);
+ if (c->key->tex[unit].force_first_level) {
+ lod = qir_uniform(c, QUNIFORM_TEXTURE_FIRST_LEVEL, unit);
is_txl = true;
is_txb = false;
}
key->tex[i].compare_func = sampler_state->compare_func;
key->tex[i].wrap_s = sampler_state->wrap_s;
key->tex[i].wrap_t = sampler_state->wrap_t;
- if (vc4_sampler->force_first_level) {
- key->tex[i].forced_first_level =
- sampler->u.tex.first_level;
- }
+ key->tex[i].force_first_level =
+ vc4_sampler->force_first_level;
}
}
/** A reference to a texture config parameter 2 cubemap stride uniform */
QUNIFORM_TEXTURE_CONFIG_P2,
+ QUNIFORM_TEXTURE_FIRST_LEVEL,
+
QUNIFORM_TEXTURE_MSAA_ADDR,
QUNIFORM_UBO_ADDR,
unsigned compare_func:3;
unsigned wrap_s:3;
unsigned wrap_t:3;
- unsigned forced_first_level:8;
+ bool force_first_level:1;
};
struct {
uint16_t msaa_width, msaa_height;
VC4_SET_FIELD((data >> 16) & 1, VC4_TEX_P2_BSLOD));
}
+static void
+write_texture_first_level(struct vc4_context *vc4,
+ struct vc4_cl_out **uniforms,
+ struct vc4_texture_stateobj *texstate,
+ uint32_t data)
+{
+ uint32_t unit = data & 0xffff;
+ struct pipe_sampler_view *texture = texstate->textures[unit];
+
+ cl_aligned_f(uniforms, texture->u.tex.first_level);
+}
+
static void
write_texture_msaa_addr(struct vc4_context *vc4,
struct vc4_cl_out **uniforms,
uinfo->data[i]);
break;
+ case QUNIFORM_TEXTURE_FIRST_LEVEL:
+ write_texture_first_level(vc4, &uniforms, texstate,
+ uinfo->data[i]);
+ break;
+
case QUNIFORM_UBO_ADDR:
cl_aligned_reloc(vc4, &vc4->uniforms, &uniforms, ubo, 0);
break;
case QUNIFORM_TEXTURE_CONFIG_P1:
case QUNIFORM_TEXTURE_CONFIG_P2:
case QUNIFORM_TEXTURE_BORDER_COLOR:
+ case QUNIFORM_TEXTURE_FIRST_LEVEL:
case QUNIFORM_TEXTURE_MSAA_ADDR:
case QUNIFORM_TEXRECT_SCALE_X:
case QUNIFORM_TEXRECT_SCALE_Y: