[Mesa-dev] [PATCH 11/21] nouveau: Enable vertex programs

Francisco Jerez currojerez at riseup.net
Tue Aug 30 03:39:40 PDT 2011


"Ian Romanick" <idr at freedesktop.org> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Specifically, the following extensions are enabled:
>
>     GL_ARB_vertex_program
>     GL_EXT_gpu_program_paramaters
>     GL_NV_vertex_program
>     GL_NV_vertex_program1_1
>
> In addition, ctx->Const.MaxCombinedTextureImageUnits is set.
>
> This has been compiled, but I don't have any nv10 or nv20 hardware to
> test.  I only have nv02, nv03, and nv05.  This is the last swtnl that
> doesn't already have vertex programs enabled.  The enable code was
> mostly copied from the (now removed) mga driver.
>
I'm not convinced that this makes sense. Vertex programs aren't
functional on nv2x at this moment, and on nv1x they probably never will
because there's no hardware support for it.

> Cc: Ben Skeggs <bskeggs at redhat.com>
> Cc: Francisco Jerez <currojerez at riseup.net>
> Cc: Viktor Novotný <noviktor at seznam.cz>
> ---
>  src/mesa/drivers/dri/nouveau/nouveau_context.c |    4 ++++
>  src/mesa/drivers/dri/nouveau/nv10_context.c    |    3 +++
>  src/mesa/drivers/dri/nouveau/nv20_context.c    |    3 +++
>  3 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> index 1c35578..f713078 100644
> --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
> +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
> @@ -119,6 +119,7 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
>  	/* Enable any supported extensions. */
>  	ctx->Extensions.ARB_multitexture = true;
>  	ctx->Extensions.ARB_texture_mirrored_repeat = true;
> +	ctx->Extensions.ARB_vertex_program = true;
>  	ctx->Extensions.EXT_blend_color = true;
>  	ctx->Extensions.EXT_blend_logic_op = true;
>  	ctx->Extensions.EXT_blend_minmax = true;
> @@ -126,6 +127,7 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
>  	ctx->Extensions.EXT_fog_coord = true;
>  	ctx->Extensions.EXT_framebuffer_blit = true;
>  	ctx->Extensions.EXT_framebuffer_object = true;
> +	ctx->Extensions.EXT_gpu_program_parameters = true;
>  	ctx->Extensions.EXT_packed_depth_stencil = true;
>  	ctx->Extensions.EXT_secondary_color = true;
>  	ctx->Extensions.EXT_stencil_wrap = true;
> @@ -135,6 +137,8 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
>  	ctx->Extensions.EXT_texture_lod_bias = true;
>  	ctx->Extensions.NV_blend_square = true;
>  	ctx->Extensions.NV_texture_env_combine4 = true;
> +	ctx->Extensions.NV_vertex_program = true;
> +	ctx->Extensions.NV_vertex_program1_1 = true;
>  
>  	return GL_TRUE;
>  }
> diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c
> index da0ef2b..d6f8fcb 100644
> --- a/src/mesa/drivers/dri/nouveau/nv10_context.c
> +++ b/src/mesa/drivers/dri/nouveau/nv10_context.c
> @@ -442,6 +442,9 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
>  	ctx->Const.MaxTextureCoordUnits = NV10_TEXTURE_UNITS;
>  	ctx->Const.MaxTextureImageUnits = NV10_TEXTURE_UNITS;
>  	ctx->Const.MaxTextureUnits = NV10_TEXTURE_UNITS;
> +	ctx->Const.MaxCombinedTextureImageUnits =
> +	   ctx->Const.MaxVertexTextureImageUnits +
> +	   ctx->Const.MaxTextureImageUnits;
>  	ctx->Const.MaxTextureMaxAnisotropy = 2;
>  	ctx->Const.MaxTextureLodBias = 15;
>  	ctx->Driver.Clear = nv10_clear;
> diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c
> index 2766851..5016568 100644
> --- a/src/mesa/drivers/dri/nouveau/nv20_context.c
> +++ b/src/mesa/drivers/dri/nouveau/nv20_context.c
> @@ -455,6 +455,9 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua
>  	ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS;
>  	ctx->Const.MaxTextureImageUnits = NV20_TEXTURE_UNITS;
>  	ctx->Const.MaxTextureUnits = NV20_TEXTURE_UNITS;
> +	ctx->Const.MaxCombinedTextureImageUnits =
> +	   ctx->Const.MaxVertexTextureImageUnits +
> +	   ctx->Const.MaxTextureImageUnits;
>  	ctx->Const.MaxTextureMaxAnisotropy = 8;
>  	ctx->Const.MaxTextureLodBias = 15;
>  	ctx->Driver.Clear = nv20_clear;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110830/e03fdbd7/attachment.pgp>


More information about the mesa-dev mailing list