v3d: use V3D_MAX_DRAW_BUFFERS instead of hardcoded constant
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 12 Nov 2021 09:35:04 +0000 (10:35 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 12 Nov 2021 11:04:07 +0000 (11:04 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13775>

src/broadcom/compiler/v3d_compiler.h
src/gallium/drivers/v3d/v3d_context.h

index 751e9d8..a4f4d5d 100644 (file)
@@ -799,7 +799,7 @@ struct v3d_compile {
         uint32_t uniform_array_size;
         uint32_t num_uniforms;
         uint32_t output_position_index;
-        nir_variable *output_color_var[4];
+        nir_variable *output_color_var[V3D_MAX_DRAW_BUFFERS];
         uint32_t output_sample_mask_index;
 
         struct qreg undef;
index 7b3daf4..b283929 100644 (file)
@@ -280,7 +280,7 @@ struct v3d_ssbo_stateobj {
 
 /* Hash table key for v3d->jobs */
 struct v3d_job_key {
-        struct pipe_surface *cbufs[4];
+        struct pipe_surface *cbufs[V3D_MAX_DRAW_BUFFERS];
         struct pipe_surface *zsbuf;
         struct pipe_surface *bbuf;
 };
@@ -358,7 +358,7 @@ struct v3d_job {
          * the destination surface.
          */
         uint32_t nr_cbufs;
-        struct pipe_surface *cbufs[4];
+        struct pipe_surface *cbufs[V3D_MAX_DRAW_BUFFERS];
         struct pipe_surface *zsbuf;
         struct pipe_surface *bbuf;
         /** @} */
@@ -426,7 +426,7 @@ struct v3d_job {
          * (either clears or draws) and should be stored.
          */
         uint32_t store;
-        uint32_t clear_color[4][4];
+        uint32_t clear_color[V3D_MAX_DRAW_BUFFERS][4];
         float clear_z;
         uint8_t clear_s;