Mesa (master): gallium: decrease the size of pipe_stream_output_info - 532 -> 268 bytes

Marek Olšák mareko at kemper.freedesktop.org
Tue Apr 4 10:17:55 UTC 2017


Module: Mesa
Branch: master
Commit: 19bc74f5130e2861365098cf07b2d9abd634c380
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=19bc74f5130e2861365098cf07b2d9abd634c380

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sun Apr  2 01:24:47 2017 +0200

gallium: decrease the size of pipe_stream_output_info - 532 -> 268 bytes

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/drivers/radeon/r600_pipe_common.h | 2 +-
 src/gallium/drivers/radeon/r600_streamout.c   | 2 +-
 src/gallium/include/pipe/p_state.h            | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 70b28365da..fbd0ac7e16 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -486,7 +486,7 @@ struct r600_streamout {
 
 	/* External state which comes from the vertex shader,
 	 * it must be set explicitly when binding a shader. */
-	unsigned			*stride_in_dw;
+	uint16_t			*stride_in_dw;
 	unsigned			enabled_stream_buffers_mask; /* stream0 buffers0-3 in 4 LSB */
 
 	/* The state of VGT_STRMOUT_BUFFER_(CONFIG|EN). */
diff --git a/src/gallium/drivers/radeon/r600_streamout.c b/src/gallium/drivers/radeon/r600_streamout.c
index b5296aa566..a18089a3b3 100644
--- a/src/gallium/drivers/radeon/r600_streamout.c
+++ b/src/gallium/drivers/radeon/r600_streamout.c
@@ -187,7 +187,7 @@ static void r600_emit_streamout_begin(struct r600_common_context *rctx, struct r
 {
 	struct radeon_winsys_cs *cs = rctx->gfx.cs;
 	struct r600_so_target **t = rctx->streamout.targets;
-	unsigned *stride_in_dw = rctx->streamout.stride_in_dw;
+	uint16_t *stride_in_dw = rctx->streamout.stride_in_dw;
 	unsigned i, update_flags = 0;
 
 	r600_flush_vgt_streamout(rctx);
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 5d995dcc16..54bcf07868 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -206,7 +206,7 @@ struct pipe_clip_state
  */
 struct pipe_stream_output
 {
-   unsigned register_index:8;  /**< 0 to PIPE_MAX_SHADER_OUTPUTS */
+   unsigned register_index:6;  /**< 0 to 63 (OUT index) */
    unsigned start_component:2; /** 0 to 3 */
    unsigned num_components:3;  /** 1 to 4 */
    unsigned output_buffer:3;   /**< 0 to PIPE_MAX_SO_BUFFERS */
@@ -221,7 +221,7 @@ struct pipe_stream_output_info
 {
    unsigned num_outputs;
    /** stride for an entire vertex for each buffer in dwords */
-   unsigned stride[PIPE_MAX_SO_BUFFERS];
+   uint16_t stride[PIPE_MAX_SO_BUFFERS];
 
    /**
     * Array of stream outputs, in the order they are to be written in.




More information about the mesa-commit mailing list