util_dynarray_init(&nvc0->global_residents, NULL);
+ // Make sure that the first TSC entry has SRGB conversion bit set, since we
+ // use it as a fallback on Fermi for TXF, and on Kepler+ generations for
+ // FBFETCH handling (which also uses TXF).
+ //
+ // NOTE: Preliminary testing suggests that this isn't necessary at all at
+ // least on GM20x (untested on Kepler). However this is ~free, so no reason
+ // not to do it.
+ if (!screen->tsc.entries[0])
+ nvc0_upload_tsc0(nvc0);
+
return pipe;
out_err:
void nvc0_validate_suf(struct nvc0_context *nvc0, int s);
void nvc0_validate_textures(struct nvc0_context *);
void nvc0_validate_samplers(struct nvc0_context *);
+void nvc0_upload_tsc0(struct nvc0_context *);
void nve4_set_tex_handles(struct nvc0_context *);
void nvc0_validate_surfaces(struct nvc0_context *);
void nve4_set_surface_info(struct nouveau_pushbuf *,
nouveau_heap_destroy(&screen->lib_code);
nouveau_heap_destroy(&screen->text_heap);
- FREE(screen->default_tsc);
FREE(screen->tic.entries);
nouveau_object_del(&screen->eng3d);
if (!nvc0_blitter_create(screen))
goto fail;
- screen->default_tsc = CALLOC_STRUCT(nv50_tsc_entry);
- screen->default_tsc->tsc[0] = G80_TSC_0_SRGB_CONVERSION;
-
nouveau_fence_new(&screen->base, &screen->base.fence.current);
return &screen->base;
struct nvc0_blitter *blitter;
- struct nv50_tsc_entry *default_tsc;
-
struct {
void **entries;
int next;
-
+#include "util/u_format.h"
#include "util/u_framebuffer.h"
#include "util/u_math.h"
#include "util/u_viewport.h"
pipe_sampler_view_reference(&nvc0->fbtexture, NULL);
nvc0->fbtexture = new_view;
- if (screen->default_tsc->id < 0) {
- struct nv50_tsc_entry *tsc = nv50_tsc_entry(screen->default_tsc);
- tsc->id = nvc0_screen_tsc_alloc(screen, tsc);
- nvc0->base.push_data(&nvc0->base, screen->txc, 65536 + tsc->id * 32,
- NV_VRAM_DOMAIN(&screen->base), 32, tsc->tsc);
- screen->tsc.lock[tsc->id / 32] |= 1 << (tsc->id % 32);
-
- IMMED_NVC0(push, NVC0_3D(TSC_FLUSH), 0);
- if (screen->base.class_3d < NVE4_3D_CLASS) {
- BEGIN_NVC0(push, NVC0_3D(BIND_TSC2(0)), 1);
- PUSH_DATA (push, (tsc->id << 12) | 1);
- }
- }
-
if (new_view) {
struct nv50_tic_entry *tic = nv50_tic_entry(new_view);
assert(tic->id < 0);
PUSH_DATA (push, screen->uniform_bo->offset + NVC0_CB_AUX_INFO(4));
BEGIN_1IC0(push, NVC0_3D(CB_POS), 1 + 1);
PUSH_DATA (push, NVC0_CB_AUX_FB_TEX_INFO);
- PUSH_DATA (push, (screen->default_tsc->id << 20) | tic->id);
+ PUSH_DATA (push, (0 << 20) | tic->id);
} else {
BEGIN_NVC0(push, NVC0_3D(BIND_TIC2(0)), 1);
PUSH_DATA (push, (tic->id << 9) | 1);
nvc0->dirty_cp |= NVC0_NEW_CP_SAMPLERS;
}
+void
+nvc0_upload_tsc0(struct nvc0_context *nvc0)
+{
+ struct nouveau_pushbuf *push = nvc0->base.pushbuf;
+ u32 data[8] = { G80_TSC_0_SRGB_CONVERSION };
+ nvc0->base.push_data(&nvc0->base, nvc0->screen->txc,
+ 65536 /*+ tsc->id * 32*/,
+ NV_VRAM_DOMAIN(&nvc0->screen->base), 32, data);
+ BEGIN_NVC0(push, NVC0_3D(TSC_FLUSH), 1);
+ PUSH_DATA (push, 0);
+}
+
/* Upload the "diagonal" entries for the possible texture sources ($t == $s).
* At some point we might want to get a list of the combinations used by a
* shader and fill in those entries instead of having it extract the handles.