[Mesa-dev] [PATCH 23/24] st/mesa: don't call u_sampler_view_default_template for sampler views
Marek Olšák
maraeo at gmail.com
Mon Jun 12 18:18:54 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/state_tracker/st_sampler_view.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_sampler_view.c b/src/mesa/state_tracker/st_sampler_view.c
index 8c814ed..7a8d05d 100644
--- a/src/mesa/state_tracker/st_sampler_view.c
+++ b/src/mesa/state_tracker/st_sampler_view.c
@@ -366,24 +366,25 @@ get_sampler_view_format(struct st_context *st,
return format;
}
static struct pipe_sampler_view *
st_create_texture_sampler_view_from_stobj(struct st_context *st,
struct st_texture_object *stObj,
enum pipe_format format,
bool glsl130_or_later)
{
+ /* There is no need to clear this structure (consider CPU overhead). */
struct pipe_sampler_view templ;
unsigned swizzle = get_texture_format_swizzle(st, stObj, glsl130_or_later);
- u_sampler_view_default_template(&templ, stObj->pt, format);
+ templ.format = format;
templ.u.tex.first_level = stObj->base.MinLevel + stObj->base.BaseLevel;
templ.u.tex.last_level = last_level(stObj);
assert(templ.u.tex.first_level <= templ.u.tex.last_level);
if (stObj->layer_override) {
templ.u.tex.first_layer = templ.u.tex.last_layer = stObj->layer_override;
} else {
templ.u.tex.first_layer = stObj->base.MinLayer;
templ.u.tex.last_layer = last_layer(stObj);
}
--
2.7.4
More information about the mesa-dev
mailing list