i965/nir: Do not scalarize phis in non-scalar setups
[mesa.git] / src / mesa / drivers / dri / nouveau / nv10_context.c
index 90c1545ce37240b81cd3e68d9a047554682dfc0a..00a935880e0851eb79d75770e36b82de777a393d 100644 (file)
@@ -63,7 +63,7 @@ nv10_use_viewport_zclear(struct gl_context *ctx)
        struct gl_framebuffer *fb = ctx->DrawBuffer;
        struct gl_renderbuffer *depthRb = fb->Attachment[BUFFER_DEPTH].Renderbuffer;
 
-       return context_chipset(ctx) < 0x17 &&
+       return context_eng3d(ctx)->oclass < NV17_3D_CLASS &&
                !nctx->hierz.clear_blocked && depthRb &&
                (_mesa_get_format_bits(depthRb->Format,
                                       GL_DEPTH_BITS) >= 24);
@@ -184,7 +184,7 @@ nv10_clear(struct gl_context *ctx, GLbitfield buffers)
        }
 
        if ((buffers & BUFFER_BIT_DEPTH) && ctx->Depth.Mask) {
-               if (context_chipset(ctx) >= 0x17)
+               if (context_eng3d(ctx)->oclass >= NV17_3D_CLASS)
                        nv17_zclear(ctx, &buffers);
                else
                        nv10_zclear(ctx, &buffers);
@@ -245,7 +245,7 @@ nv10_hwctx_init(struct gl_context *ctx)
        BEGIN_NV04(push, NV04_GRAPH(3D, NOP), 1);
        PUSH_DATA (push, 0);
 
-       if (context_chipset(ctx) >= 0x17) {
+       if (context_eng3d(ctx)->oclass >= NV17_3D_CLASS) {
                BEGIN_NV04(push, NV17_3D(UNK01AC), 2);
                PUSH_DATA (push, fifo->vram);
                PUSH_DATA (push, fifo->vram);
@@ -257,7 +257,7 @@ nv10_hwctx_init(struct gl_context *ctx)
                PUSH_DATA (push, 1);
        }
 
-       if (context_chipset(ctx) >= 0x11) {
+       if (context_eng3d(ctx)->oclass >= NV15_3D_CLASS) {
                BEGIN_NV04(push, SUBC_3D(0x120), 3);
                PUSH_DATA (push, 0);
                PUSH_DATA (push, 1);
@@ -423,11 +423,12 @@ nv10_context_destroy(struct gl_context *ctx)
        nouveau_object_del(&nctx->hw.eng3d);
 
        nouveau_context_deinit(ctx);
-       FREE(ctx);
+       free(ctx);
 }
 
 static struct gl_context *
-nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visual,
+nv10_context_create(struct nouveau_screen *screen, gl_api api,
+                   const struct gl_config *visual,
                    struct gl_context *share_ctx)
 {
        struct nouveau_context *nctx;
@@ -441,7 +442,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
 
        ctx = &nctx->base;
 
-       if (!nouveau_context_init(ctx, screen, visual, share_ctx))
+       if (!nouveau_context_init(ctx, api, screen, visual, share_ctx))
                goto fail;
 
        ctx->Extensions.ARB_texture_env_crossbar = true;
@@ -449,11 +450,15 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
        ctx->Extensions.ARB_texture_env_dot3 = true;
        ctx->Extensions.NV_fog_distance = true;
        ctx->Extensions.NV_texture_rectangle = true;
+       if (ctx->Mesa_DXTn) {
+               ctx->Extensions.EXT_texture_compression_s3tc = true;
+               ctx->Extensions.ANGLE_texture_compression_dxt = true;
+       }
 
        /* GL constants. */
        ctx->Const.MaxTextureLevels = 12;
        ctx->Const.MaxTextureCoordUnits = NV10_TEXTURE_UNITS;
-       ctx->Const.MaxTextureImageUnits = NV10_TEXTURE_UNITS;
+       ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits = NV10_TEXTURE_UNITS;
        ctx->Const.MaxTextureUnits = NV10_TEXTURE_UNITS;
        ctx->Const.MaxTextureMaxAnisotropy = 2;
        ctx->Const.MaxTextureLodBias = 15;
@@ -465,7 +470,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
                goto fail;
 
        /* 3D engine. */
-       if (context_chipset(ctx) >= 0x17)
+       if (context_chipset(ctx) >= 0x17 && context_chipset(ctx) != 0x1a)
                celsius_class = NV17_3D_CLASS;
        else if (context_chipset(ctx) >= 0x11)
                celsius_class = NV15_3D_CLASS;