From 3070e0ea41ab4aa24804e8fd26895924a8583830 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Fri, 6 Aug 2010 07:39:21 +0200 Subject: mesa/st: support using PIPE_TEXTURE_RECT internally Currently Gallium internals always use PIPE_TEXTURE_2D and normalized coordinates to access textures. However, PIPE_TEXTURE_2D is not always supported for NPOT textures, and PIPE_TEXTURE_RECT requires unnormalized coordinates. Hence, this change adds support for both kinds of normalization. --- src/mesa/state_tracker/st_context.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/state_tracker/st_context.c') diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 2ce5f087536..3b046962efe 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -125,6 +125,11 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe ) st_init_generate_mipmap(st); st_init_blit(st); + if(pipe->screen->get_param(pipe->screen, PIPE_CAP_NPOT_TEXTURES)) + st->internal_target = PIPE_TEXTURE_2D; + else + st->internal_target = PIPE_TEXTURE_RECT; + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) st->state.sampler_list[i] = &st->state.samplers[i]; -- cgit v1.2.3