<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 17, 2017 at 4:36 PM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We handle the Sandybridge multisampled 2D surface hack here, rather<br>
than in ISL, because it requires allocating a BO, and is kind of messy.<br>
---<br>
 src/mesa/drivers/dri/i965/<wbr>Makefile.sources        |   2 -<br>
 src/mesa/drivers/dri/i965/brw_<wbr>context.c           |   4 +-<br>
 src/mesa/drivers/dri/i965/brw_<wbr>context.h           |   5 -<br>
 src/mesa/drivers/dri/i965/brw_<wbr>state.h             |   8 -<br>
 src/mesa/drivers/dri/i965/brw_<wbr>wm_surface_state.c  | 119 ++++++--------<br>
 src/mesa/drivers/dri/i965/<wbr>gen7_wm_surface_state.c | 180 ----------------------<br>
 src/mesa/drivers/dri/i965/<wbr>gen8_surface_state.c    |  82 ----------<br>
 7 files changed, 49 insertions(+), 351 deletions(-)<br></blockquote><div><br></div><div>Look at that diffstat. :-)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 delete mode 100644 src/mesa/drivers/dri/i965/<wbr>gen7_wm_surface_state.c<br>
 delete mode 100644 src/mesa/drivers/dri/i965/<wbr>gen8_surface_state.c<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>Makefile.sources b/src/mesa/drivers/dri/i965/<wbr>Makefile.sources<br>
index 425c883de84..9687eb957e1 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>Makefile.sources<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>Makefile.sources<br>
@@ -74,10 +74,8 @@ i965_FILES = \<br>
        gen7_misc_state.c \<br>
        gen7_sol_state.c \<br>
        gen7_urb.c \<br>
-       gen7_wm_surface_state.c \<br>
        gen8_depth_state.c \<br>
        gen8_multisample_state.c \<br>
-       gen8_surface_state.c \<br>
        hsw_queryobj.c \<br>
        hsw_sol.c \<br>
        intel_batchbuffer.c \<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_context.c b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
index d97a24fbf82..d157f059704 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_context.c<br>
@@ -866,10 +866,10 @@ brwCreateContext(gl_api api,<br>
    brw->gs.base.stage = MESA_SHADER_GEOMETRY;<br>
    brw->wm.base.stage = MESA_SHADER_FRAGMENT;<br>
    if (brw->gen >= 8) {<br>
-      gen8_init_vtable_surface_<wbr>functions(brw);<br>
+      gen6_init_vtable_surface_<wbr>functions(brw);<br>
       brw->vtbl.emit_depth_stencil_<wbr>hiz = gen8_emit_depth_stencil_hiz;<br>
    } else if (brw->gen >= 7) {<br>
-      gen7_init_vtable_surface_<wbr>functions(brw);<br>
+      gen6_init_vtable_surface_<wbr>functions(brw);<br>
       brw->vtbl.emit_depth_stencil_<wbr>hiz = gen7_emit_depth_stencil_hiz;<br>
    } else if (brw->gen >= 6) {<br>
       gen6_init_vtable_surface_<wbr>functions(brw);<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_context.h b/src/mesa/drivers/dri/i965/<wbr>brw_context.h<br>
index 9061dc19936..932240bfc50 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_context.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_context.h<br>
@@ -637,11 +637,6 @@ struct brw_context<br>
                                               struct gl_renderbuffer *rb,<br>
                                               uint32_t flags, unsigned unit,<br>
                                               uint32_t surf_index);<br>
-      void (*emit_null_surface_state)(<wbr>struct brw_context *brw,<br>
-                                      unsigned width,<br>
-                                      unsigned height,<br>
-                                      unsigned samples,<br>
-                                      uint32_t *out_offset);<br>
<br>
       /**<br>
        * Send the appropriate state packets to configure depth, stencil, and<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_state.h b/src/mesa/drivers/dri/i965/<wbr>brw_state.h<br>
index 46665aae12b..dc893e5b7bd 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_state.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_state.h<br>
@@ -232,14 +232,6 @@ void brw_update_renderbuffer_<wbr>surfaces(struct brw_context *brw,<br>
                                       uint32_t render_target_start,<br>
                                       uint32_t *surf_offset);<br>
<br>
-/* gen7_wm_surface_state.c */<br>
-void gen7_check_surface_setup(<wbr>uint32_t *surf, bool is_render_target);<br>
-void gen7_init_vtable_surface_<wbr>functions(struct brw_context *brw);<br>
-<br>
-/* gen8_surface_state.c */<br>
-<br>
-void gen8_init_vtable_surface_<wbr>functions(struct brw_context *brw);<br>
-<br>
 /* brw_sampler_state.c */<br>
 void brw_emit_sampler_state(struct brw_context *brw,<br>
                             uint32_t *sampler_state,<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
index 4a0a338fa5a..358fdb48d44 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>brw_wm_surface_state.c<br>
@@ -832,72 +832,48 @@ const struct brw_tracked_state brw_wm_pull_constants = {<br>
  * hardware discard the target 0 color output..<br>
  */<br>
 static void<br>
-brw_emit_null_surface_state(<wbr>struct brw_context *brw,<br>
-                            unsigned width,<br>
-                            unsigned height,<br>
-                            unsigned samples,<br>
-                            uint32_t *out_offset)<br>
+emit_null_surface_state(<wbr>struct brw_context *brw,<br></blockquote><div><br></div><div>Not really sure why you felt the need to drop the brw_  I don't really care that much though.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                        unsigned width,<br>
+                        unsigned height,<br>
+                        unsigned samples,<br>
+                        uint32_t *out_offset)<br>
 {<br>
-   /* From the Sandy bridge PRM, Vol4 Part1 p71 (Surface Type: Programming<br>
-    * Notes):<br>
-    *<br>
-    *     A null surface will be used in instances where an actual surface is<br>
-    *     not bound. When a write message is generated to a null surface, no<br>
-    *     actual surface is written to. When a read message (including any<br>
-    *     sampling engine message) is generated to a null surface, the result<br>
-    *     is all zeros. Note that a null surface type is allowed to be used<br>
-    *     with all messages, even if it is not specificially indicated as<br>
-    *     supported. All of the remaining fields in surface state are ignored<br>
-    *     for null surfaces, with the following exceptions:<br>
+   uint32_t *surf = brw_state_batch(brw,<br>
+                                    brw->isl_dev.ss.size,<br>
+                                    brw->isl_dev.ss.align,<br>
+                                    out_offset);<br>
+<br>
+   if (brw->gen != 6 || samples <= 1) {<br>
+      isl_null_fill_state(&brw->isl_<wbr>dev, surf,<br>
+                          isl_extent3d(width, height, 1));<br>
+      return;<br>
+   }<br>
+<br>
+   /* On Gen6, null render targets seem to cause GPU hangs when multisampling.<br>
+    * So work around this problem by rendering into dummy color buffer.<br>
     *<br>
-    *     - [DevSNB+]: Width, Height, Depth, and LOD fields must match the<br>
-    *       depth buffer’s corresponding state for all render target surfaces,<br>
-    *       including null.<br>
+    * To decrease the amount of memory needed by the workaround buffer, we<br>
+    * set its pitch to 128 bytes (the width of a Y tile).  This means that<br>
+    * the amount of memory needed for the workaround buffer is<br>
+    * (width_in_tiles + height_in_tiles - 1) tiles.<br>
     *<br>
-    *     - Surface Format must be R8G8B8A8_UNORM.<br>
+    * Note that since the workaround buffer will be interpreted by the<br>
+    * hardware as an interleaved multisampled buffer, we need to compute<br>
+    * width_in_tiles and height_in_tiles by dividing the width and height<br>
+    * by 16 rather than the normal Y-tile size of 32.<br>
     */<br>
-   unsigned surface_type = BRW_SURFACE_NULL;<br>
-   struct brw_bo *bo = NULL;<br>
-   unsigned pitch_minus_1 = 0;<br>
-   uint32_t multisampling_state = 0;<br>
-   uint32_t *surf = brw_state_batch(brw, 6 * 4, 32, out_offset);<br>
+   unsigned width_in_tiles = ALIGN(width, 16) / 16;<br>
+   unsigned height_in_tiles = ALIGN(height, 16) / 16;<br>
+   unsigned pitch_minus_1 = 127;<br>
+   unsigned size_needed = (width_in_tiles + height_in_tiles - 1) * 4096;<br>
+   brw_get_scratch_bo(brw, &brw->wm.multisampled_null_<wbr>render_target_bo,<br>
+                      size_needed);<br>
<br>
-   if (samples > 1) {<br>
-      /* On Gen6, null render targets seem to cause GPU hangs when<br>
-       * multisampling.  So work around this problem by rendering into dummy<br>
-       * color buffer.<br>
-       *<br>
-       * To decrease the amount of memory needed by the workaround buffer, we<br>
-       * set its pitch to 128 bytes (the width of a Y tile).  This means that<br>
-       * the amount of memory needed for the workaround buffer is<br>
-       * (width_in_tiles + height_in_tiles - 1) tiles.<br>
-       *<br>
-       * Note that since the workaround buffer will be interpreted by the<br>
-       * hardware as an interleaved multisampled buffer, we need to compute<br>
-       * width_in_tiles and height_in_tiles by dividing the width and height<br>
-       * by 16 rather than the normal Y-tile size of 32.<br>
-       */<br>
-      unsigned width_in_tiles = ALIGN(width, 16) / 16;<br>
-      unsigned height_in_tiles = ALIGN(height, 16) / 16;<br>
-      unsigned size_needed = (width_in_tiles + height_in_tiles - 1) * 4096;<br>
-      brw_get_scratch_bo(brw, &brw->wm.multisampled_null_<wbr>render_target_bo,<br>
-                         size_needed);<br>
-      bo = brw->wm.multisampled_null_<wbr>render_target_bo;<br>
-      surface_type = BRW_SURFACE_2D;<br>
-      pitch_minus_1 = 127;<br>
-      multisampling_state = brw_get_surface_num_<wbr>multisamples(samples);<br>
-   }<br>
-<br>
-   surf[0] = (surface_type << BRW_SURFACE_TYPE_SHIFT |<br>
+   surf[0] = (BRW_SURFACE_2D << BRW_SURFACE_TYPE_SHIFT |<br>
              ISL_FORMAT_B8G8R8A8_UNORM << BRW_SURFACE_FORMAT_SHIFT);<br>
-   if (brw->gen < 6) {<br>
-      surf[0] |= (1 << BRW_SURFACE_WRITEDISABLE_R_<wbr>SHIFT |<br>
-                 1 << BRW_SURFACE_WRITEDISABLE_G_<wbr>SHIFT |<br>
-                 1 << BRW_SURFACE_WRITEDISABLE_B_<wbr>SHIFT |<br>
-                 1 << BRW_SURFACE_WRITEDISABLE_A_<wbr>SHIFT);<br>
-   }<br>
-   surf[1] = !bo ? 0 :<br>
-             brw_emit_reloc(&brw->batch, *out_offset + 4, bo, 0, RELOC_WRITE);<br>
+   surf[1] = brw_emit_reloc(&brw->batch, *out_offset + 4,<br>
+                            brw->wm.multisampled_null_<wbr>render_target_bo,<br>
+                            0, RELOC_WRITE);<br>
<br>
    surf[2] = ((width - 1) << BRW_SURFACE_WIDTH_SHIFT |<br>
               (height - 1) << BRW_SURFACE_HEIGHT_SHIFT);<br>
@@ -909,7 +885,7 @@ brw_emit_null_surface_state(<wbr>struct brw_context *brw,<br>
     */<br>
    surf[3] = (BRW_SURFACE_TILED | BRW_SURFACE_TILED_Y |<br>
               pitch_minus_1 << BRW_SURFACE_PITCH_SHIFT);<br>
-   surf[4] = multisampling_state;<br>
+   surf[4] = BRW_SURFACE_MULTISAMPLECOUNT_<wbr>4;<br>
    surf[5] = 0;<br>
 }<br>
<br>
@@ -1046,14 +1022,12 @@ brw_update_renderbuffer_<wbr>surfaces(struct brw_context *brw,<br>
                brw->vtbl.update_renderbuffer_<wbr>surface(<br>
                   brw, fb->_ColorDrawBuffers[i], flags, i, surf_index);<br>
         } else {<br>
-            brw->vtbl.emit_null_surface_<wbr>state(brw, w, h, s,<br>
-               &surf_offset[surf_index]);<br>
+            emit_null_surface_state(brw, w, h, s, &surf_offset[surf_index]);<br>
         }<br>
       }<br>
    } else {<br>
       const uint32_t surf_index = render_target_start;<br>
-      brw->vtbl.emit_null_surface_<wbr>state(brw, w, h, s,<br>
-         &surf_offset[surf_index]);<br>
+      emit_null_surface_state(brw, w, h, s, &surf_offset[surf_index]);<br>
    }<br>
 }<br>
<br>
@@ -1158,9 +1132,11 @@ update_renderbuffer_read_<wbr>surfaces(struct brw_context *brw)<br>
                                    0);<br>
<br>
          } else {<br>
-            brw->vtbl.emit_null_surface_<wbr>state(<br>
-               brw, _mesa_geometric_width(fb), _mesa_geometric_height(fb),<br>
-               _mesa_geometric_samples(fb), surf_offset);<br>
+            emit_null_surface_state(brw,<br>
+                                    _mesa_geometric_width(fb),<br>
+                                    _mesa_geometric_height(fb),<br>
+                                    _mesa_geometric_samples(fb),<br>
+                                    surf_offset);<br>
          }<br>
       }<br>
<br>
@@ -1333,7 +1309,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,<br>
          &ctx->UniformBufferBindings[<wbr>prog->sh.UniformBlocks[i]-><wbr>Binding];<br>
<br>
       if (binding->BufferObject == ctx->Shared->NullBufferObj) {<br>
-         brw->vtbl.emit_null_surface_<wbr>state(brw, 1, 1, 1, &ubo_surf_offsets[i]);<br>
+         emit_null_surface_state(brw, 1, 1, 1, &ubo_surf_offsets[i]);<br>
       } else {<br>
          struct intel_buffer_object *intel_bo =<br>
             intel_buffer_object(binding-><wbr>BufferObject);<br>
@@ -1358,7 +1334,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,<br>
          &ctx-><wbr>ShaderStorageBufferBindings[<wbr>prog->sh.ShaderStorageBlocks[<wbr>i]->Binding];<br>
<br>
       if (binding->BufferObject == ctx->Shared->NullBufferObj) {<br>
-         brw->vtbl.emit_null_surface_<wbr>state(brw, 1, 1, 1, &ssbo_surf_offsets[i]);<br>
+         emit_null_surface_state(brw, 1, 1, 1, &ssbo_surf_offsets[i]);<br>
       } else {<br>
          struct intel_buffer_object *intel_bo =<br>
             intel_buffer_object(binding-><wbr>BufferObject);<br>
@@ -1650,7 +1626,7 @@ update_image_surface(struct brw_context *brw,<br>
       }<br>
<br>
    } else {<br>
-      brw->vtbl.emit_null_surface_<wbr>state(brw, 1, 1, 1, surf_offset);<br>
+      emit_null_surface_state(brw, 1, 1, 1, surf_offset);<br>
       update_default_image_param(<wbr>brw, u, surface_idx, param);<br>
    }<br>
 }<br>
@@ -1713,7 +1689,6 @@ void<br>
 gen4_init_vtable_surface_<wbr>functions(struct brw_context *brw)<br>
 {<br>
    brw->vtbl.update_renderbuffer_<wbr>surface = gen4_update_renderbuffer_<wbr>surface;<br>
-   brw->vtbl.emit_null_surface_<wbr>state = brw_emit_null_surface_state;<br>
 }<br>
<br>
 void<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/<wbr>gen7_wm_surface_state.c<br>
deleted file mode 100644<br>
index c9d777bcc57..00000000000<br>
--- a/src/mesa/drivers/dri/i965/<wbr>gen7_wm_surface_state.c<br>
+++ /dev/null<br>
@@ -1,180 +0,0 @@<br>
-/*<br>
- * Copyright © 2011 Intel Corporation<br>
- *<br>
- * Permission is hereby granted, free of charge, to any person obtaining a<br>
- * copy of this software and associated documentation files (the "Software"),<br>
- * to deal in the Software without restriction, including without limitation<br>
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
- * and/or sell copies of the Software, and to permit persons to whom the<br>
- * Software is furnished to do so, subject to the following conditions:<br>
- *<br>
- * The above copyright notice and this permission notice (including the next<br>
- * paragraph) shall be included in all copies or substantial portions of the<br>
- * Software.<br>
- *<br>
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
- * IN THE SOFTWARE.<br>
- */<br>
-#include "main/mtypes.h"<br>
-#include "main/blend.h"<br>
-#include "main/samplerobj.h"<br>
-#include "main/texformat.h"<br>
-#include "main/teximage.h"<br>
-#include "program/prog_parameter.h"<br>
-#include "program/prog_instruction.h"<br>
-<br>
-#include "intel_mipmap_tree.h"<br>
-#include "intel_batchbuffer.h"<br>
-#include "intel_tex.h"<br>
-#include "intel_fbo.h"<br>
-#include "intel_buffer_objects.h"<br>
-<br>
-#include "brw_context.h"<br>
-#include "brw_state.h"<br>
-#include "brw_defines.h"<br>
-#include "brw_wm.h"<br>
-<br>
-void<br>
-gen7_check_surface_setup(<wbr>uint32_t *surf, bool is_render_target)<br>
-{<br>
-   unsigned num_multisamples = surf[4] & INTEL_MASK(5, 3);<br>
-   unsigned multisampled_surface_storage_<wbr>format = surf[4] & (1 << 6);<br>
-   unsigned surface_array_spacing = surf[0] & (1 << 10);<br>
-   bool is_multisampled = num_multisamples != GEN7_SURFACE_MULTISAMPLECOUNT_<wbr>1;<br>
-<br>
-   (void) surface_array_spacing;<br>
-<br>
-   /* From the Ivybridge PRM, Volume 4 Part 1, page 66 (RENDER_SURFACE_STATE<br>
-    * dword 0 bit 10 "Surface Array Spacing" Programming Notes):<br>
-    *<br>
-    *   If Multisampled Surface Storage Format is MSFMT_MSS and Number of<br>
-    *   Multisamples is not MULTISAMPLECOUNT_1, this field must be set to<br>
-    *   ARYSPC_LOD0.<br>
-    */<br>
-   if (multisampled_surface_storage_<wbr>format == GEN7_SURFACE_MSFMT_MSS<br>
-       && is_multisampled)<br>
-      assert(surface_array_spacing == GEN7_SURFACE_ARYSPC_LOD0);<br>
-<br>
-   /* From the Ivybridge PRM, Volume 4 Part 1, page 72 (RENDER_SURFACE_STATE<br>
-    * dword 4 bit 6 "Multisampled Surface Storage" Programming Notes):<br>
-    *<br>
-    *   All multisampled render target surfaces must have this field set to<br>
-    *   MSFMT_MSS.<br>
-    *<br>
-    * But also:<br>
-    *<br>
-    *   This field is ignored if Number of Multisamples is MULTISAMPLECOUNT_1.<br>
-    */<br>
-   if (is_render_target && is_multisampled) {<br>
-      assert(multisampled_surface_<wbr>storage_format == GEN7_SURFACE_MSFMT_MSS);<br>
-   }<br>
-<br>
-   /* From the Ivybridge PRM, Volume 4 Part 1, page 72 (RENDER_SURFACE_STATE<br>
-    * dword 4 bit 6 "Multisampled Surface Storage Format" Errata):<br>
-    *<br>
-    *   If the surface’s Number of Multisamples is MULTISAMPLECOUNT_8, Width<br>
-    *   is >= 8192 (meaning the actual surface width is >= 8193 pixels), this<br>
-    *   field must be set to MSFMT_MSS.<br>
-    */<br>
-   uint32_t width = GET_FIELD(surf[2], GEN7_SURFACE_WIDTH) + 1;<br>
-   if (num_multisamples == GEN7_SURFACE_MULTISAMPLECOUNT_<wbr>8 && width >= 8193) {<br>
-      assert(multisampled_surface_<wbr>storage_format == GEN7_SURFACE_MSFMT_MSS);<br>
-   }<br>
-<br>
-   /* From the Ivybridge PRM, Volume 4 Part 1, page 72 (RENDER_SURFACE_STATE<br>
-    * dword 4 bit 6 "Multisampled Surface Storage Format" Errata):<br>
-    *<br>
-    *   If the surface’s Number of Multisamples is MULTISAMPLECOUNT_8,<br>
-    *   ((Depth+1) * (Height+1)) is > 4,194,304, OR if the surface’s Number of<br>
-    *   Multisamples is MULTISAMPLECOUNT_4, ((Depth+1) * (Height+1)) is ><br>
-    *   8,388,608, this field must be set to MSFMT_DEPTH_STENCIL.This field<br>
-    *   must be set to MSFMT_DEPTH_STENCIL if Surface Format is one of the<br>
-    *   following: I24X8_UNORM, L24X8_UNORM, A24X8_UNORM, or<br>
-    *   R24_UNORM_X8_TYPELESS.<br>
-    *<br>
-    * But also (from the Programming Notes):<br>
-    *<br>
-    *   This field is ignored if Number of Multisamples is MULTISAMPLECOUNT_1.<br>
-    */<br>
-   uint32_t depth = GET_FIELD(surf[3], BRW_SURFACE_DEPTH) + 1;<br>
-   uint32_t height = GET_FIELD(surf[2], GEN7_SURFACE_HEIGHT) + 1;<br>
-   if (num_multisamples == GEN7_SURFACE_MULTISAMPLECOUNT_<wbr>8 &&<br>
-       depth * height > 4194304) {<br>
-      assert(multisampled_surface_<wbr>storage_format ==<br>
-             GEN7_SURFACE_MSFMT_DEPTH_<wbr>STENCIL);<br>
-   }<br>
-   if (num_multisamples == GEN7_SURFACE_MULTISAMPLECOUNT_<wbr>4 &&<br>
-       depth * height > 8388608) {<br>
-      assert(multisampled_surface_<wbr>storage_format ==<br>
-             GEN7_SURFACE_MSFMT_DEPTH_<wbr>STENCIL);<br>
-   }<br>
-   if (is_multisampled) {<br>
-      switch (GET_FIELD(surf[0], BRW_SURFACE_FORMAT)) {<br>
-      case ISL_FORMAT_I24X8_UNORM:<br>
-      case ISL_FORMAT_L24X8_UNORM:<br>
-      case ISL_FORMAT_A24X8_UNORM:<br>
-      case ISL_FORMAT_R24_UNORM_X8_<wbr>TYPELESS:<br>
-         assert(multisampled_surface_<wbr>storage_format ==<br>
-                GEN7_SURFACE_MSFMT_DEPTH_<wbr>STENCIL);<br>
-      }<br>
-   }<br>
-}<br>
-<br>
-/**<br>
- * Creates a null surface.<br>
- *<br>
- * This is used when the shader doesn't write to any color output.  An FB<br>
- * write to target 0 will still be emitted, because that's how the thread is<br>
- * terminated (and computed depth is returned), so we need to have the<br>
- * hardware discard the target 0 color output..<br>
- */<br>
-static void<br>
-gen7_emit_null_surface_state(<wbr>struct brw_context *brw,<br>
-                             unsigned width,<br>
-                             unsigned height,<br>
-                             unsigned samples,<br>
-                             uint32_t *out_offset)<br>
-{<br>
-   /* From the Ivy bridge PRM, Vol4 Part1 p62 (Surface Type: Programming<br>
-    * Notes):<br>
-    *<br>
-    *     A null surface is used in instances where an actual surface is not<br>
-    *     bound. When a write message is generated to a null surface, no<br>
-    *     actual surface is written to. When a read message (including any<br>
-    *     sampling engine message) is generated to a null surface, the result<br>
-    *     is all zeros. Note that a null surface type is allowed to be used<br>
-    *     with all messages, even if it is not specificially indicated as<br>
-    *     supported. All of the remaining fields in surface state are ignored<br>
-    *     for null surfaces, with the following exceptions: Width, Height,<br>
-    *     Depth, LOD, and Render Target View Extent fields must match the<br>
-    *     depth buffer’s corresponding state for all render target surfaces,<br>
-    *     including null.<br>
-    */<br>
-   uint32_t *surf = brw_state_batch(brw, 8 * 4, 32, out_offset);<br>
-   memset(surf, 0, 8 * 4);<br>
-<br>
-   /* From the Ivybridge PRM, Volume 4, Part 1, page 65,<br>
-    * Tiled Surface: Programming Notes:<br>
-    * "If Surface Type is SURFTYPE_NULL, this field must be TRUE."<br>
-    */<br>
-   surf[0] = BRW_SURFACE_NULL << BRW_SURFACE_TYPE_SHIFT |<br>
-             ISL_FORMAT_B8G8R8A8_UNORM << BRW_SURFACE_FORMAT_SHIFT |<br>
-             GEN7_SURFACE_TILING_Y;<br>
-<br>
-   surf[2] = SET_FIELD(width - 1, GEN7_SURFACE_WIDTH) |<br>
-             SET_FIELD(height - 1, GEN7_SURFACE_HEIGHT);<br>
-<br>
-   gen7_check_surface_setup(surf, true /* is_render_target */);<br>
-}<br>
-<br>
-void<br>
-gen7_init_vtable_surface_<wbr>functions(struct brw_context *brw)<br>
-{<br>
-   brw->vtbl.update_renderbuffer_<wbr>surface = brw_update_renderbuffer_<wbr>surface;<br>
-   brw->vtbl.emit_null_surface_<wbr>state = gen7_emit_null_surface_state;<br>
-}<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>gen8_surface_state.c b/src/mesa/drivers/dri/i965/<wbr>gen8_surface_state.c<br>
deleted file mode 100644<br>
index c2ac7c74a61..00000000000<br>
--- a/src/mesa/drivers/dri/i965/<wbr>gen8_surface_state.c<br>
+++ /dev/null<br>
@@ -1,82 +0,0 @@<br>
-/*<br>
- * Copyright © 2012 Intel Corporation<br>
- *<br>
- * Permission is hereby granted, free of charge, to any person obtaining a<br>
- * copy of this software and associated documentation files (the "Software"),<br>
- * to deal in the Software without restriction, including without limitation<br>
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
- * and/or sell copies of the Software, and to permit persons to whom the<br>
- * Software is furnished to do so, subject to the following conditions:<br>
- *<br>
- * The above copyright notice and this permission notice (including the next<br>
- * paragraph) shall be included in all copies or substantial portions of the<br>
- * Software.<br>
- *<br>
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL<br>
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS<br>
- * IN THE SOFTWARE.<br>
- */<br>
-<br>
-#include "main/blend.h"<br>
-#include "main/mtypes.h"<br>
-#include "main/samplerobj.h"<br>
-#include "main/texformat.h"<br>
-#include "main/teximage.h"<br>
-#include "program/prog_parameter.h"<br>
-#include "program/prog_instruction.h"<br>
-<br>
-#include "intel_mipmap_tree.h"<br>
-#include "intel_batchbuffer.h"<br>
-#include "intel_tex.h"<br>
-#include "intel_fbo.h"<br>
-#include "intel_buffer_objects.h"<br>
-#include "intel_image.h"<br>
-<br>
-#include "brw_context.h"<br>
-#include "brw_state.h"<br>
-#include "brw_defines.h"<br>
-#include "brw_wm.h"<br>
-#include "isl/isl.h"<br>
-<br>
-static uint32_t *<br>
-gen8_allocate_surface_state(<wbr>struct brw_context *brw, uint32_t *out_offset)<br>
-{<br>
-   uint32_t *surf = brw_state_batch(brw, 64, 64, out_offset);<br>
-   memset(surf, 0, 64);<br>
-   return surf;<br>
-}<br>
-<br>
-/**<br>
- * Creates a null surface.<br>
- *<br>
- * This is used when the shader doesn't write to any color output.  An FB<br>
- * write to target 0 will still be emitted, because that's how the thread is<br>
- * terminated (and computed depth is returned), so we need to have the<br>
- * hardware discard the target 0 color output..<br>
- */<br>
-static void<br>
-gen8_emit_null_surface_state(<wbr>struct brw_context *brw,<br>
-                             unsigned width,<br>
-                             unsigned height,<br>
-                             unsigned samples,<br>
-                             uint32_t *out_offset)<br>
-{<br>
-   uint32_t *surf = gen8_allocate_surface_state(<wbr>brw, out_offset);<br>
-<br>
-   surf[0] = BRW_SURFACE_NULL << BRW_SURFACE_TYPE_SHIFT |<br>
-             ISL_FORMAT_B8G8R8A8_UNORM << BRW_SURFACE_FORMAT_SHIFT |<br>
-             GEN8_SURFACE_TILING_Y;<br>
-   surf[2] = SET_FIELD(width - 1, GEN7_SURFACE_WIDTH) |<br>
-             SET_FIELD(height - 1, GEN7_SURFACE_HEIGHT);<br>
-}<br>
-<br>
-void<br>
-gen8_init_vtable_surface_<wbr>functions(struct brw_context *brw)<br>
-{<br>
-   brw->vtbl.update_renderbuffer_<wbr>surface = brw_update_renderbuffer_<wbr>surface;<br>
-   brw->vtbl.emit_null_surface_<wbr>state = gen8_emit_null_surface_state;<br>
-}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.1<br>
<br>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>