mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
st/dri: use PIPE_TEXTURE_RECT if appropriate
This commit is contained in:
parent
d4ec85e624
commit
4a5acc0ec7
4 changed files with 9 additions and 3 deletions
|
|
@ -383,6 +383,11 @@ dri_init_screen_helper(struct dri_screen *screen,
|
|||
if (!screen->st_api)
|
||||
return NULL;
|
||||
|
||||
if(pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES))
|
||||
screen->target = PIPE_TEXTURE_2D;
|
||||
else
|
||||
screen->target = PIPE_TEXTURE_RECT;
|
||||
|
||||
driParseOptionInfo(&screen->optionCache,
|
||||
__driConfigOptions, __driNConfigOptions);
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ struct dri_screen
|
|||
boolean d_depth_bits_last;
|
||||
boolean sd_depth_bits_last;
|
||||
boolean auto_fake_front;
|
||||
enum pipe_texture_target target;
|
||||
};
|
||||
|
||||
/** cast wrapper */
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ dri2_drawable_process_buffers(struct dri_drawable *drawable,
|
|||
pipe_resource_reference(&drawable->textures[i], NULL);
|
||||
|
||||
memset(&templ, 0, sizeof(templ));
|
||||
templ.target = PIPE_TEXTURE_2D;
|
||||
templ.target = screen->target;
|
||||
templ.last_level = 0;
|
||||
templ.width0 = dri_drawable->w;
|
||||
templ.height0 = dri_drawable->h;
|
||||
|
|
@ -342,7 +342,7 @@ dri2_create_image_from_name(__DRIcontext *context,
|
|||
memset(&templ, 0, sizeof(templ));
|
||||
templ.bind = tex_usage;
|
||||
templ.format = pf;
|
||||
templ.target = PIPE_TEXTURE_2D;
|
||||
templ.target = screen->target;
|
||||
templ.last_level = 0;
|
||||
templ.width0 = width;
|
||||
templ.height0 = height;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ drisw_allocate_textures(struct dri_drawable *drawable,
|
|||
}
|
||||
|
||||
memset(&templ, 0, sizeof(templ));
|
||||
templ.target = PIPE_TEXTURE_2D;
|
||||
templ.target = screen->target;
|
||||
templ.width0 = width;
|
||||
templ.height0 = height;
|
||||
templ.depth0 = 1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue