mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
nv40: remove pipe_state struct now.
This commit is contained in:
parent
4058a90127
commit
026e2fd3c6
14 changed files with 58 additions and 61 deletions
|
|
@ -132,32 +132,29 @@ struct nv40_context {
|
|||
|
||||
int chipset;
|
||||
|
||||
unsigned dirty;
|
||||
|
||||
struct nv40_sampler_state *tex_sampler[PIPE_MAX_SAMPLERS];
|
||||
struct nv40_miptree *tex_miptree[PIPE_MAX_SAMPLERS];
|
||||
unsigned dirty_samplers;
|
||||
|
||||
struct {
|
||||
struct pipe_scissor_state scissor;
|
||||
unsigned stipple[32];
|
||||
struct pipe_clip_state clip;
|
||||
struct nv40_vertex_program *vertprog;
|
||||
struct nv40_fragment_program *fragprog;
|
||||
struct pipe_buffer *constbuf[PIPE_SHADER_TYPES];
|
||||
struct nv40_rasterizer_state *rasterizer;
|
||||
struct nv40_zsa_state *zsa;
|
||||
struct nv40_blend_state *blend;
|
||||
struct pipe_blend_color blend_colour;
|
||||
struct pipe_viewport_state viewport;
|
||||
struct pipe_framebuffer_state framebuffer;
|
||||
struct pipe_buffer *idxbuf;
|
||||
unsigned idxbuf_format;
|
||||
} pipe_state;
|
||||
|
||||
/* HW state derived from pipe states */
|
||||
struct nv40_state state;
|
||||
unsigned fallback;
|
||||
|
||||
/* Context state */
|
||||
unsigned dirty;
|
||||
struct pipe_scissor_state scissor;
|
||||
unsigned stipple[32];
|
||||
struct pipe_clip_state clip;
|
||||
struct nv40_vertex_program *vertprog;
|
||||
struct nv40_fragment_program *fragprog;
|
||||
struct pipe_buffer *constbuf[PIPE_SHADER_TYPES];
|
||||
struct nv40_rasterizer_state *rasterizer;
|
||||
struct nv40_zsa_state *zsa;
|
||||
struct nv40_blend_state *blend;
|
||||
struct pipe_blend_color blend_colour;
|
||||
struct pipe_viewport_state viewport;
|
||||
struct pipe_framebuffer_state framebuffer;
|
||||
struct pipe_buffer *idxbuf;
|
||||
unsigned idxbuf_format;
|
||||
struct nv40_sampler_state *tex_sampler[PIPE_MAX_SAMPLERS];
|
||||
struct nv40_miptree *tex_miptree[PIPE_MAX_SAMPLERS];
|
||||
unsigned dirty_samplers;
|
||||
struct pipe_vertex_buffer vtxbuf[PIPE_ATTRIB_MAX];
|
||||
struct pipe_vertex_element vtxelt[PIPE_ATTRIB_MAX];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -790,9 +790,9 @@ nv40_fragprog_upload(struct nv40_context *nv40,
|
|||
static boolean
|
||||
nv40_fragprog_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct nv40_fragment_program *fp = nv40->pipe_state.fragprog;
|
||||
struct nv40_fragment_program *fp = nv40->fragprog;
|
||||
struct pipe_buffer *constbuf =
|
||||
nv40->pipe_state.constbuf[PIPE_SHADER_FRAGMENT];
|
||||
nv40->constbuf[PIPE_SHADER_FRAGMENT];
|
||||
struct pipe_winsys *ws = nv40->pipe.winsys;
|
||||
struct nouveau_stateobj *so;
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ nv40_fragtex_build(struct nv40_context *nv40, int unit)
|
|||
static boolean
|
||||
nv40_fragtex_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct nv40_fragment_program *fp = nv40->pipe_state.fragprog;
|
||||
struct nv40_fragment_program *fp = nv40->fragprog;
|
||||
struct nv40_state *state = &nv40->state;
|
||||
struct nouveau_stateobj *so;
|
||||
unsigned samplers, unit;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ nv40_blend_state_bind(struct pipe_context *pipe, void *hwcso)
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.blend = hwcso;
|
||||
nv40->blend = hwcso;
|
||||
nv40->dirty |= NV40_NEW_BLEND;
|
||||
}
|
||||
|
||||
|
|
@ -399,7 +399,7 @@ nv40_rasterizer_state_bind(struct pipe_context *pipe, void *hwcso)
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.rasterizer = hwcso;
|
||||
nv40->rasterizer = hwcso;
|
||||
nv40->dirty |= NV40_NEW_RAST;
|
||||
}
|
||||
|
||||
|
|
@ -470,7 +470,7 @@ nv40_depth_stencil_alpha_state_bind(struct pipe_context *pipe, void *hwcso)
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.zsa = hwcso;
|
||||
nv40->zsa = hwcso;
|
||||
nv40->dirty |= NV40_NEW_ZSA;
|
||||
}
|
||||
|
||||
|
|
@ -500,7 +500,7 @@ nv40_vp_state_bind(struct pipe_context *pipe, void *hwcso)
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.vertprog = hwcso;
|
||||
nv40->vertprog = hwcso;
|
||||
nv40->dirty |= NV40_NEW_VERTPROG;
|
||||
}
|
||||
|
||||
|
|
@ -531,7 +531,7 @@ nv40_fp_state_bind(struct pipe_context *pipe, void *hwcso)
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.fragprog = hwcso;
|
||||
nv40->fragprog = hwcso;
|
||||
nv40->dirty |= NV40_NEW_FRAGPROG;
|
||||
}
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ nv40_set_blend_color(struct pipe_context *pipe,
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.blend_colour = *bcol;
|
||||
nv40->blend_colour = *bcol;
|
||||
nv40->dirty |= NV40_NEW_BCOL;
|
||||
}
|
||||
|
||||
|
|
@ -561,7 +561,7 @@ nv40_set_clip_state(struct pipe_context *pipe,
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.clip = *clip;
|
||||
nv40->clip = *clip;
|
||||
nv40->dirty |= NV40_NEW_UCP;
|
||||
}
|
||||
|
||||
|
|
@ -572,11 +572,11 @@ nv40_set_constant_buffer(struct pipe_context *pipe, uint shader, uint index,
|
|||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
if (shader == PIPE_SHADER_VERTEX) {
|
||||
nv40->pipe_state.constbuf[PIPE_SHADER_VERTEX] = buf->buffer;
|
||||
nv40->constbuf[PIPE_SHADER_VERTEX] = buf->buffer;
|
||||
nv40->dirty |= NV40_NEW_VERTPROG;
|
||||
} else
|
||||
if (shader == PIPE_SHADER_FRAGMENT) {
|
||||
nv40->pipe_state.constbuf[PIPE_SHADER_FRAGMENT] = buf->buffer;
|
||||
nv40->constbuf[PIPE_SHADER_FRAGMENT] = buf->buffer;
|
||||
nv40->dirty |= NV40_NEW_FRAGPROG;
|
||||
}
|
||||
}
|
||||
|
|
@ -587,7 +587,7 @@ nv40_set_framebuffer_state(struct pipe_context *pipe,
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.framebuffer = *fb;
|
||||
nv40->framebuffer = *fb;
|
||||
nv40->dirty |= NV40_NEW_FB;
|
||||
}
|
||||
|
||||
|
|
@ -597,7 +597,7 @@ nv40_set_polygon_stipple(struct pipe_context *pipe,
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
memcpy(nv40->pipe_state.stipple, stipple->stipple, 4 * 32);
|
||||
memcpy(nv40->stipple, stipple->stipple, 4 * 32);
|
||||
nv40->dirty |= NV40_NEW_STIPPLE;
|
||||
}
|
||||
|
||||
|
|
@ -607,7 +607,7 @@ nv40_set_scissor_state(struct pipe_context *pipe,
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.scissor = *s;
|
||||
nv40->scissor = *s;
|
||||
nv40->dirty |= NV40_NEW_SCISSOR;
|
||||
}
|
||||
|
||||
|
|
@ -617,7 +617,7 @@ nv40_set_viewport_state(struct pipe_context *pipe,
|
|||
{
|
||||
struct nv40_context *nv40 = nv40_context(pipe);
|
||||
|
||||
nv40->pipe_state.viewport = *vpt;
|
||||
nv40->viewport = *vpt;
|
||||
nv40->dirty |= NV40_NEW_VIEWPORT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
static boolean
|
||||
nv40_state_blend_validate(struct nv40_context *nv40)
|
||||
{
|
||||
so_ref(nv40->pipe_state.blend->so, &nv40->state.hw[NV40_STATE_BLEND]);
|
||||
so_ref(nv40->blend->so, &nv40->state.hw[NV40_STATE_BLEND]);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ static boolean
|
|||
nv40_state_blend_colour_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct nouveau_stateobj *so = so_new(2, 0);
|
||||
struct pipe_blend_color *bcol = &nv40->pipe_state.blend_colour;
|
||||
struct pipe_blend_color *bcol = &nv40->blend_colour;
|
||||
|
||||
so_method(so, nv40->hw->curie, NV40TCL_BLEND_COLOR, 1);
|
||||
so_data (so, ((float_to_ubyte(bcol->color[3]) << 24) |
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
static boolean
|
||||
nv40_state_clip_validate(struct nv40_context *nv40)
|
||||
{
|
||||
if (nv40->pipe_state.clip.nr)
|
||||
if (nv40->clip.nr)
|
||||
nv40->fallback |= NV40_FALLBACK_TNL;
|
||||
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
static boolean
|
||||
nv40_state_framebuffer_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct pipe_framebuffer_state *fb = &nv40->pipe_state.framebuffer;
|
||||
struct pipe_framebuffer_state *fb = &nv40->framebuffer;
|
||||
struct pipe_surface *rt[4], *zeta;
|
||||
uint32_t rt_enable, rt_format, w, h;
|
||||
int i, colour_format = 0, zeta_format = 0;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
static boolean
|
||||
nv40_state_rasterizer_validate(struct nv40_context *nv40)
|
||||
{
|
||||
so_ref(nv40->pipe_state.rasterizer->so,
|
||||
so_ref(nv40->rasterizer->so,
|
||||
&nv40->state.hw[NV40_STATE_RAST]);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
static boolean
|
||||
nv40_state_scissor_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct pipe_rasterizer_state *rast = &nv40->pipe_state.rasterizer->pipe;
|
||||
struct pipe_scissor_state *s = &nv40->pipe_state.scissor;
|
||||
struct pipe_rasterizer_state *rast = &nv40->rasterizer->pipe;
|
||||
struct pipe_scissor_state *s = &nv40->scissor;
|
||||
struct nouveau_stateobj *so;
|
||||
|
||||
if (nv40->state.hw[NV40_STATE_SCISSOR] &&
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
static boolean
|
||||
nv40_state_stipple_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct pipe_rasterizer_state *rast = &nv40->pipe_state.rasterizer->pipe;
|
||||
struct pipe_rasterizer_state *rast = &nv40->rasterizer->pipe;
|
||||
struct nouveau_grobj *curie = nv40->hw->curie;
|
||||
struct nouveau_stateobj *so;
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ nv40_state_stipple_validate(struct nv40_context *nv40)
|
|||
so_data (so, 1);
|
||||
so_method(so, curie, NV40TCL_POLYGON_STIPPLE_PATTERN(0), 32);
|
||||
for (i = 0; i < 32; i++)
|
||||
so_data(so, nv40->pipe_state.stipple[i]);
|
||||
so_data(so, nv40->stipple[i]);
|
||||
} else {
|
||||
so = so_new(2, 0);
|
||||
so_method(so, curie, NV40TCL_POLYGON_STIPPLE_ENABLE, 1);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ static boolean
|
|||
nv40_state_viewport_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct nouveau_stateobj *so = so_new(9, 0);
|
||||
struct pipe_viewport_state *vpt = &nv40->pipe_state.viewport;
|
||||
struct pipe_viewport_state *vpt = &nv40->viewport;
|
||||
|
||||
so_method(so, nv40->hw->curie, NV40TCL_VIEWPORT_TRANSLATE_X, 8);
|
||||
so_data (so, fui(vpt->translate[0]));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
static boolean
|
||||
nv40_state_zsa_validate(struct nv40_context *nv40)
|
||||
{
|
||||
so_ref(nv40->pipe_state.zsa->so,
|
||||
so_ref(nv40->zsa->so,
|
||||
&nv40->state.hw[NV40_STATE_ZSA]);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ nv40_vbo_set_idxbuf(struct nv40_context *nv40, struct pipe_buffer *ib,
|
|||
unsigned type;
|
||||
|
||||
if (!ib) {
|
||||
nv40->pipe_state.idxbuf = NULL;
|
||||
nv40->pipe_state.idxbuf_format = 0xdeadbeef;
|
||||
nv40->idxbuf = NULL;
|
||||
nv40->idxbuf_format = 0xdeadbeef;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -66,11 +66,11 @@ nv40_vbo_set_idxbuf(struct nv40_context *nv40, struct pipe_buffer *ib,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (ib != nv40->pipe_state.idxbuf ||
|
||||
type != nv40->pipe_state.idxbuf_format) {
|
||||
if (ib != nv40->idxbuf ||
|
||||
type != nv40->idxbuf_format) {
|
||||
nv40->dirty |= NV40_NEW_ARRAYS;
|
||||
nv40->pipe_state.idxbuf = ib;
|
||||
nv40->pipe_state.idxbuf_format = type;
|
||||
nv40->idxbuf = ib;
|
||||
nv40->idxbuf_format = type;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -348,10 +348,10 @@ nv40_draw_elements(struct pipe_context *pipe,
|
|||
static boolean
|
||||
nv40_vbo_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct nv40_vertex_program *vp = nv40->pipe_state.vertprog;
|
||||
struct nv40_vertex_program *vp = nv40->vertprog;
|
||||
struct nouveau_stateobj *vtxbuf, *vtxfmt;
|
||||
struct pipe_buffer *ib = nv40->pipe_state.idxbuf;
|
||||
unsigned ib_format = nv40->pipe_state.idxbuf_format;
|
||||
struct pipe_buffer *ib = nv40->idxbuf;
|
||||
unsigned ib_format = nv40->idxbuf_format;
|
||||
unsigned inputs, hw, num_hw;
|
||||
unsigned vb_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD;
|
||||
|
||||
|
|
|
|||
|
|
@ -634,9 +634,9 @@ out_err:
|
|||
static boolean
|
||||
nv40_vertprog_validate(struct nv40_context *nv40)
|
||||
{
|
||||
struct nv40_vertex_program *vp = nv40->pipe_state.vertprog;
|
||||
struct nv40_vertex_program *vp = nv40->vertprog;
|
||||
struct pipe_buffer *constbuf =
|
||||
nv40->pipe_state.constbuf[PIPE_SHADER_VERTEX];
|
||||
nv40->constbuf[PIPE_SHADER_VERTEX];
|
||||
struct nouveau_winsys *nvws = nv40->nvws;
|
||||
struct pipe_winsys *ws = nv40->pipe.winsys;
|
||||
boolean upload_code = FALSE, upload_data = FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue