diff options
author | Jason Ekstrand <[email protected]> | 2016-08-27 21:39:16 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-09-12 19:42:57 -0700 |
commit | 7ddb21708c800dfbe3cea2df6aaaf7aed852761b (patch) | |
tree | d6572da54873cc2f06aeef659aecaa1a868e89ab /src/mesa | |
parent | 376d1dc2f1f5a36fe20ede5defe394b87b385731 (diff) |
intel/isl: Add an isl_swizzle structure and use it for isl_view swizzles
This should be more compact than the enum isl_channel_select[4] that we
were using before. It's also very convenient because we already had such a
structure in the Vulkan driver we just needed to pull it over.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 89d76c13bdd..3068c84ca18 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -217,12 +217,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, .levels = 1, .base_array_layer = irb->mt_layer / layer_multiplier, .array_len = MAX2(irb->layer_count, 1), - .channel_select = { - ISL_CHANNEL_SELECT_RED, - ISL_CHANNEL_SELECT_GREEN, - ISL_CHANNEL_SELECT_BLUE, - ISL_CHANNEL_SELECT_ALPHA, - }, + .swizzle = ISL_SWIZZLE_IDENTITY, .usage = ISL_SURF_USAGE_RENDER_TARGET_BIT, }; @@ -611,11 +606,11 @@ brw_update_texture_surface(struct gl_context *ctx, .levels = intel_obj->_MaxLevel - obj->BaseLevel + 1, .base_array_layer = obj->MinLayer, .array_len = view_num_layers, - .channel_select = { - swizzle_to_scs(GET_SWZ(swizzle, 0), need_green_to_blue), - swizzle_to_scs(GET_SWZ(swizzle, 1), need_green_to_blue), - swizzle_to_scs(GET_SWZ(swizzle, 2), need_green_to_blue), - swizzle_to_scs(GET_SWZ(swizzle, 3), need_green_to_blue), + .swizzle = { + .r = swizzle_to_scs(GET_SWZ(swizzle, 0), need_green_to_blue), + .g = swizzle_to_scs(GET_SWZ(swizzle, 1), need_green_to_blue), + .b = swizzle_to_scs(GET_SWZ(swizzle, 2), need_green_to_blue), + .a = swizzle_to_scs(GET_SWZ(swizzle, 3), need_green_to_blue), }, .usage = ISL_SURF_USAGE_TEXTURE_BIT, }; @@ -1189,12 +1184,7 @@ update_renderbuffer_read_surfaces(struct brw_context *brw) .levels = 1, .base_array_layer = irb->mt_layer / mt_layer_unit, .array_len = irb->layer_count, - .channel_select = { - ISL_CHANNEL_SELECT_RED, - ISL_CHANNEL_SELECT_GREEN, - ISL_CHANNEL_SELECT_BLUE, - ISL_CHANNEL_SELECT_ALPHA, - }, + .swizzle = ISL_SWIZZLE_IDENTITY, .usage = ISL_SURF_USAGE_TEXTURE_BIT, }; @@ -1748,12 +1738,7 @@ update_image_surface(struct brw_context *brw, .levels = 1, .base_array_layer = obj->MinLayer + u->_Layer, .array_len = num_layers, - .channel_select = { - ISL_CHANNEL_SELECT_RED, - ISL_CHANNEL_SELECT_GREEN, - ISL_CHANNEL_SELECT_BLUE, - ISL_CHANNEL_SELECT_ALPHA, - }, + .swizzle = ISL_SWIZZLE_IDENTITY, .usage = ISL_SURF_USAGE_STORAGE_BIT, }; |