iris: drop a bunch of pipe_sampler_state stuff we don't need
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 2 Oct 2018 01:33:17 +0000 (18:33 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_state.c

index 391b6f71bbc237e79020854c7f067b05d1db7e2c..b8c8c96a4caecc3903c816bd0a8a66d4bf7fb004 100644 (file)
@@ -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) {