st/xorg: bind rasterizer state
[mesa.git] / src / gallium / state_trackers / g3dvl / vl_context.c
index fe107e406daaacde5a631e2335ea2ac487d70186..5cfd233c4c100cbde0cc4aa587bffe774c426719 100644 (file)
@@ -1,11 +1,10 @@
 #define VL_INTERNAL
 #include "vl_context.h"
 #include <assert.h>
-#include <stdlib.h>
 #include <pipe/p_context.h>
 #include <pipe/p_state.h>
+#include <util/u_memory.h>
 #include "vl_render.h"
-#include "vl_r16snorm_mc.h"
 #include "vl_r16snorm_mc_buf.h"
 #include "vl_csc.h"
 #include "vl_basic_csc.h"
@@ -42,10 +41,7 @@ static int vlInitCommon(struct vlContext *context)
        rast.line_stipple_factor = 0;
        rast.line_stipple_pattern = 0;
        rast.line_last_pixel = 0;
-       /* Don't need clipping, but viewport mapping done here */
-       rast.bypass_clipping = 0;
-       rast.bypass_vs = 0;
-       rast.origin_lower_left = 0;
+       rast.bypass_vs_clip_and_viewport = 0;
        rast.line_width = 1;
        rast.point_smooth = 0;
        rast.point_size = 1;
@@ -82,12 +78,12 @@ static int vlInitCommon(struct vlContext *context)
                dsa.stencil[i].zpass_op = PIPE_STENCIL_OP_KEEP;
                dsa.stencil[i].zfail_op = PIPE_STENCIL_OP_KEEP;
                dsa.stencil[i].ref_value = 0;
-               dsa.stencil[i].value_mask = 0;
-               dsa.stencil[i].write_mask = 0;
+               dsa.stencil[i].valuemask = 0;
+               dsa.stencil[i].writemask = 0;
        }
        dsa.alpha.enabled = 0;
        dsa.alpha.func = PIPE_FUNC_ALWAYS;
-       dsa.alpha.ref = 0;
+       dsa.alpha.ref_value = 0;
        context->dsa = pipe->create_depth_stencil_alpha_state(pipe, &dsa);
        pipe->bind_depth_stencil_alpha_state(pipe, context->dsa);
 
@@ -112,7 +108,7 @@ int vlCreateContext
        assert(context);
        assert(pipe);
 
-       ctx = calloc(1, sizeof(struct vlContext));
+       ctx = CALLOC_STRUCT(vlContext);
 
        if (!ctx)
                return 1;
@@ -127,7 +123,6 @@ int vlCreateContext
 
        vlInitCommon(ctx);
 
-       /*vlCreateR16SNormMC(pipe, picture_width, picture_height, picture_format, &ctx->render);*/
        vlCreateR16SNormBufferedMC(pipe, picture_width, picture_height, picture_format, &ctx->render);
        vlCreateBasicCSC(pipe, &ctx->csc);
 
@@ -154,7 +149,7 @@ int vlDestroyContext
        context->pipe->delete_rasterizer_state(context->pipe, context->raster);
        context->pipe->delete_depth_stencil_alpha_state(context->pipe, context->dsa);
 
-       free(context);
+       FREE(context);
 
        return 0;
 }