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 <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
@@ -122,12 +122,12 @@ gen7_upload_3dstate_so_decl_list(struct brw_context *brw,
|
|||||||
int buffer = linked_xfb_info->Outputs[i].OutputBuffer;
|
int buffer = linked_xfb_info->Outputs[i].OutputBuffer;
|
||||||
uint16_t decl = 0;
|
uint16_t decl = 0;
|
||||||
int varying = linked_xfb_info->Outputs[i].OutputRegister;
|
int varying = linked_xfb_info->Outputs[i].OutputRegister;
|
||||||
unsigned component_mask =
|
const unsigned components = linked_xfb_info->Outputs[i].NumComponents;
|
||||||
(1 << linked_xfb_info->Outputs[i].NumComponents) - 1;
|
unsigned component_mask = (1 << components) - 1;
|
||||||
|
|
||||||
/* gl_PointSize is stored in VARYING_SLOT_PSIZ.w. */
|
/* gl_PointSize is stored in VARYING_SLOT_PSIZ.w. */
|
||||||
if (varying == VARYING_SLOT_PSIZ) {
|
if (varying == VARYING_SLOT_PSIZ) {
|
||||||
assert(linked_xfb_info->Outputs[i].NumComponents == 1);
|
assert(components == 1);
|
||||||
component_mask <<= 3;
|
component_mask <<= 3;
|
||||||
} else {
|
} else {
|
||||||
component_mask <<= linked_xfb_info->Outputs[i].ComponentOffset;
|
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]);
|
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;
|
so_decl[i] = decl;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user