[Mesa-dev] [PATCH 2/4] glsl: Move initialize_context() to glsl_parser_extras.cpp so it can be re-used.

Kenneth Graunke kenneth at whitecape.org
Mon Jul 18 18:13:42 PDT 2011


On 07/18/2011 11:37 AM, Paul Berry wrote:
> +++ b/src/glsl/glsl_parser_extras.cpp
> @@ -926,6 +926,39 @@ do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iteration
>     return progress;
>  }
>  
> +void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
> +{
> +   memset(ctx, 0, sizeof(*ctx));
> +
> +   ctx->API = api;
> +
> +   ctx->Extensions.ARB_ES2_compatibility = GL_TRUE;
> +   ctx->Extensions.ARB_draw_buffers = GL_TRUE;
> +   ctx->Extensions.ARB_draw_instanced = GL_TRUE;
> +   ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
> +   ctx->Extensions.EXT_texture_array = GL_TRUE;
> +   ctx->Extensions.NV_texture_rectangle = GL_TRUE;
> +   ctx->Extensions.EXT_texture3D = GL_TRUE;

Would you mind converting these to "true" as long as you're moving them?

Either way,
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list