From 2f24000662f994d1cf1d6f80efa392be987f7e4e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 1 Oct 2018 18:33:17 -0700 Subject: [PATCH] iris: drop a bunch of pipe_sampler_state stuff we don't need --- src/gallium/drivers/iris/iris_state.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 391b6f71bbc..b8c8c96a4ca 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -1112,9 +1112,7 @@ wrap_mode_needs_border_color(unsigned wrap_mode) * Gallium CSO for sampler state. */ struct iris_sampler_state { - // XXX: do we need this - struct pipe_sampler_state base; - + union pipe_color_union border_color; bool needs_border_color; uint32_t sampler_state[GENX(SAMPLER_STATE_length)]; @@ -1137,8 +1135,6 @@ iris_create_sampler_state(struct pipe_context *ctx, if (!cso) return NULL; - memcpy(&cso->base, state, sizeof(*state)); - STATIC_ASSERT(PIPE_TEX_FILTER_NEAREST == MAPFILTER_NEAREST); STATIC_ASSERT(PIPE_TEX_FILTER_LINEAR == MAPFILTER_LINEAR); @@ -1146,6 +1142,8 @@ iris_create_sampler_state(struct pipe_context *ctx, unsigned wrap_t = translate_wrap(state->wrap_t); unsigned wrap_r = translate_wrap(state->wrap_r); + memcpy(&cso->border_color, &state->border_color, sizeof(cso->border_color)); + cso->needs_border_color = wrap_mode_needs_border_color(wrap_s) || wrap_mode_needs_border_color(wrap_t) || wrap_mode_needs_border_color(wrap_r); @@ -1274,7 +1272,7 @@ iris_bind_sampler_states(struct pipe_context *ctx, /* Stream out the border color and merge the pointer. */ uint32_t offset = - iris_upload_border_color(ice, &state->base.border_color); + iris_upload_border_color(ice, &state->border_color); uint32_t dynamic[GENX(SAMPLER_STATE_length)]; iris_pack_state(GENX(SAMPLER_STATE), dynamic, dyns) { -- 2.30.2