mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
radeonsi: store compute local_size into tgsi_shader_info
This is kinda a hack, but it's enough for the shader cache.
This commit is contained in:
parent
d13f240269
commit
d77557c9db
4 changed files with 10 additions and 6 deletions
|
|
@ -109,9 +109,12 @@ static void si_create_compute_state_async(void *job, int thread_index)
|
|||
si_lower_nir(&sel);
|
||||
}
|
||||
|
||||
/* Store the declared LDS size into tgsi_shader_info for the shader
|
||||
* cache to include it.
|
||||
*/
|
||||
sel.info.properties[TGSI_PROPERTY_CS_LOCAL_SIZE] = program->local_size;
|
||||
|
||||
sel.type = PIPE_SHADER_COMPUTE;
|
||||
sel.local_size = program->local_size;
|
||||
si_get_active_slot_masks(&sel.info,
|
||||
&program->active_const_and_shader_buffers,
|
||||
&program->active_samplers_and_images);
|
||||
|
|
|
|||
|
|
@ -2297,6 +2297,7 @@ void si_load_system_value(struct si_shader_context *ctx,
|
|||
void si_declare_compute_memory(struct si_shader_context *ctx)
|
||||
{
|
||||
struct si_shader_selector *sel = ctx->shader->selector;
|
||||
unsigned lds_size = sel->info.properties[TGSI_PROPERTY_CS_LOCAL_SIZE];
|
||||
|
||||
LLVMTypeRef i8p = LLVMPointerType(ctx->i8, AC_LOCAL_ADDR_SPACE);
|
||||
LLVMValueRef var;
|
||||
|
|
@ -2304,7 +2305,7 @@ void si_declare_compute_memory(struct si_shader_context *ctx)
|
|||
assert(!ctx->ac.lds);
|
||||
|
||||
var = LLVMAddGlobalInAddressSpace(ctx->ac.module,
|
||||
LLVMArrayType(ctx->i8, sel->local_size),
|
||||
LLVMArrayType(ctx->i8, lds_size),
|
||||
"compute_lds",
|
||||
AC_LOCAL_ADDR_SPACE);
|
||||
LLVMSetAlignment(var, 4);
|
||||
|
|
|
|||
|
|
@ -277,6 +277,9 @@ enum {
|
|||
};
|
||||
|
||||
enum {
|
||||
/* Use a property enum that CS wouldn't use. */
|
||||
TGSI_PROPERTY_CS_LOCAL_SIZE = TGSI_PROPERTY_FS_COORD_ORIGIN,
|
||||
|
||||
/* Use a property enum that VS wouldn't use. */
|
||||
TGSI_PROPERTY_VS_BLIT_SGPRS = TGSI_PROPERTY_FS_COORD_ORIGIN,
|
||||
|
||||
|
|
@ -390,9 +393,6 @@ struct si_shader_selector {
|
|||
*/
|
||||
unsigned colors_written_4bit;
|
||||
|
||||
/* CS parameters */
|
||||
unsigned local_size;
|
||||
|
||||
uint64_t outputs_written_before_ps; /* "get_unique_index" bits */
|
||||
uint64_t outputs_written; /* "get_unique_index" bits */
|
||||
uint32_t patch_outputs_written; /* "get_unique_index_patch" bits */
|
||||
|
|
|
|||
|
|
@ -999,7 +999,7 @@ bool si_nir_build_llvm(struct si_shader_context *ctx, struct nir_shader *nir)
|
|||
ctx->num_samplers = util_last_bit(info->samplers_declared);
|
||||
ctx->num_images = util_last_bit(info->images_declared);
|
||||
|
||||
if (ctx->shader->selector->local_size) {
|
||||
if (ctx->shader->selector->info.properties[TGSI_PROPERTY_CS_LOCAL_SIZE]) {
|
||||
assert(nir->info.stage == MESA_SHADER_COMPUTE);
|
||||
si_declare_compute_memory(ctx);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue