diff options
author | Kenneth Graunke <[email protected]> | 2017-05-10 23:55:47 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-05-29 21:46:42 -0700 |
commit | 55862ed4775b24099a5f3b1978be7a552e71c439 (patch) | |
tree | 0b3e2258e550ca88196d0ef4e01aef9e3f3ea431 /src/mesa/drivers | |
parent | c6b623f60127a4ef913f927dcde0b44f9d46eb64 (diff) |
i965: Use GENX(packet_length) rather than hardcoded dword counts.
This is clearer and less likely to break in the future.
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/genX_state_upload.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index 44e3e99d33d..ca2b1959e29 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -2137,16 +2137,19 @@ genX(upload_sf_clip_viewport)(struct brw_context *brw) #define clv sfv struct GENX(SF_CLIP_VIEWPORT) sfv; uint32_t sf_clip_vp_offset; - uint32_t *sf_clip_map = brw_state_batch(brw, 16 * 4 * viewport_count, - 64, &sf_clip_vp_offset); + uint32_t *sf_clip_map = + brw_state_batch(brw, GENX(SF_CLIP_VIEWPORT_length) * 4 * viewport_count, + 64, &sf_clip_vp_offset); #else struct GENX(SF_VIEWPORT) sfv; struct GENX(CLIP_VIEWPORT) clv; uint32_t sf_vp_offset, clip_vp_offset; - uint32_t *sf_map = brw_state_batch(brw, 8 * 4 * viewport_count, - 32, &sf_vp_offset); - uint32_t *clip_map = brw_state_batch(brw, 4 * 4 * viewport_count, - 32, &clip_vp_offset); + uint32_t *sf_map = + brw_state_batch(brw, GENX(SF_VIEWPORT_length) * 4 * viewport_count, + 32, &sf_vp_offset); + uint32_t *clip_map = + brw_state_batch(brw, GENX(CLIP_VIEWPORT_length) * 4 * viewport_count, + 32, &clip_vp_offset); #endif /* _NEW_BUFFERS */ @@ -2208,12 +2211,12 @@ genX(upload_sf_clip_viewport)(struct brw_context *brw) #if GEN_GEN >= 7 GENX(SF_CLIP_VIEWPORT_pack)(NULL, sf_clip_map, &sfv); - sf_clip_map += 16; + sf_clip_map += GENX(SF_CLIP_VIEWPORT_length); #else GENX(SF_VIEWPORT_pack)(NULL, sf_map, &sfv); GENX(CLIP_VIEWPORT_pack)(NULL, clip_map, &clv); - sf_map += 8; - clip_map += 4; + sf_map += GENX(SF_VIEWPORT_length); + clip_map += GENX(CLIP_VIEWPORT_length); #endif } |