util_dynarray_init(&nv50->global_residents, NULL);
+ // Make sure that the first TSC entry has SRGB conversion bit set, since we
+ // use it as a fallback.
+ if (!screen->tsc.entries[0])
+ nv50_upload_tsc0(nv50);
+
+ // And mark samplers as dirty so that the first slot would get bound to the
+ // zero entry if it's not otherwise set.
+ nv50->dirty_3d |= NV50_NEW_3D_SAMPLERS;
+
return pipe;
out_err:
void nv50_validate_textures(struct nv50_context *);
void nv50_validate_samplers(struct nv50_context *);
void nv50_upload_ms_info(struct nouveau_pushbuf *);
+void nv50_upload_tsc0(struct nv50_context *);
struct pipe_sampler_view *
nv50_create_texture_view(struct pipe_context *,
}
nv50->state.num_samplers[s] = nv50->num_samplers[s];
+ // TXF, in unlinked tsc mode, will always use sampler 0. So we have to
+ // ensure that it remains bound. Its contents don't matter, all samplers we
+ // ever create have the SRGB_CONVERSION bit set, so as long as the first
+ // entry is initialized, we're good to go. This is the only bit that has
+ // any effect on what TXF does.
+ if (!nv50->samplers[s][0]) {
+ BEGIN_NV04(push, NV50_3D(BIND_TSC(s)), 1);
+ PUSH_DATA (push, 1);
+ }
+
return need_flush;
}
BEGIN_NI04(push, NV50_3D(CB_DATA(0)), ARRAY_SIZE(msaa_sample_xy_offsets));
PUSH_DATAp(push, msaa_sample_xy_offsets, ARRAY_SIZE(msaa_sample_xy_offsets));
}
+
+void nv50_upload_tsc0(struct nv50_context *nv50)
+{
+ struct nouveau_pushbuf *push = nv50->base.pushbuf;
+ u32 data[8] = { G80_TSC_0_SRGB_CONVERSION };
+ nv50_sifc_linear_u8(&nv50->base, nv50->screen->txc,
+ 65536 /* + tsc->id * 32 */,
+ NOUVEAU_BO_VRAM, 32, data);
+ BEGIN_NV04(push, NV50_3D(TSC_FLUSH), 1);
+ PUSH_DATA (push, 0);
+}