summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-10-26 11:12:48 -0700
committerKenneth Graunke <[email protected]>2013-10-31 11:04:37 -0700
commite095434e520f1130fb59af28da40c50c6739adb2 (patch)
treecab980f2567bc1197c9cde18389772204b9a827f /src
parent129da5b1c87e4fd45b117a092e5d022ad7041e66 (diff)
i965: Create a temporary for transform feedback output components.
This is a bit shorter. v2: Mark the temporary const (requested by Ian). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/gen7_sol_state.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_sol_state.c b/src/mesa/drivers/dri/i965/gen7_sol_state.c
index de177e20645..af46472bc9e 100644
--- a/src/mesa/drivers/dri/i965/gen7_sol_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_sol_state.c
@@ -122,12 +122,12 @@ gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
int buffer = linked_xfb_info->Outputs[i].OutputBuffer;
uint16_t decl = 0;
int varying = linked_xfb_info->Outputs[i].OutputRegister;
- unsigned component_mask =
- (1 << linked_xfb_info->Outputs[i].NumComponents) - 1;
+ const unsigned components = linked_xfb_info->Outputs[i].NumComponents;
+ unsigned component_mask = (1 << components) - 1;
/* gl_PointSize is stored in VARYING_SLOT_PSIZ.w. */
if (varying == VARYING_SLOT_PSIZ) {
- assert(linked_xfb_info->Outputs[i].NumComponents == 1);
+ assert(components == 1);
component_mask <<= 3;
} else {
component_mask <<= linked_xfb_info->Outputs[i].ComponentOffset;
@@ -145,7 +145,7 @@ gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
*/
assert(linked_xfb_info->Outputs[i].DstOffset == next_offset[buffer]);
- next_offset[buffer] += linked_xfb_info->Outputs[i].NumComponents;
+ next_offset[buffer] += components;
so_decl[i] = decl;
}