gallium: fill in some blend/rasterizer template fields to make sure they're all valid...
authorBrian <brian.paul@tungstengraphics.com>
Thu, 21 Feb 2008 19:32:38 +0000 (12:32 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 21 Feb 2008 19:33:30 +0000 (12:33 -0700)
src/mesa/state_tracker/st_gen_mipmap.c

index a0b4b973aa68fc0d4e03df105dc07ce5e5f866c0..c9765b20036ac993abd99fbdabce05d643ed2940 100644 (file)
@@ -111,14 +111,22 @@ st_init_generate_mipmap(struct st_context *st)
    struct pipe_rasterizer_state rasterizer;
    struct pipe_depth_stencil_alpha_state depthstencil;
 
+   /* we don't use blending, but need to set valid values */
    memset(&blend, 0, sizeof(blend));
+   blend.rgb_src_factor = PIPE_BLENDFACTOR_ONE;
+   blend.alpha_src_factor = PIPE_BLENDFACTOR_ONE;
+   blend.rgb_dst_factor = PIPE_BLENDFACTOR_ZERO;
+   blend.alpha_dst_factor = PIPE_BLENDFACTOR_ZERO;
    blend.colormask = PIPE_MASK_RGBA;
    st->gen_mipmap.blend_cso = pipe->create_blend_state(pipe, &blend);
 
    memset(&depthstencil, 0, sizeof(depthstencil));
    st->gen_mipmap.depthstencil_cso = pipe->create_depth_stencil_alpha_state(pipe, &depthstencil);
 
+   /* Note: we're assuming zero is valid for all non-specified fields */
    memset(&rasterizer, 0, sizeof(rasterizer));
+   rasterizer.front_winding = PIPE_WINDING_CW;
+   rasterizer.cull_mode = PIPE_WINDING_NONE;
    st->gen_mipmap.rasterizer_cso = pipe->create_rasterizer_state(pipe, &rasterizer);
 
    st->gen_mipmap.stfp = make_tex_fragment_program(st->ctx);