<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 12, 2016 at 10:04 PM, Pohjolainen, Topi <span dir="ltr"><<a href="mailto:topi.pohjolainen@intel.com" target="_blank">topi.pohjolainen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, May 10, 2016 at 04:16:41PM -0700, Jason Ekstrand wrote:<br>
> Many of the more complex cases still fall back to the old shader builder.<br>
> ---<br>
>  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 425 +++++++++++++++++++++++++--<br>
>  1 file changed, 401 insertions(+), 24 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
> index ea64b11..f94dd6f 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp<br>
> @@ -25,6 +25,8 @@<br>
>  #include "main/teximage.h"<br>
>  #include "main/fbobject.h"<br>
><br>
> +#include "compiler/nir/nir_builder.h"<br>
> +<br>
>  #include "intel_fbo.h"<br>
><br>
>  #include "brw_blorp.h"<br>
> @@ -332,6 +334,226 @@ enum sampler_message_arg<br>
>     SAMPLER_MESSAGE_ARG_ZERO_INT,<br>
>  };<br>
><br>
> +struct brw_blorp_blit_vars {<br>
> +   /* Uniforms values from brw_blorp_wm_push_constants */<br>
> +   nir_variable *u_dst_x0;<br>
> +   nir_variable *u_dst_x1;<br>
> +   nir_variable *u_dst_y0;<br>
> +   nir_variable *u_dst_y1;<br>
> +   nir_variable *u_rect_grid_x1;<br>
> +   nir_variable *u_rect_grid_y1;<br>
> +   struct {<br>
> +      nir_variable *multiplier;<br>
> +      nir_variable *offset;<br>
> +   } u_x_transform, u_y_transform;<br>
> +   nir_variable *u_src_z;<br>
> +<br>
> +   /* gl_FragCoord */<br>
> +   nir_variable *frag_coord;<br>
> +<br>
> +   /* gl_FragColor */<br>
> +   nir_variable *color_out;<br>
> +};<br>
> +<br>
> +static void<br>
> +brw_blorp_blit_vars_init(nir_builder *b, struct brw_blorp_blit_vars *v,<br>
> +                         const struct brw_blorp_blit_prog_key *key)<br>
> +{<br>
> +#define LOAD_UNIFORM(name, type)\<br>
> +   v->u_##name = nir_variable_create(b->shader, nir_var_uniform, type, #name); \<br>
> +   v->u_##name->data.location = \<br>
> +      offsetof(struct brw_blorp_wm_push_constants, name);<br>
> +<br>
> +   LOAD_UNIFORM(dst_x0, glsl_uint_type())<br>
> +   LOAD_UNIFORM(dst_x1, glsl_uint_type())<br>
> +   LOAD_UNIFORM(dst_y0, glsl_uint_type())<br>
> +   LOAD_UNIFORM(dst_y1, glsl_uint_type())<br>
> +   LOAD_UNIFORM(rect_grid_x1, glsl_float_type())<br>
> +   LOAD_UNIFORM(rect_grid_y1, glsl_float_type())<br>
> +   LOAD_UNIFORM(x_transform.multiplier, glsl_float_type())<br>
> +   LOAD_UNIFORM(x_transform.offset, glsl_float_type())<br>
> +   LOAD_UNIFORM(y_transform.multiplier, glsl_float_type())<br>
> +   LOAD_UNIFORM(y_transform.offset, glsl_float_type())<br>
> +   LOAD_UNIFORM(src_z, glsl_uint_type())<br>
> +<br>
> +#undef DECL_UNIFORM<br>
> +<br>
> +   v->frag_coord = nir_variable_create(b->shader, nir_var_shader_in,<br>
> +                                       glsl_vec4_type(), "gl_FragCoord");<br>
> +   v->frag_coord->data.location = VARYING_SLOT_POS;<br>
> +   v->frag_coord->data.origin_upper_left = true;<br>
> +<br>
> +   v->color_out = nir_variable_create(b->shader, nir_var_shader_out,<br>
> +                                      glsl_vec4_type(), "gl_FragColor");<br>
> +   v->color_out->data.location = FRAG_RESULT_COLOR;<br>
> +}<br>
> +<br>
> +nir_ssa_def *<br>
> +blorp_blit_get_frag_coords(nir_builder *b,<br>
> +                           const struct brw_blorp_blit_prog_key *key,<br>
> +                           struct brw_blorp_blit_vars *v)<br>
> +{<br>
> +   nir_ssa_def *coord = nir_f2i(b, nir_load_var(b, v->frag_coord));<br>
> +<br>
> +   if (key->persample_msaa_dispatch) {<br>
> +      return nir_vec3(b, nir_channel(b, coord, 0), nir_channel(b, coord, 1),<br>
> +         nir_load_system_value(b, nir_intrinsic_load_sample_id, 0));<br>
> +   } else {<br>
> +      return nir_vec2(b, nir_channel(b, coord, 0), nir_channel(b, coord, 1));<br>
> +   }<br>
> +}<br>
> +<br>
<br>
</div></div>We could keep the original comment here:<br>
<br>
/**<br>
 * Emit code to translate from destination (X, Y) coordinates to source (X, Y)<br>
 * coordinates.<br>
 */<br></blockquote><div><br></div><div>Done.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Otherwise this looks really nice, readability alone is improved a lot. There<br>
is no question that the original was written as clearly as it can be but now<br>
we are able to leave some many details into the generic compiler backend.<br>
<div><div class="h5"><br>
> +nir_ssa_def *<br>
> +blorp_blit_apply_transform(nir_builder *b, nir_ssa_def *src_pos,<br>
> +                           struct brw_blorp_blit_vars *v)<br>
> +{<br>
> +   nir_ssa_def *offset = nir_vec2(b, nir_load_var(b, v->u_x_transform.offset),<br>
> +                                     nir_load_var(b, v->u_y_transform.offset));<br>
> +   nir_ssa_def *mul = nir_vec2(b, nir_load_var(b, v->u_x_transform.multiplier),<br>
> +                                  nir_load_var(b, v->u_y_transform.multiplier));<br>
> +<br>
> +   nir_ssa_def *pos = nir_ffma(b, src_pos, mul, offset);<br>
> +<br>
> +   if (src_pos->num_components == 3) {<br>
> +      /* Leave the sample id alone */<br>
> +      pos = nir_vec3(b, nir_channel(b, pos, 0), nir_channel(b, pos, 1),<br>
> +                        nir_channel(b, src_pos, 2));<br>
> +   }<br>
> +<br>
> +   return pos;<br>
> +}<br>
> +<br>
> +static nir_tex_instr *<br>
> +blorp_create_nir_tex_instr(nir_shader *shader, nir_texop op,<br>
> +                           nir_ssa_def *pos, unsigned num_srcs,<br>
> +                           enum brw_reg_type dst_type)<br>
> +{<br>
> +   nir_tex_instr *tex = nir_tex_instr_create(shader, num_srcs);<br>
> +<br>
> +   tex->op = op;<br>
> +<br>
> +   switch (dst_type) {<br>
> +   case BRW_REGISTER_TYPE_F:<br>
> +      tex->dest_type = nir_type_float;<br>
> +      break;<br>
> +   case BRW_REGISTER_TYPE_D:<br>
> +      tex->dest_type = nir_type_int;<br>
> +      break;<br>
> +   case BRW_REGISTER_TYPE_UD:<br>
> +      tex->dest_type = nir_type_uint;<br>
> +      break;<br>
> +   default:<br>
> +      unreachable("Invalid texture return type");<br>
> +   }<br>
> +<br>
> +   tex->is_array = false;<br>
> +   tex->is_shadow = false;<br>
> +<br>
> +   /* Blorp only has one texture and it's bound at unit 0 */<br>
> +   tex->texture = NULL;<br>
> +   tex->sampler = NULL;<br>
> +   tex->texture_index = 0;<br>
> +   tex->sampler_index = 0;<br>
> +<br>
> +   nir_ssa_dest_init(&tex->instr, &tex->dest, 4, 32, NULL);<br>
> +<br>
> +   return tex;<br>
> +}<br>
> +<br>
> +static nir_ssa_def *<br>
> +blorp_nir_tex(nir_builder *b, nir_ssa_def *pos, enum brw_reg_type dst_type)<br>
> +{<br>
> +   nir_tex_instr *tex =<br>
> +      blorp_create_nir_tex_instr(b->shader, nir_texop_tex, pos, 2, dst_type);<br>
> +<br>
> +   assert(pos->num_components == 2);<br>
> +   tex->sampler_dim = GLSL_SAMPLER_DIM_2D;<br>
> +   tex->coord_components = 2;<br>
> +   tex->src[0].src_type = nir_tex_src_coord;<br>
> +   tex->src[0].src = nir_src_for_ssa(pos);<br>
> +   tex->src[1].src_type = nir_tex_src_lod;<br>
> +   tex->src[1].src = nir_src_for_ssa(nir_imm_int(b, 0));<br>
> +<br>
> +   nir_builder_instr_insert(b, &tex->instr);<br>
> +<br>
> +   return &tex->dest.ssa;<br>
> +}<br>
> +<br>
> +static nir_ssa_def *<br>
> +blorp_nir_txf(nir_builder *b, struct brw_blorp_blit_vars *v,<br>
> +              nir_ssa_def *pos, enum brw_reg_type dst_type)<br>
> +{<br>
> +   nir_tex_instr *tex =<br>
> +      blorp_create_nir_tex_instr(b->shader, nir_texop_txf, pos, 2, dst_type);<br>
> +<br>
> +   /* In order to properly handle 3-D textures, we pull the Z component from<br>
> +    * a uniform.  TODO: This is a bit magic; we should probably make this<br>
> +    * more explicit in the future.<br>
> +    */<br>
> +   assert(pos->num_components == 2);<br>
> +   pos = nir_vec3(b, nir_channel(b, pos, 0), nir_channel(b, pos, 1),<br>
> +                     nir_load_var(b, v->u_src_z));<br>
> +<br>
> +   tex->sampler_dim = GLSL_SAMPLER_DIM_3D;<br>
> +   tex->coord_components = 3;<br>
> +   tex->src[0].src_type = nir_tex_src_coord;<br>
> +   tex->src[0].src = nir_src_for_ssa(pos);<br>
> +   tex->src[1].src_type = nir_tex_src_lod;<br>
> +   tex->src[1].src = nir_src_for_ssa(nir_imm_int(b, 0));<br>
> +<br>
> +   nir_builder_instr_insert(b, &tex->instr);<br>
> +<br>
> +   return &tex->dest.ssa;<br>
> +}<br>
> +<br>
> +static nir_ssa_def *<br>
> +blorp_nir_txf_ms(nir_builder *b, nir_ssa_def *pos, nir_ssa_def *mcs,<br>
> +                 enum brw_reg_type dst_type)<br>
> +{<br>
> +   nir_tex_instr *tex =<br>
> +      blorp_create_nir_tex_instr(b->shader, nir_texop_txf_ms, pos,<br>
> +                                 mcs != NULL ? 3 : 2, dst_type);<br>
> +<br>
> +   tex->sampler_dim = GLSL_SAMPLER_DIM_MS;<br>
> +   tex->coord_components = 2;<br>
> +   tex->src[0].src_type = nir_tex_src_coord;<br>
> +   tex->src[0].src = nir_src_for_ssa(pos);<br>
> +<br>
> +   tex->src[1].src_type = nir_tex_src_ms_index;<br>
> +   if (pos->num_components == 2) {<br>
> +      tex->src[1].src = nir_src_for_ssa(nir_imm_int(b, 0));<br>
> +   } else {<br>
> +      assert(pos->num_components == 3);<br>
> +      tex->src[1].src = nir_src_for_ssa(nir_channel(b, pos, 2));<br>
> +   }<br>
> +<br>
> +   if (mcs) {<br>
> +      tex->src[2].src_type = nir_tex_src_ms_mcs;<br>
> +      tex->src[2].src = nir_src_for_ssa(mcs);<br>
> +   }<br>
> +<br>
> +   nir_builder_instr_insert(b, &tex->instr);<br>
> +<br>
> +   return &tex->dest.ssa;<br>
> +}<br>
> +<br>
> +static nir_ssa_def *<br>
> +blorp_nir_txf_ms_mcs(nir_builder *b, nir_ssa_def *pos)<br>
> +{<br>
> +   nir_tex_instr *tex =<br>
> +      blorp_create_nir_tex_instr(b->shader, nir_texop_txf_ms_mcs,<br>
> +                                 pos, 1, BRW_REGISTER_TYPE_D);<br>
> +<br>
> +   tex->sampler_dim = GLSL_SAMPLER_DIM_MS;<br>
> +   tex->coord_components = 2;<br>
> +   tex->src[0].src_type = nir_tex_src_coord;<br>
> +   tex->src[0].src = nir_src_for_ssa(pos);<br>
> +<br>
> +   nir_builder_instr_insert(b, &tex->instr);<br>
> +<br>
> +   return &tex->dest.ssa;<br>
> +}<br>
> +<br>
>  /**<br>
>   * Generator for WM programs used in BLORP blits.<br>
>   *<br>
> @@ -471,6 +693,161 @@ enum sampler_message_arg<br>
>   * (In these formulas, pitch is the number of bytes occupied by a single row<br>
>   * of samples).<br>
>   */<br>
> +static nir_shader *<br>
> +brw_blorp_build_nir_shader(struct brw_context *brw,<br>
> +                           const brw_blorp_blit_prog_key *key,<br>
> +                           struct brw_blorp_prog_data *prog_data)<br>
> +{<br>
> +   nir_ssa_def *src_pos, *dst_pos, *color;<br>
> +<br>
> +   /* Sanity checks */<br>
> +   if (key->dst_tiled_w && key->rt_samples > 0) {<br>
> +      /* If the destination image is W tiled and multisampled, then the thread<br>
> +       * must be dispatched once per sample, not once per pixel.  This is<br>
> +       * necessary because after conversion between W and Y tiling, there's no<br>
> +       * guarantee that all samples corresponding to a single pixel will still<br>
> +       * be together.<br>
> +       */<br>
> +      assert(key->persample_msaa_dispatch);<br>
> +   }<br>
> +<br>
> +   if (key->blend) {<br>
> +      /* We are blending, which means we won't have an opportunity to<br>
> +       * translate the tiling and sample count for the texture surface.  So<br>
> +       * the surface state for the texture must be configured with the correct<br>
> +       * tiling and sample count.<br>
> +       */<br>
> +      assert(!key->src_tiled_w);<br>
> +      assert(key->tex_samples == key->src_samples);<br>
> +      assert(key->tex_layout == key->src_layout);<br>
> +      assert(key->tex_samples > 0);<br>
> +   }<br>
> +<br>
> +   if (key->persample_msaa_dispatch) {<br>
> +      /* It only makes sense to do persample dispatch if the render target is<br>
> +       * configured as multisampled.<br>
> +       */<br>
> +      assert(key->rt_samples > 0);<br>
> +   }<br>
> +<br>
> +   /* Make sure layout is consistent with sample count */<br>
> +   assert((key->tex_layout == INTEL_MSAA_LAYOUT_NONE) ==<br>
> +          (key->tex_samples == 0));<br>
> +   assert((key->rt_layout == INTEL_MSAA_LAYOUT_NONE) ==<br>
> +          (key->rt_samples == 0));<br>
> +   assert((key->src_layout == INTEL_MSAA_LAYOUT_NONE) ==<br>
> +          (key->src_samples == 0));<br>
> +   assert((key->dst_layout == INTEL_MSAA_LAYOUT_NONE) ==<br>
> +          (key->dst_samples == 0));<br>
> +<br>
> +   /* Set up prog_data */<br>
> +   brw_blorp_prog_data_init(prog_data);<br>
> +<br>
> +   nir_builder b;<br>
> +   nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_FRAGMENT, NULL);<br>
> +<br>
> +   struct brw_blorp_blit_vars v;<br>
> +   brw_blorp_blit_vars_init(&b, &v, key);<br>
> +<br>
> +   dst_pos = blorp_blit_get_frag_coords(&b, key, &v);<br>
> +<br>
> +   /* Render target and texture hardware don't support W tiling until Gen8. */<br>
> +   const bool rt_tiled_w = false;<br>
> +   const bool tex_tiled_w = brw->gen >= 8 && key->src_tiled_w;<br>
> +<br>
> +   /* The address that data will be written to is determined by the<br>
> +    * coordinates supplied to the WM thread and the tiling and sample count of<br>
> +    * the render target, according to the formula:<br>
> +    *<br>
> +    * (X, Y, S) = decode_msaa(rt_samples, detile(rt_tiling, offset))<br>
> +    *<br>
> +    * If the actual tiling and sample count of the destination surface are not<br>
> +    * the same as the configuration of the render target, then these<br>
> +    * coordinates are wrong and we have to adjust them to compensate for the<br>
> +    * difference.<br>
> +    */<br>
> +   if (rt_tiled_w != key->dst_tiled_w ||<br>
> +       key->rt_samples != key->dst_samples ||<br>
> +       key->rt_layout != key->dst_layout) {<br>
> +      goto fail;<br>
> +   }<br>
> +<br>
> +   /* Now (X, Y, S) = decode_msaa(dst_samples, detile(dst_tiling, offset)).<br>
> +    *<br>
> +    * That is: X, Y and S now contain the true coordinates and sample index of<br>
> +    * the data that the WM thread should output.<br>
> +    *<br>
> +    * If we need to kill pixels that are outside the destination rectangle,<br>
> +    * now is the time to do it.<br>
> +    */<br>
> +   if (key->use_kill)<br>
> +      goto fail;<br>
> +<br>
> +   src_pos = blorp_blit_apply_transform(&b, nir_i2f(&b, dst_pos), &v);<br>
> +<br>
> +   if (key->blit_scaled && key->blend) {<br>
> +      goto fail;<br>
> +   } else if (!key->bilinear_filter) {<br>
> +      /* We're going to use a texelFetch, so we need integers */<br>
> +      src_pos = nir_f2i(&b, src_pos);<br>
> +   }<br>
> +<br>
> +   /* X, Y, and S are now the coordinates of the pixel in the source image<br>
> +    * that we want to texture from.  Exception: if we are blending, then S is<br>
> +    * irrelevant, because we are going to fetch all samples.<br>
> +    */<br>
> +   if (key->blend && !key->blit_scaled) {<br>
> +      goto fail;<br>
> +   } else if (key->blend && key->blit_scaled) {<br>
> +      goto fail;<br>
> +   } else {<br>
> +      /* We aren't blending, which means we just want to fetch a single sample<br>
> +       * from the source surface.  The address that we want to fetch from is<br>
> +       * related to the X, Y and S values according to the formula:<br>
> +       *<br>
> +       * (X, Y, S) = decode_msaa(src_samples, detile(src_tiling, offset)).<br>
> +       *<br>
> +       * If the actual tiling and sample count of the source surface are not<br>
> +       * the same as the configuration of the texture, then we need to adjust<br>
> +       * the coordinates to compensate for the difference.<br>
> +       */<br>
> +      if ((tex_tiled_w != key->src_tiled_w ||<br>
> +           key->tex_samples != key->src_samples ||<br>
> +           key->tex_layout != key->src_layout) &&<br>
> +          !key->bilinear_filter) {<br>
> +         goto fail;<br>
> +      }<br>
> +<br>
> +      if (key->bilinear_filter) {<br>
> +         color = blorp_nir_tex(&b, src_pos, key->texture_data_type);<br>
> +      } else {<br>
> +         /* Now (X, Y, S) = decode_msaa(tex_samples, detile(tex_tiling, offset)).<br>
> +          *<br>
> +          * In other words: X, Y, and S now contain values which, when passed to<br>
> +          * the texturing unit, will cause data to be read from the correct<br>
> +          * memory location.  So we can fetch the texel now.<br>
> +          */<br>
> +         if (key->src_samples == 0) {<br>
<br>
</div></div>Hmm, src_samples can be one also, right? It get its value directly from the<br>
miptree. I think we will end up with lossless compression to take the mcs<br>
fetch path. Should we instead use:<br>
<br>
            if (key->src_samples <= 1) {<br></blockquote><div><br></div><div>This is a direct copy+paste from the original.  I'm not opposed to looking into that modification.  However, I tried to keep the NIR translation as close the the original as possible.  Is that reasonable?<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Other than that:<br>
<br>
Reviewed-by: Topi Pohjolainen <<a href="mailto:topi.pohjolainen@intel.com">topi.pohjolainen@intel.com</a>><br>
<div><div class="h5"><br>
> +            color = blorp_nir_txf(&b, &v, src_pos, key->texture_data_type);<br>
> +         } else {<br>
> +            nir_ssa_def *mcs = NULL;<br>
> +            if (key->tex_layout == INTEL_MSAA_LAYOUT_CMS)<br>
> +               mcs = blorp_nir_txf_ms_mcs(&b, src_pos);<br>
> +<br>
> +            color = blorp_nir_txf_ms(&b, src_pos, mcs, key->texture_data_type);<br>
> +         }<br>
> +      }<br>
> +   }<br>
> +<br>
> +   nir_store_var(&b, v.color_out, color, 0xf);<br>
> +<br>
> +   return b.shader;<br>
> +<br>
> +fail:<br>
> +   ralloc_free(b.shader);<br>
> +   return NULL;<br>
> +}<br>
> +<br>
>  class brw_blorp_blit_program : public brw_blorp_eu_emitter<br>
>  {<br>
>  public:<br>
> @@ -1307,25 +1684,6 @@ brw_blorp_blit_program::clamp_tex_coords(struct brw_reg regX,<br>
>     emit_min(regY, regY, clampY1);<br>
>  }<br>
><br>
> -/**<br>
> - * Emit code to transform the X and Y coordinates as needed for blending<br>
> - * together the different samples in an MSAA texture.<br>
> - */<br>
> -void<br>
> -brw_blorp_blit_program::single_to_blend()<br>
> -{<br>
> -   /* When looking up samples in an MSAA texture using the SAMPLE message,<br>
> -    * Gen6 requires the texture coordinates to be odd integers (so that they<br>
> -    * correspond to the center of a 2x2 block representing the four samples<br>
> -    * that maxe up a pixel).  So we need to multiply our X and Y coordinates<br>
> -    * each by 2 and then add 1.<br>
> -    */<br>
> -   emit_shl(t1, X, brw_imm_w(1));<br>
> -   emit_shl(t2, Y, brw_imm_w(1));<br>
> -   emit_add(Xp, t1, brw_imm_w(1));<br>
> -   emit_add(Yp, t2, brw_imm_w(1));<br>
> -   SWAP_XY_AND_XPYP();<br>
> -}<br>
><br>
><br>
>  /**<br>
> @@ -1747,14 +2105,33 @@ brw_blorp_get_blit_kernel(struct brw_context *brw,<br>
>                          &params->wm_prog_kernel, &params->wm_prog_data))<br>
>        return;<br>
><br>
> -   brw_blorp_blit_program prog(brw, prog_key);<br>
> -   GLuint program_size;<br>
> -   const GLuint *program = prog.compile(brw, INTEL_DEBUG & DEBUG_BLORP,<br>
> -                                        &program_size);<br>
> +   const unsigned *program;<br>
> +   unsigned program_size;<br>
> +   struct brw_blorp_prog_data prog_data;<br>
> +<br>
> +   /* Try and compile with NIR first.  If that fails, fall back to the old<br>
> +    * method of building shaders manually.<br>
> +    */<br>
> +   nir_shader *nir = brw_blorp_build_nir_shader(brw, prog_key, &prog_data);<br>
> +   if (nir) {<br>
> +      struct brw_wm_prog_key wm_key;<br>
> +      brw_blorp_init_wm_prog_key(&wm_key);<br>
> +      wm_key.tex.compressed_multisample_layout_mask =<br>
> +         prog_key->tex_layout == INTEL_MSAA_LAYOUT_CMS;<br>
> +      wm_key.multisample_fbo = prog_key->rt_samples > 1;<br>
> +<br>
> +      program = brw_blorp_compile_nir_shader(brw, nir, &wm_key, false,<br>
> +                                             &prog_data, &program_size);<br>
> +   } else {<br>
> +      brw_blorp_blit_program prog(brw, prog_key);<br>
> +      program = prog.compile(brw, INTEL_DEBUG & DEBUG_BLORP, &program_size);<br>
> +      prog_data = prog.prog_data;<br>
> +   }<br>
> +<br>
>     brw_upload_cache(&brw->cache, BRW_CACHE_BLORP_PROG,<br>
>                      prog_key, sizeof(*prog_key),<br>
>                      program, program_size,<br>
> -                    &prog.prog_data, sizeof(prog.prog_data),<br>
> +                    &prog_data, sizeof(prog_data),<br>
>                      &params->wm_prog_kernel, &params->wm_prog_data);<br>
>  }<br>
><br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>