diff options
author | Kenneth Graunke <[email protected]> | 2019-04-01 11:40:33 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-07-25 18:42:55 +0000 |
commit | 204a3bb816fe6382ac14ac06a2395f4afdded43e (patch) | |
tree | 5b1338992eeb597cf2683f6872630a26e4027da2 /src/gallium/drivers/iris | |
parent | 068093e84c52238102c62e5392fcda9b9204a297 (diff) |
iris: Make an iris_genx_protos.h header for prototypes.
This lets us specify the prototypes once, instead of cut and pasting
them per generation. isl uses a similar approach (isl_genX_priv.h).
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris')
-rw-r--r-- | src/gallium/drivers/iris/Makefile.sources | 1 | ||||
-rw-r--r-- | src/gallium/drivers/iris/iris_context.h | 61 | ||||
-rw-r--r-- | src/gallium/drivers/iris/iris_genx_protos.h | 39 | ||||
-rw-r--r-- | src/gallium/drivers/iris/meson.build | 1 |
4 files changed, 74 insertions, 28 deletions
diff --git a/src/gallium/drivers/iris/Makefile.sources b/src/gallium/drivers/iris/Makefile.sources index e1adacf95d4..6e0c5e95685 100644 --- a/src/gallium/drivers/iris/Makefile.sources +++ b/src/gallium/drivers/iris/Makefile.sources @@ -42,6 +42,7 @@ IRIS_C_SOURCES = \ iris_fence.c \ iris_fence.h \ iris_formats.c \ + iris_genx_protos.h \ iris_pipe.h \ iris_pipe_control.c \ iris_program.c \ diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index 5d7991d6c20..35460445309 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -779,12 +779,6 @@ void iris_emit_end_of_pipe_sync(struct iris_batch *batch, void iris_init_flush_functions(struct pipe_context *ctx); -/* iris_blorp.c */ -void gen8_init_blorp(struct iris_context *ice); -void gen9_init_blorp(struct iris_context *ice); -void gen10_init_blorp(struct iris_context *ice); -void gen11_init_blorp(struct iris_context *ice); - /* iris_border_color.c */ void iris_init_border_color_pool(struct iris_context *ice); @@ -793,28 +787,6 @@ void iris_border_color_pool_reserve(struct iris_context *ice, unsigned count); uint32_t iris_upload_border_color(struct iris_context *ice, union pipe_color_union *color); -/* iris_state.c */ -void gen8_init_state(struct iris_context *ice); -void gen9_init_state(struct iris_context *ice); -void gen10_init_state(struct iris_context *ice); -void gen11_init_state(struct iris_context *ice); -void gen8_emit_urb_setup(struct iris_context *ice, - struct iris_batch *batch, - const unsigned size[4], - bool tess_present, bool gs_present); -void gen9_emit_urb_setup(struct iris_context *ice, - struct iris_batch *batch, - const unsigned size[4], - bool tess_present, bool gs_present); -void gen10_emit_urb_setup(struct iris_context *ice, - struct iris_batch *batch, - const unsigned size[4], - bool tess_present, bool gs_present); -void gen11_emit_urb_setup(struct iris_context *ice, - struct iris_batch *batch, - const unsigned size[4], - bool tess_present, bool gs_present); - /* iris_program.c */ void iris_upload_ubo_ssbo_surf_state(struct iris_context *ice, struct pipe_shader_buffer *buf, @@ -922,4 +894,37 @@ void iris_depth_cache_add_bo(struct iris_batch *batch, struct iris_bo *bo); void gen9_toggle_preemption(struct iris_context *ice, struct iris_batch *batch, const struct pipe_draw_info *draw); + +#ifdef genX +# include "iris_genx_protos.h" +#else +# define genX(x) gen4_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen5_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen6_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen7_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen75_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen8_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen9_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen10_##x +# include "iris_genx_protos.h" +# undef genX +# define genX(x) gen11_##x +# include "iris_genx_protos.h" +# undef genX +#endif + #endif diff --git a/src/gallium/drivers/iris/iris_genx_protos.h b/src/gallium/drivers/iris/iris_genx_protos.h new file mode 100644 index 00000000000..163af43c6e7 --- /dev/null +++ b/src/gallium/drivers/iris/iris_genx_protos.h @@ -0,0 +1,39 @@ +/* + * Copyright © 2019 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 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. + */ + +/* GenX-specific function declarations. + * + * Don't include this directly, it will be included by iris_context.h. + * + * NOTE: This header can be included multiple times, from the same file. + */ + +/* iris_state.c */ +void genX(init_state)(struct iris_context *ice); +void genX(emit_urb_setup)(struct iris_context *ice, + struct iris_batch *batch, + const unsigned size[4], + bool tess_present, bool gs_present); + +/* iris_blorp.c */ +void genX(init_blorp)(struct iris_context *ice); + diff --git a/src/gallium/drivers/iris/meson.build b/src/gallium/drivers/iris/meson.build index 7d8948c9d40..9a3bb6e2260 100644 --- a/src/gallium/drivers/iris/meson.build +++ b/src/gallium/drivers/iris/meson.build @@ -35,6 +35,7 @@ files_libiris = files( 'iris_fence.c', 'iris_fence.h', 'iris_formats.c', + 'iris_genx_protos.h', 'iris_pipe.h', 'iris_pipe_control.c', 'iris_program.c', |