assert(p->screen);
/* create the pipe driver context and cso context */
- p->pipe = p->screen->context_create(p->screen, NULL);
+ p->pipe = p->screen->context_create(p->screen, NULL, 0);
p->cso = cso_create_context(p->pipe);
/* set clear color */
};
p->vbuf = pipe_buffer_create(p->screen, PIPE_BIND_VERTEX_BUFFER,
- PIPE_USAGE_STATIC, sizeof(vertices));
+ PIPE_USAGE_DEFAULT, sizeof(vertices));
pipe_buffer_write(p->pipe, p->vbuf, 0, sizeof(vertices), vertices);
}
/* rasterizer */
memset(&p->rasterizer, 0, sizeof(p->rasterizer));
p->rasterizer.cull_face = PIPE_FACE_NONE;
- p->rasterizer.gl_rasterization_rules = 1;
+ p->rasterizer.half_pixel_center = 1;
+ p->rasterizer.bottom_edge_rule = 1;
p->rasterizer.depth_clip = 1;
surf_tmpl.format = PIPE_FORMAT_B8G8R8A8_UNORM;
p->viewport.scale[0] = half_width;
p->viewport.scale[1] = half_height * scale;
p->viewport.scale[2] = half_depth;
- p->viewport.scale[3] = 1.0f;
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
- p->viewport.translate[3] = 0.0f;
}
/* vertex elements state */
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);
+ p->vs = util_make_vertex_passthrough_shader(p->pipe, 2, semantic_names, semantic_indexes, FALSE);
}
/* fragment shader */
p->fs = util_make_fragment_passthrough_shader(p->pipe,
- TGSI_SEMANTIC_COLOR, TGSI_INTERPOLATE_PERSPECTIVE);
+ TGSI_SEMANTIC_COLOR, TGSI_INTERPOLATE_PERSPECTIVE, TRUE);
}
static void close_prog(struct program *p)
{
- /* unset all state */
- cso_release_all(p->cso);
+ cso_destroy_context(p->cso);
p->pipe->delete_vs_state(p->pipe, p->vs);
p->pipe->delete_fs_state(p->pipe, p->fs);
pipe_resource_reference(&p->target, NULL);
pipe_resource_reference(&p->vbuf, NULL);
- cso_destroy_context(p->cso);
p->pipe->destroy(p->pipe);
p->screen->destroy(p->screen);
pipe_loader_release(&p->dev, 1);