<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, May 1, 2017 at 6:43 PM, Rafael Antognolli <span dir="ltr"><<a href="mailto:rafael.antognolli@intel.com" target="_blank">rafael.antognolli@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We need to use some enums inside genX_state_upload.c, but including the<br>
whole header will cause several conflicts between things defined in this<br>
header and the genxml auto-generated headers.<br>
<br>
So create a separate header that is included both by brw_eu_defines.h<br>
and genX_state_upload.c.<br>
<br>
Signed-off-by: Rafael Antognolli <<a href="mailto:rafael.antognolli@intel.com">rafael.antognolli@intel.com</a>><br>
Acked-by: Reviewed-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
 src/intel/Makefile.sources              |  1 +-<br>
 src/intel/compiler/brw_<wbr>defines_common.h | 46 ++++++++++++++++++++++++++-<br>
 src/intel/compiler/brw_eu_<wbr>defines.h     | 22 +------------<br>
 3 files changed, 48 insertions(+), 21 deletions(-)<br>
 create mode 100644 src/intel/compiler/brw_<wbr>defines_common.h<br>
<br>
diff --git a/src/intel/Makefile.sources b/src/intel/Makefile.sources<br>
index e9a39a6..652f376 100644<br>
--- a/src/intel/Makefile.sources<br>
+++ b/src/intel/Makefile.sources<br>
@@ -27,6 +27,7 @@ COMPILER_FILES = \<br>
        compiler/brw_compiler.h \<br>
        compiler/brw_dead_control_<wbr>flow.cpp \<br>
        compiler/brw_dead_control_<wbr>flow.h \<br>
+       compiler/brw_defines_common.h \<br>
        compiler/brw_disasm.c \<br>
        compiler/brw_eu.c \<br>
        compiler/brw_eu_compact.c \<br>
diff --git a/src/intel/compiler/brw_<wbr>defines_common.h b/src/intel/compiler/brw_<wbr>defines_common.h<br>
new file mode 100644<br>
index 0000000..fdae125<br>
--- /dev/null<br>
+++ b/src/intel/compiler/brw_<wbr>defines_common.h<br>
@@ -0,0 +1,46 @@<br>
+/*<br>
+ * Copyright © 2017 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>
+#ifndef BRW_DEFINES_COMMON_H<br>
+#endif // BRW_DEFINES_COMMON_H<br>
+<br>
+enum brw_pixel_shader_computed_<wbr>depth_mode {<br>
+   BRW_PSCDEPTH_OFF   = 0, /* PS does not compute depth */<br>
+   BRW_PSCDEPTH_ON    = 1, /* PS computes depth; no guarantee about value */<br>
+   BRW_PSCDEPTH_ON_GE = 2, /* PS guarantees output depth >= source depth */<br>
+   BRW_PSCDEPTH_ON_LE = 3, /* PS guarantees output depth <= source depth */<br></blockquote><div><br></div><div>These are provided by the pack header at least on gen8.  If they're not available elsewhere, we should just add them.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+};<br>
+<br>
+enum brw_barycentric_mode {<br>
+   BRW_BARYCENTRIC_PERSPECTIVE_<wbr>PIXEL       = 0,<br>
+   BRW_BARYCENTRIC_PERSPECTIVE_<wbr>CENTROID    = 1,<br>
+   BRW_BARYCENTRIC_PERSPECTIVE_<wbr>SAMPLE      = 2,<br>
+   BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_PIXEL    = 3,<br>
+   BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_CENTROID = 4,<br>
+   BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_SAMPLE   = 5,<br></blockquote><div><br></div><div>These are also in the pack header.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+   BRW_BARYCENTRIC_MODE_COUNT              = 6<br>
+};<br>
+#define BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_BITS \<br>
+   ((1 << BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_PIXEL) | \<br>
+    (1 << BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_CENTROID) | \<br>
+    (1 << BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_SAMPLE))<br></blockquote><div><br></div><div>These are not<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff --git a/src/intel/compiler/brw_eu_<wbr>defines.h b/src/intel/compiler/brw_eu_<wbr>defines.h<br>
index 13a70f6..51f9cbc 100644<br>
--- a/src/intel/compiler/brw_eu_<wbr>defines.h<br>
+++ b/src/intel/compiler/brw_eu_<wbr>defines.h<br>
@@ -33,6 +33,7 @@<br>
 #define BRW_EU_DEFINES_H<br>
<br>
 #include "util/macros.h"<br>
+#include "brw_defines_common.h"<br>
<br>
 /* The following hunk, up-to "Execution Unit" is used by both the<br>
  * intel/compiler and i965 codebase. */<br>
@@ -72,27 +73,6 @@<br>
 #define _3DPRIM_TRIFAN_NOSTIPPLE  0x16<br>
 #define _3DPRIM_PATCHLIST(n) ({ assert(n > 0 && n <= 32); 0x20 + (n - 1); })<br>
<br>
-enum brw_barycentric_mode {<br>
-   BRW_BARYCENTRIC_PERSPECTIVE_<wbr>PIXEL       = 0,<br>
-   BRW_BARYCENTRIC_PERSPECTIVE_<wbr>CENTROID    = 1,<br>
-   BRW_BARYCENTRIC_PERSPECTIVE_<wbr>SAMPLE      = 2,<br>
-   BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_PIXEL    = 3,<br>
-   BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_CENTROID = 4,<br>
-   BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_SAMPLE   = 5,<br>
-   BRW_BARYCENTRIC_MODE_COUNT              = 6<br>
-};<br>
-#define BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_BITS \<br>
-   ((1 << BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_PIXEL) | \<br>
-    (1 << BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_CENTROID) | \<br>
-    (1 << BRW_BARYCENTRIC_<wbr>NONPERSPECTIVE_SAMPLE))<br>
-<br>
-enum brw_pixel_shader_computed_<wbr>depth_mode {<br>
-   BRW_PSCDEPTH_OFF   = 0, /* PS does not compute depth */<br>
-   BRW_PSCDEPTH_ON    = 1, /* PS computes depth; no guarantee about value */<br>
-   BRW_PSCDEPTH_ON_GE = 2, /* PS guarantees output depth >= source depth */<br>
-   BRW_PSCDEPTH_ON_LE = 3, /* PS guarantees output depth <= source depth */<br>
-};<br>
-<br>
 /* Bitfields for the URB_WRITE message, DW2 of message header: */<br>
 #define URB_WRITE_PRIM_END             0x1<br>
 #define URB_WRITE_PRIM_START           0x2<br>
<span class="HOEnZb"><font color="#888888">--<br>
git-series 0.9.1<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>