i965: Port 3DSTATE_VF_TOPOLOGY on gen8+ to genxml.
authorRafael Antognolli <rafael.antognolli@intel.com>
Wed, 10 May 2017 00:12:12 +0000 (17:12 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 12 May 2017 04:27:38 +0000 (21:27 -0700)
With this last state ported, we can get rid of gen8_draw_upload.c.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/gen8_draw_upload.c
src/mesa/drivers/dri/i965/genX_state_upload.c

index 349777cf24a2a0708fc4996c2e3cee42a4c05f06..d4e0bfd1a8facdc2a54b7fdfb5fcc0fece9fcf54 100644 (file)
@@ -91,7 +91,6 @@ i965_FILES = \
        gen7_urb.c \
        gen7_wm_surface_state.c \
        gen8_depth_state.c \
-       gen8_draw_upload.c \
        gen8_multisample_state.c \
        gen8_surface_state.c \
        hsw_queryobj.c \
index 525521d4ce32d830a63444fe1cd7fd57e1bec2f7..954969c4bf89ea39b079e8c173ab4b8bf82be4de 100644 (file)
@@ -112,7 +112,6 @@ extern const struct brw_tracked_state gen7_l3_state;
 extern const struct brw_tracked_state gen7_push_constant_space;
 extern const struct brw_tracked_state gen7_urb;
 extern const struct brw_tracked_state gen8_pma_fix;
-extern const struct brw_tracked_state gen8_vf_topology;
 extern const struct brw_tracked_state brw_cs_work_groups_surface;
 
 static inline bool
index 01c3ac3e9a23a03c33aab357d15ad55232c7833d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2012 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include "main/bufferobj.h"
-#include "main/context.h"
-#include "main/enums.h"
-#include "main/macros.h"
-
-#include "brw_draw.h"
-#include "brw_defines.h"
-#include "brw_context.h"
-#include "brw_state.h"
-
-#include "intel_batchbuffer.h"
-#include "intel_buffer_objects.h"
-
-static void
-gen8_emit_vf_topology(struct brw_context *brw)
-{
-   BEGIN_BATCH(2);
-   OUT_BATCH(_3DSTATE_VF_TOPOLOGY << 16 | (2 - 2));
-   OUT_BATCH(brw->primitive);
-   ADVANCE_BATCH();
-}
-
-const struct brw_tracked_state gen8_vf_topology = {
-   .dirty = {
-      .mesa = 0,
-      .brw = BRW_NEW_BLORP |
-             BRW_NEW_PRIMITIVE,
-   },
-   .emit = gen8_emit_vf_topology,
-};
index a0eedb5dc605d2f9f12d42ef54ea9f6f0f8e1e8a..3921a6f2d4be441880bd77b3d1b6c64077468d87 100644 (file)
@@ -4046,7 +4046,27 @@ static const struct brw_tracked_state genX(ps_blend) = {
    },
    .emit = genX(upload_ps_blend)
 };
+#endif
+
+/* ---------------------------------------------------------------------- */
+
+#if GEN_GEN >= 8
+static void
+genX(emit_vf_topology)(struct brw_context *brw)
+{
+   brw_batch_emit(brw, GENX(3DSTATE_VF_TOPOLOGY), vftopo) {
+      vftopo.PrimitiveTopologyType = brw->primitive;
+   }
+}
 
+static const struct brw_tracked_state genX(vf_topology) = {
+   .dirty = {
+      .mesa = 0,
+      .brw = BRW_NEW_BLORP |
+             BRW_NEW_PRIMITIVE,
+   },
+   .emit = genX(emit_vf_topology),
+};
 #endif
 
 /* ---------------------------------------------------------------------- */
@@ -4384,7 +4404,7 @@ genX(init_atoms)(struct brw_context *brw)
 
       &genX(drawing_rect),
 
-      &gen8_vf_topology,
+      &genX(vf_topology),
 
       &brw_indices,
       &genX(index_buffer),