gallium: split depth_clip into depth_clip_near & depth_clip_far
[mesa.git] / src / gallium / tests / trivial / tri.c
index df02e96d85f2531224f59a677d0c86881a429f8f..3827edc0da3761ead2c3669a5bfb50442d20715e 100644 (file)
@@ -27,8 +27,8 @@
 #define USE_TRACE 0
 #define WIDTH 300
 #define HEIGHT 300
-#define NEAR 30
-#define FAR 1000
+#define NEAR 0
+#define FAR 1
 #define FLIP 0
 
 /* pipe_*_state structs */
@@ -91,7 +91,7 @@ static void init_prog(struct program *p)
        assert(ret);
 
        /* init a pipe screen */
-       p->screen = pipe_loader_create_screen(p->dev, 0);
+       p->screen = pipe_loader_create_screen(p->dev);
        assert(p->screen);
 
        /* create the pipe driver context and cso context */
@@ -154,7 +154,8 @@ static void init_prog(struct program *p)
        p->rasterizer.cull_face = PIPE_FACE_NONE;
        p->rasterizer.half_pixel_center = 1;
        p->rasterizer.bottom_edge_rule = 1;
-       p->rasterizer.depth_clip = 1;
+       p->rasterizer.depth_clip_near = 1;
+       p->rasterizer.depth_clip_far = 1;
 
        surf_tmpl.format = PIPE_FORMAT_B8G8R8A8_UNORM;
        surf_tmpl.u.tex.level = 0;
@@ -171,7 +172,7 @@ static void init_prog(struct program *p)
        {
                float x = 0;
                float y = 0;
-               float z = FAR;
+               float z = NEAR;
                float half_width = (float)WIDTH / 2.0f;
                float half_height = (float)HEIGHT / 2.0f;
                float half_depth = ((float)FAR - (float)NEAR) / 2.0f;
@@ -208,10 +209,10 @@ static void init_prog(struct program *p)
 
        /* vertex shader */
        {
-                       const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
-                                                       TGSI_SEMANTIC_COLOR };
-                       const uint semantic_indexes[] = { 0, 0 };
-                       p->vs = util_make_vertex_passthrough_shader(p->pipe, 2, semantic_names, semantic_indexes, FALSE);
+               const enum tgsi_semantic semantic_names[] =
+                       { TGSI_SEMANTIC_POSITION, TGSI_SEMANTIC_COLOR };
+               const uint semantic_indexes[] = { 0, 0 };
+               p->vs = util_make_vertex_passthrough_shader(p->pipe, 2, semantic_names, semantic_indexes, FALSE);
        }
 
        /* fragment shader */