This was only used prior to Skylake, which anv no longer supports.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18208>
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
data = ANV_DESCRIPTOR_SURFACE_STATE;
- if (device->info.ver < 9)
- data |= ANV_DESCRIPTOR_IMAGE_PARAM;
if (device->has_bindless_images)
data |= ANV_DESCRIPTOR_STORAGE_IMAGE;
break;
if (data & ANV_DESCRIPTOR_STORAGE_IMAGE)
size += sizeof(struct anv_storage_image_descriptor);
- if (data & ANV_DESCRIPTOR_IMAGE_PARAM)
- size += BRW_IMAGE_PARAM_SIZE * 4;
-
if (data & ANV_DESCRIPTOR_ADDRESS_RANGE)
size += sizeof(struct anv_address_range_descriptor);
return VK_SUCCESS;
}
-static void
-anv_descriptor_set_write_image_param(uint32_t *param_desc_map,
- const struct brw_image_param *param)
-{
-#define WRITE_PARAM_FIELD(field, FIELD) \
- for (unsigned i = 0; i < ARRAY_SIZE(param->field); i++) \
- param_desc_map[BRW_IMAGE_PARAM_##FIELD##_OFFSET + i] = param->field[i]
-
- WRITE_PARAM_FIELD(offset, OFFSET);
- WRITE_PARAM_FIELD(size, SIZE);
- WRITE_PARAM_FIELD(stride, STRIDE);
- WRITE_PARAM_FIELD(tiling, TILING);
- WRITE_PARAM_FIELD(swizzling, SWIZZLING);
- WRITE_PARAM_FIELD(size, SIZE);
-
-#undef WRITE_PARAM_FIELD
-}
-
static uint32_t
anv_surface_state_to_handle(struct anv_state state)
{
return;
if (data & ANV_DESCRIPTOR_STORAGE_IMAGE) {
- assert(!(data & ANV_DESCRIPTOR_IMAGE_PARAM));
assert(image_view->n_planes == 1);
struct anv_storage_image_descriptor desc_data = {
.vanilla = anv_surface_state_to_handle(
};
memcpy(desc_map, &desc_data, sizeof(desc_data));
}
-
- if (data & ANV_DESCRIPTOR_IMAGE_PARAM) {
- /* Storage images can only ever have one plane */
- assert(image_view->n_planes == 1);
- const struct brw_image_param *image_param =
- &image_view->planes[0].lowered_storage_image_param;
-
- anv_descriptor_set_write_image_param(desc_map, image_param);
- }
}
void
}
if (data & ANV_DESCRIPTOR_STORAGE_IMAGE) {
- assert(!(data & ANV_DESCRIPTOR_IMAGE_PARAM));
struct anv_storage_image_descriptor desc_data = {
.vanilla = anv_surface_state_to_handle(
buffer_view->storage_surface_state),
};
memcpy(desc_map, &desc_data, sizeof(desc_data));
}
-
- if (data & ANV_DESCRIPTOR_IMAGE_PARAM) {
- anv_descriptor_set_write_image_param(desc_map,
- &buffer_view->lowered_storage_image_param);
- }
}
void
enum isl_aux_usage aux_usage,
const union isl_color_value *clear_color,
enum anv_image_view_state_flags flags,
- struct anv_surface_state *state_inout,
- struct brw_image_param *image_param_out)
+ struct anv_surface_state *state_inout)
{
const uint32_t plane = anv_image_aspect_to_plane(image, aspect);
state_inout->clear_address.offset |= *clear_addr_dw & 0x3f;
}
}
-
- if (image_param_out) {
- assert(view_usage == ISL_SURF_USAGE_STORAGE_BIT);
- isl_surf_fill_image_param(&device->isl_dev, image_param_out,
- &surface->isl, &view);
- }
}
static uint32_t
ISL_SURF_USAGE_TEXTURE_BIT,
optimal_aux_usage, NULL,
ANV_IMAGE_VIEW_STATE_TEXTURE_OPTIMAL,
- &iview->planes[vplane].optimal_sampler_surface_state,
- NULL);
+ &iview->planes[vplane].optimal_sampler_surface_state);
anv_image_fill_surface_state(device, image, 1ULL << iaspect_bit,
&iview->planes[vplane].isl,
ISL_SURF_USAGE_TEXTURE_BIT,
general_aux_usage, NULL,
0,
- &iview->planes[vplane].general_sampler_surface_state,
- NULL);
+ &iview->planes[vplane].general_sampler_surface_state);
}
/* NOTE: This one needs to go last since it may stomp isl_view.format */
ISL_SURF_USAGE_STORAGE_BIT,
general_aux_usage, NULL,
0,
- &iview->planes[vplane].storage_surface_state,
- NULL);
+ &iview->planes[vplane].storage_surface_state);
if (isl_is_storage_image_format(format.isl_format)) {
iview->planes[vplane].lowered_storage_surface_state.state =
ISL_SURF_USAGE_STORAGE_BIT,
general_aux_usage, NULL,
ANV_IMAGE_VIEW_STATE_STORAGE_LOWERED,
- &iview->planes[vplane].lowered_storage_surface_state,
- NULL);
+ &iview->planes[vplane].lowered_storage_surface_state);
} else {
/* In this case, we support the format but, because there's no
* SPIR-V format specifier corresponding to it, we only support it
view->address, view->range,
(lowered_format == ISL_FORMAT_RAW ? 1 :
isl_format_get_layout(lowered_format)->bpb / 8));
-
- isl_buffer_fill_image_param(&device->isl_dev,
- &view->lowered_storage_image_param,
- format.isl_format, view->range);
} else {
view->storage_surface_state = (struct anv_state){ 0 };
view->lowered_storage_surface_state = (struct anv_state){ 0 };
b->cursor = nir_before_instr(&intrin->instr);
- ASSERTED const bool use_bindless = state->pdevice->has_bindless_images;
-
- if (intrin->intrinsic == nir_intrinsic_image_deref_load_param_intel) {
- b->cursor = nir_instr_remove(&intrin->instr);
-
- assert(!use_bindless); /* Otherwise our offsets would be wrong */
- const unsigned param = nir_intrinsic_base(intrin);
-
- nir_ssa_def *desc =
- build_load_var_deref_descriptor_mem(b, deref, param * 16,
- intrin->dest.ssa.num_components,
- intrin->dest.ssa.bit_size, state);
-
- nir_ssa_def_rewrite_uses(&intrin->dest.ssa, desc);
- } else if (binding_offset > MAX_BINDING_TABLE_SIZE) {
+ if (binding_offset > MAX_BINDING_TABLE_SIZE) {
const unsigned desc_comp =
image_binding_needs_lowered_surface(var) ? 1 : 0;
nir_ssa_def *desc =
ANV_DESCRIPTOR_SAMPLER_STATE = (1 << 1),
/** The descriptor contains an actual buffer view */
ANV_DESCRIPTOR_BUFFER_VIEW = (1 << 2),
- /** The descriptor contains auxiliary image layout data */
- ANV_DESCRIPTOR_IMAGE_PARAM = (1 << 3),
- /** The descriptor contains auxiliary image layout data */
- ANV_DESCRIPTOR_INLINE_UNIFORM = (1 << 4),
+ /** The descriptor contains inline uniform data */
+ ANV_DESCRIPTOR_INLINE_UNIFORM = (1 << 3),
/** anv_address_range_descriptor with a buffer address and range */
- ANV_DESCRIPTOR_ADDRESS_RANGE = (1 << 5),
+ ANV_DESCRIPTOR_ADDRESS_RANGE = (1 << 4),
/** Bindless surface handle */
- ANV_DESCRIPTOR_SAMPLED_IMAGE = (1 << 6),
+ ANV_DESCRIPTOR_SAMPLED_IMAGE = (1 << 5),
/** Storage image handles */
- ANV_DESCRIPTOR_STORAGE_IMAGE = (1 << 7),
+ ANV_DESCRIPTOR_STORAGE_IMAGE = (1 << 6),
};
struct anv_descriptor_set_binding_layout {
struct anv_state surface_state;
struct anv_state storage_surface_state;
struct anv_state lowered_storage_surface_state;
-
- struct brw_image_param lowered_storage_image_param;
};
struct anv_push_descriptor_set {
*/
struct anv_surface_state storage_surface_state;
struct anv_surface_state lowered_storage_surface_state;
-
- struct brw_image_param lowered_storage_image_param;
} planes[3];
};
enum isl_aux_usage aux_usage,
const union isl_color_value *clear_color,
enum anv_image_view_state_flags flags,
- struct anv_surface_state *state_inout,
- struct brw_image_param *image_param_out);
+ struct anv_surface_state *state_inout);
struct anv_image_create_info {
const VkImageCreateInfo *vk_info;
ISL_SURF_USAGE_RENDER_TARGET_BIT,
aux_usage, &fast_clear_color,
0, /* anv_image_view_state_flags */
- &gfx->color_att[i].surface_state,
- NULL);
+ &gfx->color_att[i].surface_state);
add_surface_state_relocs(cmd_buffer, gfx->color_att[i].surface_state);