#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 */
/* u_sampler_view_default_template */
#include "util/u_sampler.h"
/* debug_dump_surface_bmp */
-#include "util/u_debug.h"
+#include "util/u_debug_image.h"
/* util_draw_vertex_buffer helper */
#include "util/u_draw_quad.h"
/* FREE & CALLOC_STRUCT */
assert(ret);
/* init a pipe screen */
- p->screen = pipe_loader_create_screen(p->dev, PIPE_SEARCH_DIR);
+ p->screen = pipe_loader_create_screen(p->dev);
assert(p->screen);
/* create the pipe driver context and cso context */
- p->pipe = p->screen->context_create(p->screen, NULL);
- p->cso = cso_create_context(p->pipe);
+ p->pipe = p->screen->context_create(p->screen, NULL, 0);
+ p->cso = cso_create_context(p->pipe, 0);
/* set clear color */
p->clear_color.f[0] = 0.3;
memset(&box, 0, sizeof(box));
box.width = 2;
box.height = 2;
+ box.depth = 1;
ptr = p->pipe->transfer_map(p->pipe, p->tex, 0, PIPE_TRANSFER_WRITE, &box, &t);
ptr[0] = 0xffff0000;
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;
/* sampler */
memset(&p->sampler, 0, sizeof(p->sampler));
{
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;
/* vertex shader */
{
- const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
- TGSI_SEMANTIC_GENERIC };
+ const enum tgsi_semantic semantic_names[] =
+ { TGSI_SEMANTIC_POSITION, TGSI_SEMANTIC_GENERIC };
const uint semantic_indexes[] = { 0, 0 };
p->vs = util_make_vertex_passthrough_shader(p->pipe, 2, semantic_names, semantic_indexes, FALSE);
}
/* fragment shader */
p->fs = util_make_fragment_tex_shader(p->pipe, TGSI_TEXTURE_2D,
TGSI_INTERPOLATE_LINEAR,
- TGSI_RETURN_TYPE_FLOAT);
+ TGSI_RETURN_TYPE_FLOAT,
+ TGSI_RETURN_TYPE_FLOAT, false,
+ false);
}
static void close_prog(struct program *p)