{
struct v3d_context *v3d = v3d_context(pctx);
v3d->sample_mask = sample_mask & ((1 << VC5_MAX_SAMPLES) - 1);
- v3d->dirty |= VC5_DIRTY_SAMPLE_MASK;
+ v3d->dirty |= VC5_DIRTY_SAMPLE_STATE;
}
static uint16_t
if (cso->offset_tri) {
so->offset_units = float_to_187_half(cso->offset_units);
+ so->z16_offset_units = float_to_187_half(cso->offset_units * 256.0);
so->offset_factor = float_to_187_half(cso->offset_scale);
}
const struct pipe_stencil_state *back = &cso->stencil[1];
if (front->enabled) {
+ STATIC_ASSERT(sizeof(so->stencil_front) >=
+ cl_packet_length(STENCIL_CONFIG));
v3dx_pack(&so->stencil_front, STENCIL_CONFIG, config) {
config.front_config = true;
/* If !back->enabled, then the front values should be
}
}
if (back->enabled) {
+ STATIC_ASSERT(sizeof(so->stencil_back) >=
+ cl_packet_length(STENCIL_CONFIG));
v3dx_pack(&so->stencil_back, STENCIL_CONFIG, config) {
config.front_config = false;
config.back_config = true;
15);
sampler.max_level_of_detail = MIN2(cso->max_lod, 15);
+ /* If we're not doing inter-miplevel filtering, we need to
+ * clamp the LOD so that we only sample from baselevel.
+ * However, we need to still allow the calculated LOD to be
+ * fractionally over the baselevel, so that the HW can decide
+ * between the min and mag filters.
+ */
if (cso->min_mip_filter == PIPE_TEX_MIPFILTER_NONE) {
- sampler.min_level_of_detail = 0;
- sampler.max_level_of_detail = 0;
+ sampler.min_level_of_detail =
+ MIN2(sampler.min_level_of_detail, 1.0 / 256.0);
+ sampler.max_level_of_detail =
+ MIN2(sampler.max_level_of_detail, 1.0 / 256.0);
}
if (cso->max_anisotropy) {
int msaa_scale = prsc->nr_samples > 1 ? 2 : 1;
#if V3D_VERSION >= 40
- so->bo = v3d_bo_alloc(v3d->screen, cl_packet_length(SAMPLER_STATE),
- "sampler");
+ so->bo = v3d_bo_alloc(v3d->screen,
+ cl_packet_length(TEXTURE_SHADER_STATE), "sampler");
void *map = v3d_bo_map(so->bo);
v3dx_pack(map, TEXTURE_SHADER_STATE, tex) {
#else /* V3D_VERSION < 40 */
+ STATIC_ASSERT(sizeof(so->texture_shader_state) >=
+ cl_packet_length(TEXTURE_SHADER_STATE));
v3dx_pack(&so->texture_shader_state, TEXTURE_SHADER_STATE, tex) {
#endif
assert(num_targets <= ARRAY_SIZE(so->targets));
- for (i = 0; i < num_targets; i++)
+ for (i = 0; i < num_targets; i++) {
+ if (offsets[i] != -1)
+ so->offsets[i] = offsets[i];
+
pipe_so_target_reference(&so->targets[i], targets[i]);
+ }
for (; i < so->num_targets; i++)
pipe_so_target_reference(&so->targets[i], NULL);