#define NOUVEAU_CAP_HW_IDXBUF (0xbeef0001)
#define NOUVEAU_BUFFER_USAGE_TEXTURE (1 << 16)
+#define NOUVEAU_BUFFER_USAGE_ZETA (1 << 17)
struct nouveau_winsys {
struct nouveau_context *nv;
{
struct pipe_winsys *ws = pscreen->winsys;
struct nv50_miptree *mt = CALLOC_STRUCT(nv50_miptree);
+ unsigned usage;
NOUVEAU_ERR("unimplemented\n");
mt->base.refcount = 1;
mt->base.screen = pscreen;
- mt->buffer = ws->buffer_create(ws, 256, PIPE_BUFFER_USAGE_PIXEL,
+ usage = PIPE_BUFFER_USAGE_PIXEL;
+ switch (pt->format) {
+ case PIPE_FORMAT_Z24S8_UNORM:
+ case PIPE_FORMAT_Z16_UNORM:
+ usage |= NOUVEAU_BUFFER_USAGE_ZETA;
+ break;
+ default:
+ break;
+ }
+
+ mt->buffer = ws->buffer_create(ws, 256, usage,
pt->width[0] * pt->cpp * pt->height[0]);
if (!mt->buffer) {
FREE(mt);
so_data (so, 0xffffffff);
}
+ so_method(so, screen->tesla, NV50TCL_DEPTH_RANGE_NEAR, 2);
+ so_data (so, fui(0.0));
+ so_data (so, fui(1.0));
+
so_emit(nvws, so);
so_ref(NULL, &so);
nvws->push_flush(nvws, 0, NULL);
struct nouveau_stateobj *so = so_new(64, 0);
so_method(so, tesla, NV50TCL_DEPTH_WRITE_ENABLE, 1);
- so_data (so, 0); //cso->depth.writemask ? 1 : 0);
- if (0 && cso->depth.enabled) {
+ so_data (so, cso->depth.writemask ? 1 : 0);
+ if (cso->depth.enabled) {
so_method(so, tesla, NV50TCL_DEPTH_TEST_ENABLE, 1);
so_data (so, 1);
so_method(so, tesla, NV50TCL_DEPTH_TEST_FUNC, 1);
case PIPE_FORMAT_Z24S8_UNORM:
so_data(so, 0x16);
break;
+ case PIPE_FORMAT_Z16_UNORM:
+ so_data(so, 0x15);
+ break;
default:
{
char fmt[128];
}
so_data(so, 0x00000040);
so_data(so, 0x00000000);
+
+ so_method(so, tesla, 0x1538, 1);
+ so_data (so, 1);
+ so_method(so, tesla, 0x1228, 3);
+ so_data (so, fb->zsbuf->width);
+ so_data (so, fb->zsbuf->height);
+ so_data (so, 0x00010001);
}
so_method(so, tesla, NV50TCL_VIEWPORT_HORIZ, 2);