Merge branch '7.8'
[mesa.git] / src / gallium / drivers / nv50 / nv50_state_validate.c
index b7e355283c8ae8fe4910eef5e81a2ec7d2e6fe69..14c3490599dc75d800a5819642f0976862a8b9f0 100644 (file)
@@ -23,6 +23,7 @@
 #include "util/u_format.h"
 
 #include "nv50_context.h"
+#include "nv50_resource.h"
 #include "nouveau/nouveau_stateobj.h"
 
 static struct nouveau_stateobj *
@@ -31,7 +32,7 @@ validate_fb(struct nv50_context *nv50)
        struct nouveau_grobj *tesla = nv50->screen->tesla;
        struct nouveau_stateobj *so = so_new(32, 79, 18);
        struct pipe_framebuffer_state *fb = &nv50->framebuffer;
-       unsigned i, w, h, gw = 0;
+       unsigned i, w = 0, h = 0, gw = 0;
 
        /* Set nr of active RTs and select RT for each colour output.
         * FP result 0 always goes to RT[0], bits 4 - 6 are ignored.
@@ -43,7 +44,7 @@ validate_fb(struct nv50_context *nv50)
                  (4 << 16) | (5 << 19) | (6 << 22) | (7 << 25));
 
        for (i = 0; i < fb->nr_cbufs; i++) {
-               struct pipe_texture *pt = fb->cbufs[i]->texture;
+               struct pipe_resource *pt = fb->cbufs[i]->texture;
                struct nouveau_bo *bo = nv50_miptree(pt)->base.bo;
 
                if (!gw) {
@@ -104,7 +105,7 @@ validate_fb(struct nv50_context *nv50)
        }
 
        if (fb->zsbuf) {
-               struct pipe_texture *pt = fb->zsbuf->texture;
+               struct pipe_resource *pt = fb->zsbuf->texture;
                struct nouveau_bo *bo = nv50_miptree(pt)->base.bo;
 
                if (!gw) {
@@ -122,13 +123,13 @@ validate_fb(struct nv50_context *nv50)
                so_reloc (so, bo, fb->zsbuf->offset, NOUVEAU_BO_VRAM |
                              NOUVEAU_BO_LOW | NOUVEAU_BO_RDWR, 0, 0);
                switch (fb->zsbuf->format) {
-               case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_Z24_UNORM_S8_USCALED:
                        so_data(so, NV50TCL_ZETA_FORMAT_S8Z24_UNORM);
                        break;
                case PIPE_FORMAT_Z24X8_UNORM:
                        so_data(so, NV50TCL_ZETA_FORMAT_X8Z24_UNORM);
                        break;
-               case PIPE_FORMAT_S8Z24_UNORM:
+               case PIPE_FORMAT_S8_USCALED_Z24_UNORM:
                        so_data(so, NV50TCL_ZETA_FORMAT_Z24S8_UNORM);
                        break;
                case PIPE_FORMAT_Z32_FLOAT:
@@ -236,7 +237,7 @@ static struct nouveau_stateobj *
 validate_stencil_ref(struct nv50_context *nv50)
 {
        struct nouveau_grobj *tesla = nv50->screen->tesla;
-       struct nouveau_stateobj *so = so = so_new(2, 2, 0);
+       struct nouveau_stateobj *so = so_new(2, 2, 0);
 
        so_method(so, tesla, NV50TCL_STENCIL_FRONT_FUNC_REF, 1);
        so_data  (so, nv50->stencil_ref.ref_value[0]);