freedreno: Drop the "write" arg to emit_const_bo now relocs don't care.
authorEric Anholt <eric@anholt.net>
Mon, 11 May 2020 16:46:03 +0000 (09:46 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 12 May 2020 16:30:57 +0000 (16:30 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4967>

src/gallium/drivers/freedreno/a3xx/fd3_emit.c
src/gallium/drivers/freedreno/a4xx/fd4_emit.c
src/gallium/drivers/freedreno/a5xx/fd5_emit.c
src/gallium/drivers/freedreno/a6xx/fd6_const.c
src/gallium/drivers/freedreno/ir3/ir3_const.h

index 3a693046f125c352ec1f71995737266f94ebdf8b..acb09f58e0d77f977b67a154382e19b54dd31e33 100644 (file)
@@ -93,7 +93,7 @@ fd3_emit_const(struct fd_ringbuffer *ring, gl_shader_stage type,
 }
 
 static void
-fd3_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
+fd3_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type,
                uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        uint32_t anum = align(num, 4);
@@ -111,11 +111,7 @@ fd3_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean writ
 
        for (i = 0; i < num; i++) {
                if (prscs[i]) {
-                       if (write) {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       } else {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       }
+                       OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
                } else {
                        OUT_RING(ring, 0xbad00000 | (i << 16));
                }
@@ -145,12 +141,12 @@ emit_const(struct fd_ringbuffer *ring,
 
 static void
 emit_const_bo(struct fd_ringbuffer *ring,
-               const struct ir3_shader_variant *v, bool write, uint32_t dst_offset,
+               const struct ir3_shader_variant *v, uint32_t dst_offset,
                uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        /* TODO inline this */
        assert(dst_offset + num < v->constlen * 4);
-       fd3_emit_const_bo(ring, v->type, write, dst_offset, num, prscs, offsets);
+       fd3_emit_const_bo(ring, v->type, dst_offset, num, prscs, offsets);
 }
 
 #define VERT_TEX_OFF    0
index f93fb3f73818d8856d4a6fa4327cc118b0d07daf..ff5a6a3127111917e36b5987b48e6b7ea49fd9a3 100644 (file)
@@ -88,7 +88,7 @@ fd4_emit_const(struct fd_ringbuffer *ring, gl_shader_stage type,
 }
 
 static void
-fd4_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
+fd4_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type,
                uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        uint32_t anum = align(num, 4);
@@ -106,11 +106,7 @@ fd4_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean writ
 
        for (i = 0; i < num; i++) {
                if (prscs[i]) {
-                       if (write) {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       } else {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       }
+                       OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
                } else {
                        OUT_RING(ring, 0xbad00000 | (i << 16));
                }
@@ -140,12 +136,12 @@ emit_const(struct fd_ringbuffer *ring,
 
 static void
 emit_const_bo(struct fd_ringbuffer *ring,
-               const struct ir3_shader_variant *v, bool write, uint32_t dst_offset,
+               const struct ir3_shader_variant *v, uint32_t dst_offset,
                uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        /* TODO inline this */
        assert(dst_offset + num < v->constlen * 4);
-       fd4_emit_const_bo(ring, v->type, write, dst_offset, num, prscs, offsets);
+       fd4_emit_const_bo(ring, v->type, dst_offset, num, prscs, offsets);
 }
 
 static void
index 508676ba4ec68fbce8a109962fa1356c31ef5e97..570eb7dc1d8774dafe32a3ea354be850006ee5db 100644 (file)
@@ -92,7 +92,7 @@ fd5_emit_const(struct fd_ringbuffer *ring, gl_shader_stage type,
 }
 
 static void
-fd5_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
+fd5_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type,
                uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        uint32_t anum = align(num, 2);
@@ -111,11 +111,7 @@ fd5_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean writ
 
        for (i = 0; i < num; i++) {
                if (prscs[i]) {
-                       if (write) {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       } else {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       }
+                       OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
                } else {
                        OUT_RING(ring, 0xbad00000 | (i << 16));
                        OUT_RING(ring, 0xbad00000 | (i << 16));
@@ -148,12 +144,12 @@ emit_const(struct fd_ringbuffer *ring,
 
 static void
 emit_const_bo(struct fd_ringbuffer *ring,
-               const struct ir3_shader_variant *v, bool write, uint32_t dst_offset,
+               const struct ir3_shader_variant *v, uint32_t dst_offset,
                uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        /* TODO inline this */
        assert(dst_offset + num < v->constlen * 4);
-       fd5_emit_const_bo(ring, v->type, write, dst_offset, num, prscs, offsets);
+       fd5_emit_const_bo(ring, v->type, dst_offset, num, prscs, offsets);
 }
 
 void
index 45165b969e190e7772073cae41d153f1f9c996ac..86ea1d1e41cb1f21f5a249ec07c88ddb75addd0a 100644 (file)
@@ -105,7 +105,7 @@ fd6_emit_const(struct fd_ringbuffer *ring, gl_shader_stage type,
 }
 
 static void
-fd6_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
+fd6_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type,
                uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        uint32_t anum = align(num, 2);
@@ -124,11 +124,7 @@ fd6_emit_const_bo(struct fd_ringbuffer *ring, gl_shader_stage type, boolean writ
 
        for (i = 0; i < num; i++) {
                if (prscs[i]) {
-                       if (write) {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       } else {
-                               OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
-                       }
+                       OUT_RELOC(ring, fd_resource(prscs[i])->bo, offsets[i], 0, 0);
                } else {
                        OUT_RING(ring, 0xbad00000 | (i << 16));
                        OUT_RING(ring, 0xbad00000 | (i << 16));
@@ -161,12 +157,12 @@ emit_const(struct fd_ringbuffer *ring,
 
 static void
 emit_const_bo(struct fd_ringbuffer *ring,
-               const struct ir3_shader_variant *v, bool write, uint32_t dst_offset,
+               const struct ir3_shader_variant *v, uint32_t dst_offset,
                uint32_t num, struct pipe_resource **prscs, uint32_t *offsets)
 {
        /* TODO inline this */
        assert(dst_offset + num < v->constlen * 4);
-       fd6_emit_const_bo(ring, v->type, write, dst_offset, num, prscs, offsets);
+       fd6_emit_const_bo(ring, v->type, dst_offset, num, prscs, offsets);
 }
 
 static void
index 1112d626d0f54b04da0dfe550e214cea7d15429d..157bc273bde90751b041b9c94162bd6d891e1c2a 100644 (file)
@@ -45,7 +45,7 @@ static void emit_const(struct fd_ringbuffer *ring,
                const void *user_buffer, struct pipe_resource *buffer);
 
 static void emit_const_bo(struct fd_ringbuffer *ring,
-               const struct ir3_shader_variant *v, bool write, uint32_t dst_offset,
+               const struct ir3_shader_variant *v, uint32_t dst_offset,
                uint32_t num, struct pipe_resource **prscs, uint32_t *offsets);
 
 
@@ -151,7 +151,7 @@ ir3_emit_ubos(struct fd_screen *screen, const struct ir3_shader_variant *v,
 
                assert(offset * 4 + params < v->constlen * 4);
 
-               emit_const_bo(ring, v, false, offset * 4, params, prscs, offsets);
+               emit_const_bo(ring, v, offset * 4, params, prscs, offsets);
        }
 }
 
@@ -305,7 +305,7 @@ emit_tfbos(struct fd_context *ctx, const struct ir3_shader_variant *v,
 
                assert(offset * 4 + params < v->constlen * 4);
 
-               emit_const_bo(ring, v, true, offset * 4, params, prscs, offsets);
+               emit_const_bo(ring, v, offset * 4, params, prscs, offsets);
        }
 }