diff options
author | Luca Barbieri <[email protected]> | 2010-08-06 07:39:21 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-08-20 12:04:03 +0200 |
commit | 3070e0ea41ab4aa24804e8fd26895924a8583830 (patch) | |
tree | c9f0edec8e9a61a642f4d5068ea7a9047eb11ec5 /src/mesa/state_tracker/st_context.c | |
parent | 4a9bfb24eb907080b2e3e49215ad9912758d56c6 (diff) |
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.
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 5 |
1 files changed, 5 insertions, 0 deletions
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]; |