LLVMBasicBlockRef loop_entry_block;
};
+static void ac_build_tbuffer_store(struct ac_llvm_context *ctx, LLVMValueRef rsrc,
+ LLVMValueRef vdata, LLVMValueRef vindex, LLVMValueRef voffset,
+ LLVMValueRef soffset, LLVMValueRef immoffset,
+ unsigned num_channels, unsigned dfmt, unsigned nfmt,
+ unsigned cache_policy, bool structurized);
+
/* Initialize module-independent parts of the context.
*
* The caller is responsible for initializing ctx::module and ctx::builder.
* or v4i32 (num_channels=3,4).
*/
void ac_build_buffer_store_dword(struct ac_llvm_context *ctx, LLVMValueRef rsrc, LLVMValueRef vdata,
- unsigned num_channels, LLVMValueRef voffset, LLVMValueRef soffset,
- unsigned inst_offset, unsigned cache_policy)
+ unsigned num_channels, LLVMValueRef vindex, LLVMValueRef voffset,
+ LLVMValueRef soffset, unsigned inst_offset, unsigned cache_policy)
{
/* Split 3 channel stores. */
if (num_channels == 3 && !ac_has_vec3_support(ctx->chip_class, false)) {
}
v01 = ac_build_gather_values(ctx, v, 2);
- ac_build_buffer_store_dword(ctx, rsrc, v01, 2, voffset, soffset, inst_offset, cache_policy);
- ac_build_buffer_store_dword(ctx, rsrc, v[2], 1, voffset, soffset, inst_offset + 8,
+ ac_build_buffer_store_dword(ctx, rsrc, v01, 2, vindex, voffset, soffset, inst_offset, cache_policy);
+ ac_build_buffer_store_dword(ctx, rsrc, v[2], 1, vindex, voffset, soffset, inst_offset + 8,
cache_policy);
return;
}
if (inst_offset)
offset = LLVMBuildAdd(ctx->builder, offset, LLVMConstInt(ctx->i32, inst_offset, 0), "");
- ac_build_buffer_store_common(ctx, rsrc, ac_to_float(ctx, vdata), ctx->i32_0, voffset, offset,
+ ac_build_buffer_store_common(ctx, rsrc, ac_to_float(ctx, vdata), vindex, voffset, offset,
cache_policy, false, false);
return;
}
unsigned nfmt = V_008F0C_BUF_NUM_FORMAT_UINT;
LLVMValueRef immoffset = LLVMConstInt(ctx->i32, inst_offset, 0);
- ac_build_raw_tbuffer_store(ctx, rsrc, vdata, voffset, soffset, immoffset, num_channels, dfmt,
- nfmt, cache_policy);
+ ac_build_tbuffer_store(ctx, rsrc, vdata, vindex, voffset, soffset, immoffset, num_channels, dfmt,
+ nfmt, cache_policy, false);
}
static LLVMValueRef ac_build_buffer_load_common(struct ac_llvm_context *ctx, LLVMValueRef rsrc,
LLVMValueRef base_ptr, LLVMValueRef index);
void ac_build_buffer_store_dword(struct ac_llvm_context *ctx, LLVMValueRef rsrc, LLVMValueRef vdata,
- unsigned num_channels, LLVMValueRef voffset, LLVMValueRef soffset,
- unsigned inst_offset, unsigned cache_policy);
+ unsigned num_channels, LLVMValueRef vindex, LLVMValueRef voffset,
+ LLVMValueRef soffset, unsigned inst_offset, unsigned cache_policy);
void ac_build_buffer_store_format(struct ac_llvm_context *ctx, LLVMValueRef rsrc, LLVMValueRef data,
LLVMValueRef vindex, LLVMValueRef voffset, unsigned cache_policy);
}
data = LLVMBuildBitCast(ctx->ac.builder, data, data_type, "");
- ac_build_buffer_store_dword(&ctx->ac, rsrc, data, num_channels, offset, ctx->ac.i32_0, 0,
- cache_policy);
+ ac_build_buffer_store_dword(&ctx->ac, rsrc, data, num_channels, NULL, offset,
+ ctx->ac.i32_0, 0, cache_policy);
}
}
cache_policy |= ac_slc;
ac_build_buffer_store_dword(&ctx->ac, descriptor, store_data, num_components,
- addr_voffset, addr_soffset, const_offset,
+ NULL, addr_voffset, addr_soffset, const_offset,
cache_policy);
break;
}
out_val = ac_to_integer(&ctx->ac, out_val);
out_val = LLVMBuildZExtOrBitCast(ctx->ac.builder, out_val, ctx->ac.i32, "");
- ac_build_buffer_store_dword(&ctx->ac, ctx->gsvs_ring[stream], out_val, 1, voffset,
+ ac_build_buffer_store_dword(&ctx->ac, ctx->gsvs_ring[stream], out_val, 1, NULL, voffset,
ac_get_arg(&ctx->ac, ctx->args->ac.gs2vs_offset), 0,
ac_glc | ac_slc | ac_swizzled);
}
break;
}
- ac_build_buffer_store_dword(&ctx->ac, so_buffers[buf], vdata, num_comps, so_write_offsets[buf],
- ctx->ac.i32_0, offset, ac_glc | ac_slc);
+ ac_build_buffer_store_dword(&ctx->ac, so_buffers[buf], vdata, num_comps, NULL,
+ so_write_offsets[buf], ctx->ac.i32_0, offset, ac_glc | ac_slc);
}
static void
continue;
}
- ac_build_buffer_store_dword(&ctx->ac, ctx->esgs_ring, out_val, 1, NULL,
+ ac_build_buffer_store_dword(&ctx->ac, ctx->esgs_ring, out_val, 1, NULL, NULL,
ac_get_arg(&ctx->ac, ctx->args.es2gs_offset),
(4 * param + chan) * 4, ac_glc | ac_slc | ac_swizzled);
}
out_val = ac_to_integer(&ctx->ac, out_val);
- ac_build_buffer_store_dword(&ctx->ac, ctx->gsvs_ring[stream], out_val, 1, voffset, soffset,
- 0, ac_glc | ac_slc | ac_swizzled);
+ ac_build_buffer_store_dword(&ctx->ac, ctx->gsvs_ring[stream], out_val, 1, NULL,
+ voffset, soffset, 0, ac_glc | ac_slc | ac_swizzled);
}
}
values[chan] = value;
if (writemask != 0xF && !is_tess_factor) {
- ac_build_buffer_store_dword(&ctx->ac, buffer, value, 1, addr, base,
+ ac_build_buffer_store_dword(&ctx->ac, buffer, value, 1, NULL, addr, base,
4 * chan, ac_glc);
}
if (writemask == 0xF && !is_tess_factor) {
LLVMValueRef value = ac_build_gather_values(&ctx->ac, values, 4);
- ac_build_buffer_store_dword(&ctx->ac, buffer, value, 4, addr, base, 0, ac_glc);
+ ac_build_buffer_store_dword(&ctx->ac, buffer, value, 4, NULL, addr, base, 0, ac_glc);
}
}
LLVMValueRef value = lshs_lds_load(ctx, ctx->ac.i32, ~0, lds_ptr);
- ac_build_buffer_store_dword(&ctx->ac, buffer, value, 4, buffer_addr, buffer_offset, 0,
+ ac_build_buffer_store_dword(&ctx->ac, buffer, value, 4, NULL, buffer_addr, buffer_offset, 0,
ac_glc);
}
}
ac_build_ifcc(&ctx->ac,
LLVMBuildICmp(ctx->ac.builder, LLVMIntEQ, rel_patch_id, ctx->ac.i32_0, ""), 6504);
ac_build_buffer_store_dword(&ctx->ac, buffer, LLVMConstInt(ctx->ac.i32, 0x80000000, 0), 1,
- ctx->ac.i32_0, tf_base, offset, ac_glc);
+ NULL, ctx->ac.i32_0, tf_base, offset, ac_glc);
ac_build_endif(&ctx->ac, 6504);
offset += 4;
}
/* Store the tessellation factors. */
- ac_build_buffer_store_dword(&ctx->ac, buffer, vec0, MIN2(stride, 4), byteoffset, tf_base, offset,
- ac_glc);
+ ac_build_buffer_store_dword(&ctx->ac, buffer, vec0, MIN2(stride, 4), NULL, byteoffset,
+ tf_base, offset, ac_glc);
offset += 16;
if (vec1)
- ac_build_buffer_store_dword(&ctx->ac, buffer, vec1, stride - 4, byteoffset, tf_base, offset,
- ac_glc);
+ ac_build_buffer_store_dword(&ctx->ac, buffer, vec1, stride - 4, NULL, byteoffset,
+ tf_base, offset, ac_glc);
/* Store the tess factors into the offchip buffer if TES reads them. */
if (shader->key.ge.part.tcs.epilog.tes_reads_tess_factors) {
: util_next_power_of_two(outer_comps);
outer_vec = ac_build_gather_values(&ctx->ac, outer, outer_vec_size);
- ac_build_buffer_store_dword(&ctx->ac, buf, outer_vec, outer_comps, tf_outer_offset, base, 0,
- ac_glc);
+ ac_build_buffer_store_dword(&ctx->ac, buf, outer_vec, outer_comps, NULL, tf_outer_offset,
+ base, 0, ac_glc);
if (inner_comps) {
param_inner = si_shader_io_get_unique_index_patch(VARYING_SLOT_TESS_LEVEL_INNER);
tf_inner_offset = get_tcs_tes_buffer_address(ctx, rel_patch_id, NULL,
inner_vec =
inner_comps == 1 ? inner[0] : ac_build_gather_values(&ctx->ac, inner, inner_comps);
- ac_build_buffer_store_dword(&ctx->ac, buf, inner_vec, inner_comps, tf_inner_offset, base,
- 0, ac_glc);
+ ac_build_buffer_store_dword(&ctx->ac, buf, inner_vec, inner_comps, NULL,
+ tf_inner_offset, base, 0, ac_glc);
}
}
break;
}
- ac_build_buffer_store_dword(&ctx->ac, so_buffers[buf_idx], vdata, num_comps,
+ ac_build_buffer_store_dword(&ctx->ac, so_buffers[buf_idx], vdata, num_comps, NULL,
so_write_offsets[buf_idx], ctx->ac.i32_0, stream_out->dst_offset * 4,
ac_glc | ac_slc);
}