Exemplo n.º 1
0
static void nv04Hint(GLcontext *ctx, GLenum target, GLenum mode)
{
	switch(target)
	{
		case GL_PERSPECTIVE_CORRECTION_HINT:nv04_emit_blend(ctx);break;
		default:break;
	}
}
Exemplo n.º 2
0
void
nv04_emit_hw_state(struct nv04_context *nv04)
{
	int i;

	if (nv04->dirty & NV04_NEW_VERTPROG) {
		//nv04_vertprog_bind(nv04, nv04->vertprog.current);
		nv04->dirty &= ~NV04_NEW_VERTPROG;
	}

	if (nv04->dirty & NV04_NEW_FRAGPROG) {
		nv04_fragprog_bind(nv04, nv04->fragprog.current);
		nv04->dirty &= ~NV04_NEW_FRAGPROG;
		nv04->dirty_samplers |= (1<<10);
		nv04->dirty_samplers = 0;
	}

	if (nv04->dirty & NV04_NEW_CONTROL) {
		nv04->dirty &= ~NV04_NEW_CONTROL;

		BEGIN_RING(fahrenheit, NV04_DX5_TEXTURED_TRIANGLE_CONTROL, 1);
		OUT_RING(nv04->dsa->control);
	}

	if (nv04->dirty & NV04_NEW_BLEND) {
		nv04->dirty &= ~NV04_NEW_BLEND;

		nv04_emit_blend(nv04);
	}

	if (nv04->dirty & NV04_NEW_VTXARRAYS) {
		nv04->dirty &= ~NV04_NEW_VTXARRAYS;
		nv04_vertex_layout(nv04);
	}

	if (nv04->dirty & NV04_NEW_SAMPLER) {
		nv04->dirty &= ~NV04_NEW_SAMPLER;

		nv04_emit_sampler(nv04, 0);
	}

	if (nv04->dirty & NV04_NEW_VIEWPORT) {
		nv04->dirty &= ~NV04_NEW_VIEWPORT;
//		nv04_state_emit_viewport(nv04);
	}

 	if (nv04->dirty & NV04_NEW_FRAMEBUFFER) {
		nv04->dirty &= ~NV04_NEW_FRAMEBUFFER;
		nv04_state_emit_framebuffer(nv04);
	}

	/* Emit relocs for every referenced buffer.
	 * This is to ensure the bufmgr has an accurate idea of how
	 * the buffer is used.  This isn't very efficient, but we don't
	 * seem to take a significant performance hit.  Will be improved
	 * at some point.  Vertex arrays are emitted by nv04_vbo.c
	 */

	/* Render target */
	unsigned rt_pitch = ((struct nv04_surface *)nv04->rt)->pitch;
	unsigned zeta_pitch = ((struct nv04_surface *)nv04->zeta)->pitch;

	BEGIN_RING(context_surfaces_3d, NV04_CONTEXT_SURFACES_3D_PITCH, 2);
	OUT_RING(rt_pitch|(zeta_pitch<<16));
	OUT_RELOCl(nv04->rt, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
	if (nv04->zeta) {
		BEGIN_RING(context_surfaces_3d, NV04_CONTEXT_SURFACES_3D_OFFSET_ZETA, 1);
		OUT_RELOCl(nv04->zeta, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR);
	}

	/* Texture images */
	for (i = 0; i < 1; i++) {
		if (!(nv04->fp_samplers & (1 << i)))
			continue;
		struct nv04_miptree *nv04mt = nv04->tex_miptree[i];
		BEGIN_RING(fahrenheit, NV04_DX5_TEXTURED_TRIANGLE_OFFSET, 2);
		OUT_RELOCl(nv04mt->buffer, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RD);
		OUT_RELOCd(nv04mt->buffer, (nv04->fragtex.format | nv04->sampler[i]->format), NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_OR | NOUVEAU_BO_RD, 1/*VRAM*/,2/*TT*/);
	}
}
Exemplo n.º 3
0
/** Select flat or smooth shading */
static void nv04ShadeModel(GLcontext *ctx, GLenum mode)
{
	nv04_emit_blend(ctx);
}
Exemplo n.º 4
0
static void nv04Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
{
	nv04_emit_blend(ctx);
	nv04_emit_fog_color(ctx);
}
Exemplo n.º 5
0
static void nv04Enable(GLcontext *ctx, GLenum cap, GLboolean state)
{
	switch(cap)
	{
		case GL_ALPHA_TEST:
			nv04_emit_control(ctx);
			break;
//		case GL_AUTO_NORMAL:
		case GL_BLEND:
			nv04_emit_blend(ctx);
			break;
//		case GL_CLIP_PLANE0:
//		case GL_CLIP_PLANE1:
//		case GL_CLIP_PLANE2:
//		case GL_CLIP_PLANE3:
//		case GL_CLIP_PLANE4:
//		case GL_CLIP_PLANE5:
//		case GL_COLOR_LOGIC_OP:
//		case GL_COLOR_MATERIAL:
//		case GL_COLOR_SUM_EXT:
//		case GL_COLOR_TABLE:
//		case GL_CONVOLUTION_1D:
//		case GL_CONVOLUTION_2D:
		case GL_CULL_FACE:
			nv04_emit_control(ctx);
			break;
		case GL_DEPTH_TEST:
			nv04_emit_control(ctx);
			break;
		case GL_DITHER:
			nv04_emit_control(ctx);
			break;
		case GL_FOG:
			nv04_emit_blend(ctx);
			nv04_emit_fog_color(ctx);
			break;
//		case GL_HISTOGRAM:
//		case GL_INDEX_LOGIC_OP:
//		case GL_LIGHT0:
//		case GL_LIGHT1:
//		case GL_LIGHT2:
//		case GL_LIGHT3:
//		case GL_LIGHT4:
//		case GL_LIGHT5:
//		case GL_LIGHT6:
//		case GL_LIGHT7:
//		case GL_LIGHTING:
//		case GL_LINE_SMOOTH:
//		case GL_LINE_STIPPLE:
//		case GL_MAP1_COLOR_4:
//		case GL_MAP1_INDEX:
//		case GL_MAP1_NORMAL:
//		case GL_MAP1_TEXTURE_COORD_1:
//		case GL_MAP1_TEXTURE_COORD_2:
//		case GL_MAP1_TEXTURE_COORD_3:
//		case GL_MAP1_TEXTURE_COORD_4:
//		case GL_MAP1_VERTEX_3:
//		case GL_MAP1_VERTEX_4:
//		case GL_MAP2_COLOR_4:
//		case GL_MAP2_INDEX:
//		case GL_MAP2_NORMAL:
//		case GL_MAP2_TEXTURE_COORD_1:
//		case GL_MAP2_TEXTURE_COORD_2:
//		case GL_MAP2_TEXTURE_COORD_3:
//		case GL_MAP2_TEXTURE_COORD_4:
//		case GL_MAP2_VERTEX_3:
//		case GL_MAP2_VERTEX_4:
//		case GL_MINMAX:
//		case GL_NORMALIZE:
//		case GL_POINT_SMOOTH:
//		case GL_POLYGON_OFFSET_POINT:
//		case GL_POLYGON_OFFSET_LINE:
//		case GL_POLYGON_OFFSET_FILL:
//		case GL_POLYGON_SMOOTH:
//		case GL_POLYGON_STIPPLE:
//		case GL_POST_COLOR_MATRIX_COLOR_TABLE:
//		case GL_POST_CONVOLUTION_COLOR_TABLE:
//		case GL_RESCALE_NORMAL:
//		case GL_SCISSOR_TEST:
//		case GL_SEPARABLE_2D:
//		case GL_STENCIL_TEST:
//		case GL_TEXTURE_GEN_Q:
//		case GL_TEXTURE_GEN_R:
//		case GL_TEXTURE_GEN_S:
//		case GL_TEXTURE_GEN_T:
//		case GL_TEXTURE_1D:
//		case GL_TEXTURE_2D:
//		case GL_TEXTURE_3D:
	}
}
Exemplo n.º 6
0
static void nv04BlendFuncSeparate(GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB,
		GLenum sfactorA, GLenum dfactorA)
{
	nv04_emit_blend(ctx);
}
Exemplo n.º 7
0
static void nv04BlendEquationSeparate(GLcontext *ctx, GLenum modeRGB, GLenum modeA)
{
	nv04_emit_blend(ctx);
}
Exemplo n.º 8
0
static void nv04BlendColor(GLcontext *ctx, const GLfloat color[4])
{
	nv04_emit_blend(ctx);
}