Mesa (main): crocus: Use PIPE_* defines rather than ones from main/config.h
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jul 1 00:15:50 UTC 2022
Module: Mesa
Branch: main
Commit: 434bc468fe308f861b7979ec9d6cede4c73db025
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=434bc468fe308f861b7979ec9d6cede4c73db025
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Jun 29 22:25:26 2022 -0700
crocus: Use PIPE_* defines rather than ones from main/config.h
Gallium drivers shouldn't be including src/mesa/main headers, but we're
picking up a rogue main/config.h via the compiler, so this code I ported
over from i965 kept compiling. Use the PIPE_* defines instead so that
we can stop including that.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17309>
---
src/gallium/drivers/crocus/crocus_query.c | 8 ++++----
src/gallium/drivers/crocus/crocus_state.c | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/gallium/drivers/crocus/crocus_query.c b/src/gallium/drivers/crocus/crocus_query.c
index 677affd7513..f0e3a013f6b 100644
--- a/src/gallium/drivers/crocus/crocus_query.c
+++ b/src/gallium/drivers/crocus/crocus_query.c
@@ -338,7 +338,7 @@ calculate_result_on_cpu(const struct intel_device_info *devinfo,
break;
case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
q->result = false;
- for (int i = 0; i < MAX_VERTEX_STREAMS; i++)
+ for (int i = 0; i < PIPE_MAX_VERTEX_STREAMS; i++)
q->result |= stream_overflowed((void *) q->map, i);
break;
case PIPE_QUERY_PIPELINE_STATISTICS_SINGLE:
@@ -385,12 +385,12 @@ calc_overflow_for_stream(struct mi_builder *b,
static struct mi_value
calc_overflow_any_stream(struct mi_builder *b, struct crocus_query *q)
{
- struct mi_value stream_result[MAX_VERTEX_STREAMS];
- for (int i = 0; i < MAX_VERTEX_STREAMS; i++)
+ struct mi_value stream_result[PIPE_MAX_VERTEX_STREAMS];
+ for (int i = 0; i < PIPE_MAX_VERTEX_STREAMS; i++)
stream_result[i] = calc_overflow_for_stream(b, q, i);
struct mi_value result = stream_result[0];
- for (int i = 1; i < MAX_VERTEX_STREAMS; i++)
+ for (int i = 1; i < PIPE_MAX_VERTEX_STREAMS; i++)
result = mi_ior(b, result, stream_result[i]);
return result;
diff --git a/src/gallium/drivers/crocus/crocus_state.c b/src/gallium/drivers/crocus/crocus_state.c
index 74549291a81..6c4b6b0fb7f 100644
--- a/src/gallium/drivers/crocus/crocus_state.c
+++ b/src/gallium/drivers/crocus/crocus_state.c
@@ -4275,12 +4275,12 @@ static uint32_t *
crocus_create_so_decl_list(const struct pipe_stream_output_info *info,
const struct brw_vue_map *vue_map)
{
- struct GENX(SO_DECL) so_decl[MAX_VERTEX_STREAMS][128];
- int buffer_mask[MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
- int next_offset[MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
- int decls[MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
+ struct GENX(SO_DECL) so_decl[PIPE_MAX_VERTEX_STREAMS][128];
+ int buffer_mask[PIPE_MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
+ int next_offset[PIPE_MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
+ int decls[PIPE_MAX_VERTEX_STREAMS] = {0, 0, 0, 0};
int max_decls = 0;
- STATIC_ASSERT(ARRAY_SIZE(so_decl[0]) >= MAX_PROGRAM_OUTPUTS);
+ STATIC_ASSERT(ARRAY_SIZE(so_decl[0]) >= PIPE_MAX_SO_OUTPUTS);
memset(so_decl, 0, sizeof(so_decl));
@@ -4292,7 +4292,7 @@ crocus_create_so_decl_list(const struct pipe_stream_output_info *info,
const int buffer = output->output_buffer;
const int varying = output->register_index;
const unsigned stream_id = output->stream;
- assert(stream_id < MAX_VERTEX_STREAMS);
+ assert(stream_id < PIPE_MAX_VERTEX_STREAMS);
buffer_mask[stream_id] |= 1 << buffer;
More information about the mesa-commit
mailing list