static void
nv40_blend_state_bind(struct pipe_context *pipe, void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_blend_state *cb = hwcso;
BEGIN_RING(curie, NV40TCL_DITHER_ENABLE, 1);
nv40_sampler_state_bind(struct pipe_context *pipe, unsigned unit,
void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_sampler_state *ps = hwcso;
nv40->tex_sampler[unit] = ps;
nv40_set_sampler_texture(struct pipe_context *pipe, unsigned unit,
struct pipe_texture *miptree)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
nv40->tex_miptree[unit] = (struct nv40_miptree *)miptree;
nv40->dirty_samplers |= (1 << unit);
static void
nv40_rasterizer_state_bind(struct pipe_context *pipe, void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_rasterizer_state *rs = hwcso;
BEGIN_RING(curie, NV40TCL_SHADE_MODEL, 1);
static void
nv40_depth_stencil_alpha_state_bind(struct pipe_context *pipe, void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_depth_stencil_alpha_state *hw = hwcso;
BEGIN_RING(curie, NV40TCL_DEPTH_FUNC, 3);
static void
nv40_vp_state_bind(struct pipe_context *pipe, void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_vertex_program *vp = hwcso;
nv40->vertprog.current = vp;
static void
nv40_vp_state_delete(struct pipe_context *pipe, void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_vertex_program *vp = hwcso;
nv40_vertprog_destroy(nv40, vp);
static void
nv40_fp_state_bind(struct pipe_context *pipe, void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_fragment_program *fp = hwcso;
nv40->fragprog.current = fp;
static void
nv40_fp_state_delete(struct pipe_context *pipe, void *hwcso)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nv40_fragment_program *fp = hwcso;
nv40_fragprog_destroy(nv40, fp);
nv40_set_blend_color(struct pipe_context *pipe,
const struct pipe_blend_color *bcol)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
BEGIN_RING(curie, NV40TCL_BLEND_COLOR, 1);
OUT_RING ((float_to_ubyte(bcol->color[3]) << 24) |
nv40_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
const struct pipe_constant_buffer *buf )
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
if (shader == PIPE_SHADER_VERTEX) {
nv40->vertprog.constant_buf = buf->buffer;
nv40_set_framebuffer_state(struct pipe_context *pipe,
const struct pipe_framebuffer_state *fb)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct pipe_surface *rt[4], *zeta;
uint32_t rt_enable, rt_format, w, h;
int i, colour_format = 0, zeta_format = 0;
nv40_set_polygon_stipple(struct pipe_context *pipe,
const struct pipe_poly_stipple *stipple)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
BEGIN_RING(curie, NV40TCL_POLYGON_STIPPLE_PATTERN(0), 32);
OUT_RINGp ((uint32_t *)stipple->stipple, 32);
nv40_set_scissor_state(struct pipe_context *pipe,
const struct pipe_scissor_state *s)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
BEGIN_RING(curie, NV40TCL_SCISSOR_HORIZ, 2);
OUT_RING (((s->maxx - s->minx) << 16) | s->minx);
nv40_set_viewport_state(struct pipe_context *pipe,
const struct pipe_viewport_state *vpt)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
BEGIN_RING(curie, NV40TCL_VIEWPORT_TRANSLATE_X, 8);
OUT_RINGf (vpt->translate[0]);
nv40_set_vertex_buffer(struct pipe_context *pipe, unsigned index,
const struct pipe_vertex_buffer *vb)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
nv40->vtxbuf[index] = *vb;
nv40_set_vertex_element(struct pipe_context *pipe, unsigned index,
const struct pipe_vertex_element *ve)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
nv40->vtxelt[index] = *ve;
unsigned src_stride, unsigned srcx, unsigned srcy,
unsigned width, unsigned height)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nouveau_winsys *nvws = nv40->nvws;
nvws->surface_data(nvws, dest, destx, desty, src, src_stride,
unsigned destx, unsigned desty, struct pipe_surface *src,
unsigned srcx, unsigned srcy, unsigned width, unsigned height)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nouveau_winsys *nvws = nv40->nvws;
nvws->surface_copy(nvws, dest, destx, desty, src, srcx, srcy,
unsigned destx, unsigned desty, unsigned width,
unsigned height, unsigned value)
{
- struct nv40_context *nv40 = (struct nv40_context *)pipe;
+ struct nv40_context *nv40 = nv40_context(pipe);
struct nouveau_winsys *nvws = nv40->nvws;
nvws->surface_fill(nvws, dest, destx, desty, width, height, value);