From fdae90aa85289cd02ee89780fb942d7a39299b5e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 29 Jun 2022 15:19:57 -0700 Subject: [PATCH] intel/compiler: Split 3DPRIM_* defines out to a separate header. These clash with genxml and will become a problem shortly. Reviewed-by: Lionel Landwerlin Part-of: --- src/gallium/drivers/crocus/crocus_program.c | 1 + src/gallium/drivers/iris/iris_program.c | 1 + src/intel/compiler/brw_clip_line.c | 1 + src/intel/compiler/brw_clip_tri.c | 1 + src/intel/compiler/brw_clip_unfilled.c | 1 + src/intel/compiler/brw_compile_ff_gs.c | 1 + src/intel/compiler/brw_compile_sf.c | 1 + src/intel/compiler/brw_eu_defines.h | 23 ---------- src/intel/compiler/brw_prim.h | 50 +++++++++++++++++++++ src/intel/compiler/brw_vec4_gs_visitor.cpp | 1 + src/intel/compiler/gfx6_gs_visitor.cpp | 1 + src/intel/compiler/meson.build | 1 + src/intel/vulkan/anv_pipeline.c | 1 + 13 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 src/intel/compiler/brw_prim.h diff --git a/src/gallium/drivers/crocus/crocus_program.c b/src/gallium/drivers/crocus/crocus_program.c index 54c1434b061..8204f94b9dc 100644 --- a/src/gallium/drivers/crocus/crocus_program.c +++ b/src/gallium/drivers/crocus/crocus_program.c @@ -44,6 +44,7 @@ #include "compiler/nir/nir_serialize.h" #include "intel/compiler/brw_compiler.h" #include "intel/compiler/brw_nir.h" +#include "intel/compiler/brw_prim.h" #include "crocus_context.h" #include "nir/tgsi_to_nir.h" diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index df0cd178312..02a748afa63 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -44,6 +44,7 @@ #include "compiler/nir/nir_serialize.h" #include "intel/compiler/brw_compiler.h" #include "intel/compiler/brw_nir.h" +#include "intel/compiler/brw_prim.h" #include "iris_context.h" #include "nir/tgsi_to_nir.h" diff --git a/src/intel/compiler/brw_clip_line.c b/src/intel/compiler/brw_clip_line.c index 2eb7131e62c..7cd335c0790 100644 --- a/src/intel/compiler/brw_clip_line.c +++ b/src/intel/compiler/brw_clip_line.c @@ -34,6 +34,7 @@ #include "program/program.h" #include "brw_clip.h" +#include "brw_prim.h" static void brw_clip_line_alloc_regs( struct brw_clip_compile *c ) { diff --git a/src/intel/compiler/brw_clip_tri.c b/src/intel/compiler/brw_clip_tri.c index 30d057cf31a..be7ba79673d 100644 --- a/src/intel/compiler/brw_clip_tri.c +++ b/src/intel/compiler/brw_clip_tri.c @@ -34,6 +34,7 @@ #include "program/program.h" #include "brw_clip.h" +#include "brw_prim.h" static void release_tmps( struct brw_clip_compile *c ) { diff --git a/src/intel/compiler/brw_clip_unfilled.c b/src/intel/compiler/brw_clip_unfilled.c index 83f9447cbd4..081e086d36f 100644 --- a/src/intel/compiler/brw_clip_unfilled.c +++ b/src/intel/compiler/brw_clip_unfilled.c @@ -34,6 +34,7 @@ #include "program/program.h" #include "brw_clip.h" +#include "brw_prim.h" /* This is performed against the original triangles, so no indirection diff --git a/src/intel/compiler/brw_compile_ff_gs.c b/src/intel/compiler/brw_compile_ff_gs.c index 1a34be9c76a..edadac08091 100644 --- a/src/intel/compiler/brw_compile_ff_gs.c +++ b/src/intel/compiler/brw_compile_ff_gs.c @@ -31,6 +31,7 @@ #include "brw_compiler.h" #include "brw_eu.h" +#include "brw_prim.h" #include "dev/intel_debug.h" diff --git a/src/intel/compiler/brw_compile_sf.c b/src/intel/compiler/brw_compile_sf.c index b8c8d8fcad7..bbd2aec47a9 100644 --- a/src/intel/compiler/brw_compile_sf.c +++ b/src/intel/compiler/brw_compile_sf.c @@ -23,6 +23,7 @@ #include "brw_compiler.h" #include "brw_eu.h" +#include "brw_prim.h" #include "dev/intel_debug.h" diff --git a/src/intel/compiler/brw_eu_defines.h b/src/intel/compiler/brw_eu_defines.h index 1d8106d1adb..8431b9e067a 100644 --- a/src/intel/compiler/brw_eu_defines.h +++ b/src/intel/compiler/brw_eu_defines.h @@ -59,29 +59,6 @@ #define GET_BITS(data, high, low) ((data & INTEL_MASK((high), (low))) >> (low)) #define GET_FIELD(word, field) (((word) & field ## _MASK) >> field ## _SHIFT) -#define _3DPRIM_POINTLIST 0x01 -#define _3DPRIM_LINELIST 0x02 -#define _3DPRIM_LINESTRIP 0x03 -#define _3DPRIM_TRILIST 0x04 -#define _3DPRIM_TRISTRIP 0x05 -#define _3DPRIM_TRIFAN 0x06 -#define _3DPRIM_QUADLIST 0x07 -#define _3DPRIM_QUADSTRIP 0x08 -#define _3DPRIM_LINELIST_ADJ 0x09 /* G45+ */ -#define _3DPRIM_LINESTRIP_ADJ 0x0A /* G45+ */ -#define _3DPRIM_TRILIST_ADJ 0x0B /* G45+ */ -#define _3DPRIM_TRISTRIP_ADJ 0x0C /* G45+ */ -#define _3DPRIM_TRISTRIP_REVERSE 0x0D -#define _3DPRIM_POLYGON 0x0E -#define _3DPRIM_RECTLIST 0x0F -#define _3DPRIM_LINELOOP 0x10 -#define _3DPRIM_POINTLIST_BF 0x11 -#define _3DPRIM_LINESTRIP_CONT 0x12 -#define _3DPRIM_LINESTRIP_BF 0x13 -#define _3DPRIM_LINESTRIP_CONT_BF 0x14 -#define _3DPRIM_TRIFAN_NOSTIPPLE 0x16 -#define _3DPRIM_PATCHLIST(n) ({ assert(n > 0 && n <= 32); 0x20 + (n - 1); }) - /* Bitfields for the URB_WRITE message, DW2 of message header: */ #define URB_WRITE_PRIM_END 0x1 #define URB_WRITE_PRIM_START 0x2 diff --git a/src/intel/compiler/brw_prim.h b/src/intel/compiler/brw_prim.h new file mode 100644 index 00000000000..28823089c1e --- /dev/null +++ b/src/intel/compiler/brw_prim.h @@ -0,0 +1,50 @@ +/* + * Copyright © 2022 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. + */ + +#ifndef BRW_PRIM_H +#define BRW_PRIM_H + +#define _3DPRIM_POINTLIST 0x01 +#define _3DPRIM_LINELIST 0x02 +#define _3DPRIM_LINESTRIP 0x03 +#define _3DPRIM_TRILIST 0x04 +#define _3DPRIM_TRISTRIP 0x05 +#define _3DPRIM_TRIFAN 0x06 +#define _3DPRIM_QUADLIST 0x07 +#define _3DPRIM_QUADSTRIP 0x08 +#define _3DPRIM_LINELIST_ADJ 0x09 /* G45+ */ +#define _3DPRIM_LINESTRIP_ADJ 0x0A /* G45+ */ +#define _3DPRIM_TRILIST_ADJ 0x0B /* G45+ */ +#define _3DPRIM_TRISTRIP_ADJ 0x0C /* G45+ */ +#define _3DPRIM_TRISTRIP_REVERSE 0x0D +#define _3DPRIM_POLYGON 0x0E +#define _3DPRIM_RECTLIST 0x0F +#define _3DPRIM_LINELOOP 0x10 +#define _3DPRIM_POINTLIST_BF 0x11 +#define _3DPRIM_LINESTRIP_CONT 0x12 +#define _3DPRIM_LINESTRIP_BF 0x13 +#define _3DPRIM_LINESTRIP_CONT_BF 0x14 +#define _3DPRIM_TRIFAN_NOSTIPPLE 0x16 +#define _3DPRIM_PATCHLIST(n) ({ assert(n > 0 && n <= 32); 0x20 + (n - 1); }) + +#endif /* BRW_PRIM_H */ diff --git a/src/intel/compiler/brw_vec4_gs_visitor.cpp b/src/intel/compiler/brw_vec4_gs_visitor.cpp index 65c5694cc85..3d6dcb26f39 100644 --- a/src/intel/compiler/brw_vec4_gs_visitor.cpp +++ b/src/intel/compiler/brw_vec4_gs_visitor.cpp @@ -32,6 +32,7 @@ #include "brw_cfg.h" #include "brw_fs.h" #include "brw_nir.h" +#include "brw_prim.h" #include "dev/intel_debug.h" namespace brw { diff --git a/src/intel/compiler/gfx6_gs_visitor.cpp b/src/intel/compiler/gfx6_gs_visitor.cpp index 825ff7988ba..12176416f1f 100644 --- a/src/intel/compiler/gfx6_gs_visitor.cpp +++ b/src/intel/compiler/gfx6_gs_visitor.cpp @@ -31,6 +31,7 @@ #include "gfx6_gs_visitor.h" #include "brw_eu.h" +#include "brw_prim.h" namespace brw { diff --git a/src/intel/compiler/meson.build b/src/intel/compiler/meson.build index 43818ba450a..e1bfc417d27 100644 --- a/src/intel/compiler/meson.build +++ b/src/intel/compiler/meson.build @@ -102,6 +102,7 @@ libintel_compiler_files = files( 'brw_nir_clamp_image_1d_2d_array_sizes.c', 'brw_packed_float.c', 'brw_predicated_break.cpp', + 'brw_prim.h', 'brw_private.h', 'brw_reg.h', 'brw_reg_type.c', diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index bcc172fb416..5ed079eba5c 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -35,6 +35,7 @@ #include "anv_private.h" #include "compiler/brw_nir.h" #include "compiler/brw_nir_rt.h" +#include "compiler/brw_prim.h" #include "anv_nir.h" #include "nir/nir_xfb_info.h" #include "spirv/nir_spirv.h"