[Mesa-dev] [PATCH 05/14] i965/blorp: Use a designated initializer for blorp_surf
Jason Ekstrand
jason at jlekstrand.net
Mon Nov 13 16:12:45 UTC 2017
This way uninitialized fields get automatically zeroed and it's safe to
add more fields to blorp_surf.
---
src/mesa/drivers/dri/i965/brw_blorp.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 58e1f8a..eae8aaa 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -154,15 +154,16 @@ blorp_surf_for_miptree(struct brw_context *brw,
intel_miptree_check_level_layer(mt, *level, start_layer + i);
}
- surf->surf = &mt->surf;
- surf->addr = (struct blorp_address) {
- .buffer = mt->bo,
- .offset = mt->offset,
- .reloc_flags = is_render_target ? EXEC_OBJECT_WRITE : 0,
+ *surf = (struct blorp_surf) {
+ .surf = &mt->surf,
+ .addr = (struct blorp_address) {
+ .buffer = mt->bo,
+ .offset = mt->offset,
+ .reloc_flags = is_render_target ? EXEC_OBJECT_WRITE : 0,
+ },
+ .aux_usage = aux_usage,
};
- surf->aux_usage = aux_usage;
-
struct isl_surf *aux_surf = NULL;
if (mt->mcs_buf)
aux_surf = &mt->mcs_buf->surf;
--
2.5.0.400.gff86faf
More information about the mesa-dev
mailing list