Commit: e5bae9b211e1c58ff67cc7d881106eb7d678e89a
Parent: 1fc97b03f8c2561f3034a7ef4606eb0cd6bfe590
Author: Randy Palamar
Date: Thu, 1 Oct 2026 07:20:19 -0700
base: make read_only imply static
I don't know why GCC cares what order these keywords are in but oh
well...
Diffstat:
17 files changed, 133 insertions(+), 133 deletions(-)
diff --git a/base_intrinsics.h b/base_intrinsics.h
@@ -37,7 +37,7 @@
#define read_only
#endif
#endif
-#define read_only const
+#define read_only static const
#if !defined(countof)
#define countof(a) (i64)(sizeof(a) / sizeof(*a))
diff --git a/beamformer.meta b/beamformer.meta
@@ -257,55 +257,55 @@
@Emit
{
- `read_only global u8 beamformer_data_kind_element_size[] = {`
+ `read_only u8 beamformer_data_kind_element_size[] = {`
@Expand(DataKindTable) ` $(size),`
`};`
``
- `read_only global u8 beamformer_data_kind_element_count[] = {`
+ `read_only u8 beamformer_data_kind_element_count[] = {`
@Expand(DataKindTable) ` $(elements),`
`};`
``
- `read_only global u8 beamformer_data_kind_byte_size[] = {`
+ `read_only u8 beamformer_data_kind_byte_size[] = {`
@Expand(DataKindTable) ` $(size) * $(elements),`
`};`
``
- `read_only global b8 beamformer_data_kind_complex[] = {`
+ `read_only b8 beamformer_data_kind_complex[] = {`
@Expand(DataKindTable) ` $(complex),`
`};`
``
- `read_only global str8 beamformer_data_kind_glsl_type[] = {`
+ `read_only str8 beamformer_data_kind_glsl_type[] = {`
@Expand(DataKindTable) ` str8_comp("$(glsl)"),`
`};`
``
- `read_only global str8 beamformer_data_kind_str8[] = {`
+ `read_only str8 beamformer_data_kind_str8[] = {`
@Expand(DataKindTable) ` str8_comp("$(name)"),`
`};`
``
- `read_only global u8 beamformer_contrast_mode_samples[] = {`
+ `read_only u8 beamformer_contrast_mode_samples[] = {`
@Expand(ContrastModeTable) ` $(samples),`
`};`
``
- `read_only global str8 beamformer_contrast_mode_strings[] = {`
+ `read_only str8 beamformer_contrast_mode_strings[] = {`
@Expand(ContrastModeTable) ` str8_comp("$(name)"),`
`};`
``
- `read_only global str8 beamformer_view_plane_tag_strings[] = {`
+ `read_only str8 beamformer_view_plane_tag_strings[] = {`
@Expand(ViewPlaneTag) ` str8_comp("$(name)"),`
`};`
``
- `read_only global u8 beamformer_acquisition_kind_has_fixed_transmits[] = {`
+ `read_only u8 beamformer_acquisition_kind_has_fixed_transmits[] = {`
@Expand(AcquisitionKindTable) ` $(fixed_transmits),`
`};`
``
- `read_only global str8 beamformer_acquisition_kind_strings[] = {`
+ `read_only str8 beamformer_acquisition_kind_strings[] = {`
@Expand(AcquisitionKindTable) ` str8_comp("$(pretty_name)"),`
`};`
``
- `read_only global str8 beamformer_filter_kind_strings[] = {`
+ `read_only str8 beamformer_filter_kind_strings[] = {`
@Expand(FilterKindTable) ` str8_comp("$(name)"),`
`};`
``
- `read_only global str8 beamformer_interpolation_mode_strings[] = {`
+ `read_only str8 beamformer_interpolation_mode_strings[] = {`
@Expand(InterpolationMode) ` str8_comp("$(name)"),`
`};`
}
diff --git a/beamformer_core.c b/beamformer_core.c
@@ -89,8 +89,8 @@ typedef struct {
GPUResourceHashBucket hash_table[GPU_RESOURCE_HASH_TABLE_COUNT];
} GPUResourceBuilder;
-read_only global BeamformerFrame beamformer_nil_frame;
-read_only global BeamformerComputePlan beamformer_nil_compute_plan;
+read_only BeamformerFrame beamformer_nil_frame;
+read_only BeamformerComputePlan beamformer_nil_compute_plan;
global BeamformerCtx *beamformer_context;
global BeamformerInput *beamformer_input;
@@ -632,7 +632,7 @@ plan_compute_pipeline(BeamformerComputePlan *cp, BeamformerParameterBlock *pb, A
}
}
- read_only local_persist BeamformerDataKind data_kind_to_element_kind[] = {
+ read_only BeamformerDataKind data_kind_to_element_kind[] = {
[BeamformerDataKind_Int16] = BeamformerDataKind_Float16,
[BeamformerDataKind_Float16] = BeamformerDataKind_Float16,
[BeamformerDataKind_Float32] = BeamformerDataKind_Float32,
@@ -641,7 +641,7 @@ plan_compute_pipeline(BeamformerComputePlan *cp, BeamformerParameterBlock *pb, A
[BeamformerDataKind_Float32Complex] = BeamformerDataKind_Float32,
};
- read_only local_persist BeamformerDataKind data_kind_to_fp_kind[] = {
+ read_only BeamformerDataKind data_kind_to_fp_kind[] = {
[BeamformerDataKind_Int16] = BeamformerDataKind_Float16,
[BeamformerDataKind_Float16] = BeamformerDataKind_Float16,
[BeamformerDataKind_Float32] = BeamformerDataKind_Float32,
diff --git a/beamformer_core.meta b/beamformer_core.meta
@@ -47,7 +47,7 @@
@Expand(PanelTable) @Enumeration(`$(name)`) PanelKind
@Emit
{
- `read_only global BeamformerPanelInfo beamformer_panel_infos[] = {`
+ `read_only BeamformerPanelInfo beamformer_panel_infos[] = {`
@Expand(PanelTable) ` {str8_comp("$(display)"), str8_comp("$(string)"), str8_comp("$(description)"), ($(list)*BeamformerPanelFlags_List)|($(needs_frame)*BeamformerPanelFlags_NeedsFrame)|($(has_settings)*BeamformerPanelFlags_HasSettings)},`
`};`
}
@@ -104,7 +104,7 @@
@Emit
{
- `read_only global BeamformerCommandInfo beamformer_command_infos[] = {`
+ `read_only BeamformerCommandInfo beamformer_command_infos[] = {`
` {0},`
@Expand(CommandTable) ` {str8_comp("$(string)"), str8_comp("$(display_string)"), str8_comp("$(description)")},`
`};`
diff --git a/beamformer_shared_memory.c b/beamformer_shared_memory.c
@@ -120,7 +120,7 @@ static_assert(sizeof(BeamformerParameterBlock) % alignof(BeamformerParameterBloc
"sizeof(BeamformerParametersBlock) must be a multiple of its alignment");
#define X(k, field) [BeamformerParameterBlockRegion_##k] = offsetof(BeamformerParameterBlock, field),
-read_only global u16 BeamformerParameterBlockRegionOffsets[BeamformerParameterBlockRegion_Count] = {
+read_only u16 BeamformerParameterBlockRegionOffsets[BeamformerParameterBlockRegion_Count] = {
BEAMFORMER_PARAMETER_BLOCK_REGION_LIST
};
#undef X
diff --git a/build.c b/build.c
@@ -149,7 +149,7 @@ typedef struct {
} Config;
global Config config;
-read_only global str8 c_file_header = str8_comp(""
+read_only str8 c_file_header = str8_comp(""
"/* See LICENSE for license details. */\n\n"
"// GENERATED CODE\n\n"
);
@@ -168,7 +168,7 @@ function void
build_log_base(BuildLogKind kind, char *format, va_list args)
{
#define X(t, pre) pre,
- read_only local_persist char *prefixes[BuildLogKind_Count + 1] = {BUILD_LOG_KINDS "[INVALID] "};
+ read_only char *prefixes[BuildLogKind_Count + 1] = {BUILD_LOG_KINDS "[INVALID] "};
#undef X
FILE *out = kind == BuildLogKind_Error? stderr : stdout;
fputs(prefixes[Min(kind, BuildLogKind_Count)], out);
@@ -1106,7 +1106,7 @@ typedef enum {
} MetaEntryKind;
#define X(k, ...) #k,
-read_only global char *meta_entry_kind_strings[] = {META_ENTRY_KIND_LIST};
+read_only char *meta_entry_kind_strings[] = {META_ENTRY_KIND_LIST};
#undef X
#define META_EMIT_LANG_LIST \
@@ -1121,31 +1121,31 @@ typedef enum {
MetaEmitLang_Count,
} MetaEmitLang;
-read_only global u8 meta_kind_elements[] = {
+read_only u8 meta_kind_elements[] = {
#define X(_k, _c, _g, _b, _m, _by, elements, ...) elements,
META_KIND_LIST
#undef X
};
-read_only global str8 meta_kind_meta_types[] = {
+read_only str8 meta_kind_meta_types[] = {
#define X(k, ...) str8_comp(#k),
META_KIND_LIST
#undef X
};
-read_only global str8 meta_kind_matlab_types[] = {
+read_only str8 meta_kind_matlab_types[] = {
#define X(_k, _c, _g, _b, m, ...) str8_comp(#m),
META_KIND_LIST
#undef X
};
-read_only global str8 meta_kind_base_c_types[] = {
+read_only str8 meta_kind_base_c_types[] = {
#define X(_k, _c, _g, base, ...) str8_comp(#base),
META_KIND_LIST
#undef X
};
-read_only global str8 meta_kind_c_types[] = {
+read_only str8 meta_kind_c_types[] = {
#define X(_k, c, ...) str8_comp(#c),
META_KIND_LIST
#undef X
@@ -1323,7 +1323,7 @@ function MetaEntryKind
meta_entry_kind_from_string(str8 s)
{
#define X(k, ...) str8_comp(#k),
- read_only local_persist str8 kinds[] = {META_ENTRY_KIND_LIST};
+ read_only str8 kinds[] = {META_ENTRY_KIND_LIST};
#undef X
MetaEntryKind result = MetaEntryKind_Invalid;
i64 id = meta_lookup_string_slow(kinds + 1, countof(kinds) - 1, s);
@@ -1404,7 +1404,7 @@ function str8
meta_parser_token_name(MetaParser *p, MetaParseToken t)
{
str8 result = str8("\"invalid\"");
- read_only local_persist str8 names[MetaParseToken_Count] = {
+ read_only str8 names[MetaParseToken_Count] = {
[MetaParseToken_EOF] = str8_comp("\"EOF\""),
#define X(k, v, ...) [MetaParseToken_## v] = str8_comp(#k),
META_PARSE_TOKEN_LIST
@@ -1650,7 +1650,7 @@ function MetaEntryArgument
meta_entry_argument_expect(MetaEntry *e, u32 index, MetaEntryArgumentKind kind)
{
#define X(k, ...) #k,
- read_only local_persist char *kinds[] = {META_ENTRY_ARGUMENT_KIND_LIST};
+ read_only char *kinds[] = {META_ENTRY_ARGUMENT_KIND_LIST};
#undef X
assert(e->argument_count > index);
@@ -1876,26 +1876,26 @@ typedef struct {
DA_STRUCT(MetaEntity, MetaEntity);
#define X(name, ...) str8_comp(#name),
-read_only global str8 meta_entity_kind_names[] = {META_ENTITY_KIND_LIST};
+read_only str8 meta_entity_kind_names[] = {META_ENTITY_KIND_LIST};
#undef X
#define X(_n, table, ...) table,
-read_only global b8 meta_entity_kind_is_table[] = {META_ENTITY_KIND_LIST};
+read_only b8 meta_entity_kind_is_table[] = {META_ENTITY_KIND_LIST};
#undef X
#define X(_n, _t, s, ...) s,
-read_only global b8 meta_entity_kind_is_struct[] = {META_ENTITY_KIND_LIST};
+read_only b8 meta_entity_kind_is_struct[] = {META_ENTITY_KIND_LIST};
#undef X
#define X(_n, _t, _s, srt, ...) srt,
-read_only global b8 meta_entity_kind_struct_reference_target[] = {META_ENTITY_KIND_LIST};
+read_only b8 meta_entity_kind_struct_reference_target[] = {META_ENTITY_KIND_LIST};
#undef X
#define X(k, ...) MetaEntityKind_##k,
-read_only global MetaEntityKind meta_struct_entity_kinds[] = {META_STRUCT_MAP_LIST};
+read_only MetaEntityKind meta_struct_entity_kinds[] = {META_STRUCT_MAP_LIST};
#undef X
#define X(_k, allow, ...) allow,
-read_only global b8 meta_struct_allow_references[] = {META_STRUCT_MAP_LIST};
+read_only b8 meta_struct_allow_references[] = {META_STRUCT_MAP_LIST};
#undef X
#define X(_k, _a, emit, ...) emit,
-read_only global b8 meta_struct_emit[] = {META_STRUCT_MAP_LIST};
+read_only b8 meta_struct_emit[] = {META_STRUCT_MAP_LIST};
#undef X
typedef enum {
@@ -2240,7 +2240,7 @@ typedef enum {
MetaExpansionToken_Count,
} MetaExpansionToken;
-read_only global str8 meta_expansion_token_strings[] = {
+read_only str8 meta_expansion_token_strings[] = {
str8_comp("EOF"),
str8_comp("Indentifier"),
str8_comp("Number"),
@@ -2537,7 +2537,7 @@ meta_pack_table_begin(MetaEntry *e, MetaTable *t)
case MetaEntryKind_Enumeration:
case MetaEntryKind_Flags:
{
- read_only local_persist str8 enumeration_fields[] = {str8_comp("name")};
+ read_only str8 enumeration_fields[] = {str8_comp("name")};
t->fields = (str8 *)enumeration_fields;
t->field_count = countof(enumeration_fields);
}break;
@@ -2549,7 +2549,7 @@ meta_pack_table_begin(MetaEntry *e, MetaTable *t)
{
meta_entry_argument_expected_(e, 0, 0);
#define X(_i, name, ...) str8_comp(#name),
- read_only local_persist str8 struct_fields[] = {META_STRUCT_FIELDS};
+ read_only str8 struct_fields[] = {META_STRUCT_FIELDS};
#undef X
t->fields = (str8 *)struct_fields;
t->field_count = countof(struct_fields);
@@ -3000,7 +3000,7 @@ meta_embed(MetaContext *ctx, MetaEntry *e, i64 entry_count)
MetaEmitOperation *op;
op = da_push(ctx->arena, ops);
op->kind = MetaEmitOperationKind_String;
- op->string = push_str8_from_parts(ctx->arena, str8(""), str8("read_only global u8 "), e->name, str8("[] = {"));
+ op->string = push_str8_from_parts(ctx->arena, str8(""), str8("read_only u8 "), e->name, str8("[] = {"));
op = da_push(ctx->arena, ops);
op->kind = MetaEmitOperationKind_FileBytes;
@@ -3027,7 +3027,7 @@ function MetaEmitLang
meta_map_emit_lang(str8 lang, MetaEntry *e)
{
#define X(k, ...) str8_comp(#k),
- read_only local_persist str8 meta_lang_strings[] = {META_EMIT_LANG_LIST};
+ read_only str8 meta_lang_strings[] = {META_EMIT_LANG_LIST};
#undef X
i64 id = meta_lookup_string_slow(meta_lang_strings, MetaEmitLang_Count, lang);
@@ -3481,15 +3481,15 @@ meta_push_struct_body(MetaContext *ctx, MetaprogramContext *m, MetaEntity *struc
b32 elements_reference = enum_count || (s->member_flags[member] & MetaBuildStructMemberFlag_ReferenceElements) != 0;
// NOTE(rnp): member name column
{
- read_only local_persist str8 elements_count_open[MetaPushStructStyle_Count] = {
+ read_only str8 elements_count_open[MetaPushStructStyle_Count] = {
[MetaPushStructStyle_C] = str8_comp("["),
[MetaPushStructStyle_MATLAB] = str8_comp("("),
};
- read_only local_persist str8 elements_count_close[MetaPushStructStyle_Count] = {
+ read_only str8 elements_count_close[MetaPushStructStyle_Count] = {
[MetaPushStructStyle_C] = str8_comp("]"),
[MetaPushStructStyle_MATLAB] = str8_comp(")"),
};
- read_only local_persist i32 name_column[MetaPushStructStyle_Count] = {
+ read_only i32 name_column[MetaPushStructStyle_Count] = {
[MetaPushStructStyle_C] = 1,
[MetaPushStructStyle_MATLAB] = 0,
};
@@ -3528,7 +3528,7 @@ meta_push_struct_body(MetaContext *ctx, MetaprogramContext *m, MetaEntity *struc
// NOTE(rnp): type column
{
- read_only local_persist i32 type_column[MetaPushStructStyle_Count] = {
+ read_only i32 type_column[MetaPushStructStyle_Count] = {
[MetaPushStructStyle_C] = 0,
[MetaPushStructStyle_MATLAB] = 1,
};
@@ -3618,7 +3618,7 @@ meta_push_shader_reload_info(MetaprogramContext *m, MetaContext *ctx)
///////////////////////////////
// NOTE(rnp): reloadable infos
- meta_begin_scope(m, str8("read_only global " META_NAMESPACE_UPPER "ShaderKind " META_NAMESPACE_LOWER "_reloadable_shader_kinds[] = {"));
+ meta_begin_scope(m, str8("read_only " META_NAMESPACE_UPPER "ShaderKind " META_NAMESPACE_LOWER "_reloadable_shader_kinds[] = {"));
{
for (da_count shader = 0; shader < ctx->base_shader_count; shader++) {
da_count id = ctx->base_shader_ids[shader];
@@ -3626,7 +3626,7 @@ meta_push_shader_reload_info(MetaprogramContext *m, MetaContext *ctx)
}
} meta_end_scope(m, str8("};\n"));
- meta_begin_scope(m, str8("read_only global str8 *" META_NAMESPACE_LOWER "_reloadable_shader_files[] = {"));
+ meta_begin_scope(m, str8("read_only str8 *" META_NAMESPACE_LOWER "_reloadable_shader_files[] = {"));
{
for (da_count shader = 0; shader < ctx->base_shader_count; shader++) {
da_count id = ctx->base_shader_ids[shader];
@@ -3638,7 +3638,7 @@ meta_push_shader_reload_info(MetaprogramContext *m, MetaContext *ctx)
}
} meta_end_scope(m, str8("};\n"));
- meta_begin_scope(m, str8("read_only global i32 " META_NAMESPACE_LOWER "_shader_reloadable_index_by_shader[] = {"));
+ meta_begin_scope(m, str8("read_only i32 " META_NAMESPACE_LOWER "_shader_reloadable_index_by_shader[] = {"));
{
for (da_count shader = 0; shader < ctx->entity_kind_counts[MetaEntityKind_Shader]; shader++) {
meta_indent(m);
@@ -3652,7 +3652,7 @@ meta_push_shader_reload_info(MetaprogramContext *m, MetaContext *ctx)
for (da_count group = 0; group < ctx->entity_kind_counts[MetaEntityKind_ShaderGroup]; group++) {
da_count id = ctx->entity_kind_ids[MetaEntityKind_ShaderGroup][group];
str8 name = ctx->entity_names.data[id];
- meta_begin_line(m, str8("read_only global i32 " META_NAMESPACE_LOWER "_reloadable"));
+ meta_begin_line(m, str8("read_only i32 " META_NAMESPACE_LOWER "_reloadable"));
for (i64 i = 0; i < name.length; i++) {
if IsUpper(name.data[i])
stream_append_byte(&m->stream, '_');
@@ -3681,7 +3681,7 @@ meta_push_shader_reload_info(MetaprogramContext *m, MetaContext *ctx)
// NOTE(rnp): shader header strings
Temp scratch;
DeferLoop(scratch = temp_begin(m->scratch), temp_end(scratch))
- DeferLoop(meta_begin_scope(m, str8("read_only global str8 " META_NAMESPACE_LOWER
+ DeferLoop(meta_begin_scope(m, str8("read_only str8 " META_NAMESPACE_LOWER
"_shader_global_header_strings[] = {")),
meta_end_scope(m, str8("};\n")))
{
@@ -3762,14 +3762,14 @@ meta_push_shader_reload_info(MetaprogramContext *m, MetaContext *ctx)
}
}
- meta_begin_scope(m, str8("read_only global b8 " META_NAMESPACE_LOWER "_shader_has_primitive[] = {"));
+ meta_begin_scope(m, str8("read_only b8 " META_NAMESPACE_LOWER "_shader_has_primitive[] = {"));
for (da_count bs = 0; bs < ctx->base_shader_count; bs++) {
MetaShader *s = &ctx->entities.data[ctx->base_shader_ids[bs]].shader;
meta_push_line(m, s->kind == MetaShaderKind_Render ? str8("1,") : str8("0,"));
}
meta_end_scope(m, str8("};\n"));
- meta_begin_scope(m, str8("read_only global b8 " META_NAMESPACE_LOWER "_shader_primitive_is_vertex[] = {"));
+ meta_begin_scope(m, str8("read_only b8 " META_NAMESPACE_LOWER "_shader_primitive_is_vertex[] = {"));
for (da_count bs = 0; bs < ctx->base_shader_count; bs++) {
MetaShader *s = &ctx->entities.data[ctx->base_shader_ids[bs]].shader;
b8 vertex = s->kind == MetaShaderKind_Render && s->render.kind == MetaShaderPrimitiveKind_Vertex;
@@ -3788,7 +3788,7 @@ meta_push_shader_bake(MetaprogramContext *m, MetaContext *ctx)
for EachElement(s->files, it) {
if (s->files[it].length > 0) {
- meta_begin_line(m, str8("read_only global u8 " META_NAMESPACE_LOWER "_shader_"));
+ meta_begin_line(m, str8("read_only u8 " META_NAMESPACE_LOWER "_shader_"));
for (i64 i = 0; i < shader_name.length; i++)
stream_append_byte(&m->stream, ToLower(shader_name.data[i]));
@@ -3807,7 +3807,7 @@ meta_push_shader_bake(MetaprogramContext *m, MetaContext *ctx)
}
}
- meta_begin_scope(m, str8("read_only global str8 *" META_NAMESPACE_LOWER "_shader_data[] = {")); {
+ meta_begin_scope(m, str8("read_only str8 *" META_NAMESPACE_LOWER "_shader_data[] = {")); {
for (da_count bs = 0; bs < ctx->base_shader_count; bs++) {
MetaShader *s = &ctx->entities.data[ctx->base_shader_ids[bs]].shader;
@@ -4124,7 +4124,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
// TODO(rnp): we may want this to include more than just the bake structs
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global MetaStructMember *meta_struct_members_by_id[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only MetaStructMember *meta_struct_members_by_id[] = {")),
meta_end_scope(m, str8("};\n")))
{
for EachIndex((u64)ctx->entity_kind_counts[MetaEntityKind_BakeParameters], id) {
@@ -4163,7 +4163,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
}
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global str8 *meta_struct_member_names_by_id[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only str8 *meta_struct_member_names_by_id[] = {")),
meta_end_scope(m, str8("};\n")))
{
for EachIndex((u64)ctx->entity_kind_counts[MetaEntityKind_BakeParameters], id) {
@@ -4177,7 +4177,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
}
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global MetaStructInfo meta_struct_info_by_id[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only MetaStructInfo meta_struct_info_by_id[] = {")),
meta_end_scope(m, str8("};\n")))
{
str8 *columns[4];
@@ -4210,7 +4210,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
/////////////////////////////////
// NOTE(rnp): shader info tables
if (ctx->entity_kind_counts[MetaEntityKind_Shader])
- DeferLoop(meta_begin_scope(m, str8("read_only global str8 " META_NAMESPACE_LOWER "_shader_names[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only str8 " META_NAMESPACE_LOWER "_shader_names[] = {")),
meta_end_scope(m, str8("};\n")))
{
for (da_count shader = 0; shader < ctx->entity_kind_counts[MetaEntityKind_Shader]; shader++) {
@@ -4222,7 +4222,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
meta_push_shader_reload_info(m, ctx);
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global i32 *" META_NAMESPACE_LOWER "_shader_header_vectors[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only i32 *" META_NAMESPACE_LOWER "_shader_header_vectors[] = {")),
meta_end_scope(m, str8("};\n")))
{
for (da_count bs = 0; bs < ctx->base_shader_count; bs++) {
@@ -4245,7 +4245,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
}
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global i32 " META_NAMESPACE_LOWER "_shader_header_vector_lengths[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only i32 " META_NAMESPACE_LOWER "_shader_header_vector_lengths[] = {")),
meta_end_scope(m, str8("};\n")))
{
for (da_count bs= 0; bs < ctx->base_shader_count; bs++) {
@@ -4258,7 +4258,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
}
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global str8 *" META_NAMESPACE_LOWER "_shader_compile_flag_names[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only str8 *" META_NAMESPACE_LOWER "_shader_compile_flag_names[] = {")),
meta_end_scope(m, str8("};\n")))
{
for (da_count bs = 0; bs < ctx->base_shader_count; bs++) {
@@ -4275,7 +4275,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
}
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global u8 " META_NAMESPACE_LOWER "_shader_compile_flag_counts[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only u8 " META_NAMESPACE_LOWER "_shader_compile_flag_counts[] = {")),
meta_end_scope(m, str8("};\n")))
{
for (da_count bs = 0; bs < ctx->base_shader_count; bs++) {
@@ -4289,7 +4289,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
}
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global i32 "
+ DeferLoop(meta_begin_scope(m, str8("read_only i32 "
META_NAMESPACE_LOWER "_base_shader_to_bake_struct_id[] = {")),
meta_end_scope(m, str8("};\n")))
{
@@ -4305,7 +4305,7 @@ metagen_emit_c_code(MetaContext *ctx, Arena *arena)
}
if (ctx->base_shader_count)
- DeferLoop(meta_begin_scope(m, str8("read_only global u8 " META_NAMESPACE_LOWER "_shader_push_constant_sizes[] = {")),
+ DeferLoop(meta_begin_scope(m, str8("read_only u8 " META_NAMESPACE_LOWER "_shader_push_constant_sizes[] = {")),
meta_end_scope(m, str8("};\n")))
{
for (da_count bs = 0; bs < ctx->base_shader_count; bs++) {
diff --git a/external/cephes.c b/external/cephes.c
@@ -29,7 +29,7 @@ cephes_i0(f64 x)
*
* lim(x->0){ exp(-x) I0(x) } = 1.
*/
- read_only local_persist f64 A[] = {
+ read_only f64 A[] = {
-4.41534164647933937950E-18,
3.33079451882223809783E-17,
-2.43127984654795469359E-16,
@@ -67,7 +67,7 @@ cephes_i0(f64 x)
*
* lim(x->inf){ exp(-x) sqrt(x) I0(x) } = 1/sqrt(2pi).
*/
- read_only local_persist f64 B[] = {
+ read_only f64 B[] = {
-7.23318048787475395456E-18,
-4.83050448594418207126E-18,
4.46562142029675999901E-17,
diff --git a/generated/beamformer.c b/generated/beamformer.c
@@ -454,7 +454,7 @@ typedef union {
BeamformerReshapeBakeParameters Reshape;
} BeamformerShaderBakeParameters;
-read_only global u8 beamformer_data_kind_element_size[] = {
+read_only u8 beamformer_data_kind_element_size[] = {
2,
2,
4,
@@ -463,7 +463,7 @@ read_only global u8 beamformer_data_kind_element_size[] = {
2,
};
-read_only global u8 beamformer_data_kind_element_count[] = {
+read_only u8 beamformer_data_kind_element_count[] = {
1,
2,
1,
@@ -472,7 +472,7 @@ read_only global u8 beamformer_data_kind_element_count[] = {
2,
};
-read_only global u8 beamformer_data_kind_byte_size[] = {
+read_only u8 beamformer_data_kind_byte_size[] = {
2 * 1,
2 * 2,
4 * 1,
@@ -481,7 +481,7 @@ read_only global u8 beamformer_data_kind_byte_size[] = {
2 * 2,
};
-read_only global b8 beamformer_data_kind_complex[] = {
+read_only b8 beamformer_data_kind_complex[] = {
0,
1,
0,
@@ -490,7 +490,7 @@ read_only global b8 beamformer_data_kind_complex[] = {
1,
};
-read_only global str8 beamformer_data_kind_glsl_type[] = {
+read_only str8 beamformer_data_kind_glsl_type[] = {
str8_comp("int16_t"),
str8_comp("i16vec2"),
str8_comp("float32_t"),
@@ -499,7 +499,7 @@ read_only global str8 beamformer_data_kind_glsl_type[] = {
str8_comp("f16vec2"),
};
-read_only global str8 beamformer_data_kind_str8[] = {
+read_only str8 beamformer_data_kind_str8[] = {
str8_comp("Int16"),
str8_comp("Int16Complex"),
str8_comp("Float32"),
@@ -508,24 +508,24 @@ read_only global str8 beamformer_data_kind_str8[] = {
str8_comp("Float16Complex"),
};
-read_only global u8 beamformer_contrast_mode_samples[] = {
+read_only u8 beamformer_contrast_mode_samples[] = {
1,
3,
};
-read_only global str8 beamformer_contrast_mode_strings[] = {
+read_only str8 beamformer_contrast_mode_strings[] = {
str8_comp("None"),
str8_comp("A1S2"),
};
-read_only global str8 beamformer_view_plane_tag_strings[] = {
+read_only str8 beamformer_view_plane_tag_strings[] = {
str8_comp("XZ"),
str8_comp("YZ"),
str8_comp("XY"),
str8_comp("Arbitrary"),
};
-read_only global u8 beamformer_acquisition_kind_has_fixed_transmits[] = {
+read_only u8 beamformer_acquisition_kind_has_fixed_transmits[] = {
1,
0,
1,
@@ -541,7 +541,7 @@ read_only global u8 beamformer_acquisition_kind_has_fixed_transmits[] = {
0,
};
-read_only global str8 beamformer_acquisition_kind_strings[] = {
+read_only str8 beamformer_acquisition_kind_strings[] = {
str8_comp("FORCES"),
str8_comp("UFORCES"),
str8_comp("HERCULES"),
@@ -557,12 +557,12 @@ read_only global str8 beamformer_acquisition_kind_strings[] = {
str8_comp("ULM"),
};
-read_only global str8 beamformer_filter_kind_strings[] = {
+read_only str8 beamformer_filter_kind_strings[] = {
str8_comp("Kaiser"),
str8_comp("MatchedChirp"),
};
-read_only global str8 beamformer_interpolation_mode_strings[] = {
+read_only str8 beamformer_interpolation_mode_strings[] = {
str8_comp("Nearest"),
str8_comp("Linear"),
str8_comp("Cubic"),
@@ -577,7 +577,7 @@ typedef enum {
BeamformerStructKind_Count,
} BeamformerStructKind;
-read_only global MetaStructMember *meta_struct_members_by_id[] = {
+read_only MetaStructMember *meta_struct_members_by_id[] = {
(MetaStructMember []){
{18, 0, 1, 0},
{18, 4, 1, 0},
@@ -651,7 +651,7 @@ read_only global MetaStructMember *meta_struct_members_by_id[] = {
},
};
-read_only global str8 *meta_struct_member_names_by_id[] = {
+read_only str8 *meta_struct_member_names_by_id[] = {
(str8 []){
str8_comp("Hadamard"),
str8_comp("DecodeMode"),
@@ -725,7 +725,7 @@ read_only global str8 *meta_struct_member_names_by_id[] = {
},
};
-read_only global MetaStructInfo meta_struct_info_by_id[] = {
+read_only MetaStructInfo meta_struct_info_by_id[] = {
{str8_comp("DecodeBakeParameters"), 11, 44, 0},
{str8_comp("FilterBakeParameters"), 13, 52, 0},
{str8_comp("DASBakeParameters"), 25, 100, 0},
@@ -733,7 +733,7 @@ read_only global MetaStructInfo meta_struct_info_by_id[] = {
{str8_comp("ReshapeBakeParameters"), 9, 36, 0},
};
-read_only global str8 beamformer_shader_names[] = {
+read_only str8 beamformer_shader_names[] = {
str8_comp("Decode"),
str8_comp("Filter"),
str8_comp("Demodulate"),
@@ -746,7 +746,7 @@ read_only global str8 beamformer_shader_names[] = {
str8_comp("RenderBeamformed"),
};
-read_only global BeamformerShaderKind beamformer_reloadable_shader_kinds[] = {
+read_only BeamformerShaderKind beamformer_reloadable_shader_kinds[] = {
BeamformerShaderKind_Decode,
BeamformerShaderKind_Filter,
BeamformerShaderKind_DAS,
@@ -757,7 +757,7 @@ read_only global BeamformerShaderKind beamformer_reloadable_shader_kinds[] = {
BeamformerShaderKind_RenderBeamformed,
};
-read_only global str8 *beamformer_reloadable_shader_files[] = {
+read_only str8 *beamformer_reloadable_shader_files[] = {
(str8 []){str8_comp("decode.glsl")},
(str8 []){str8_comp("filter.glsl")},
(str8 []){str8_comp("das.glsl")},
@@ -768,7 +768,7 @@ read_only global str8 *beamformer_reloadable_shader_files[] = {
(str8 []){str8_comp("render_3d.vert.glsl"), str8_comp("render_3d.frag.glsl")},
};
-read_only global i32 beamformer_shader_reloadable_index_by_shader[] = {
+read_only i32 beamformer_shader_reloadable_index_by_shader[] = {
0,
1,
1,
@@ -781,24 +781,24 @@ read_only global i32 beamformer_shader_reloadable_index_by_shader[] = {
7,
};
-read_only global i32 beamformer_reloadable_compute_shader_info_indices[] = {
+read_only i32 beamformer_reloadable_compute_shader_info_indices[] = {
0,
1,
2,
};
-read_only global i32 beamformer_reloadable_compute_helpers_shader_info_indices[] = {
+read_only i32 beamformer_reloadable_compute_helpers_shader_info_indices[] = {
3,
4,
5,
6,
};
-read_only global i32 beamformer_reloadable_render_shader_info_indices[] = {
+read_only i32 beamformer_reloadable_render_shader_info_indices[] = {
7,
};
-read_only global str8 beamformer_shader_global_header_strings[] = {
+read_only str8 beamformer_shader_global_header_strings[] = {
str8_comp(""
"#define DecodeMode_None 0\n"
"#define DecodeMode_Hadamard 1\n"
@@ -908,7 +908,7 @@ read_only global str8 beamformer_shader_global_header_strings[] = {
"\n"),
};
-read_only global b8 beamformer_shader_has_primitive[] = {
+read_only b8 beamformer_shader_has_primitive[] = {
0,
0,
0,
@@ -919,7 +919,7 @@ read_only global b8 beamformer_shader_has_primitive[] = {
1,
};
-read_only global b8 beamformer_shader_primitive_is_vertex[] = {
+read_only b8 beamformer_shader_primitive_is_vertex[] = {
0,
0,
0,
@@ -930,7 +930,7 @@ read_only global b8 beamformer_shader_primitive_is_vertex[] = {
1,
};
-read_only global i32 *beamformer_shader_header_vectors[] = {
+read_only i32 *beamformer_shader_header_vectors[] = {
(i32 []){0, 1, 2},
(i32 []){3, 4},
(i32 []){5, 6, 7, 8, 9},
@@ -941,7 +941,7 @@ read_only global i32 *beamformer_shader_header_vectors[] = {
(i32 []){14},
};
-read_only global i32 beamformer_shader_header_vector_lengths[] = {
+read_only i32 beamformer_shader_header_vector_lengths[] = {
3,
2,
5,
@@ -952,7 +952,7 @@ read_only global i32 beamformer_shader_header_vector_lengths[] = {
1,
};
-read_only global str8 *beamformer_shader_compile_flag_names[] = {
+read_only str8 *beamformer_shader_compile_flag_names[] = {
(str8 []){
str8_comp("CooperativeMatrix"),
str8_comp("UseSharedMemory"),
@@ -977,7 +977,7 @@ read_only global str8 *beamformer_shader_compile_flag_names[] = {
0,
};
-read_only global u8 beamformer_shader_compile_flag_counts[] = {
+read_only u8 beamformer_shader_compile_flag_counts[] = {
2,
2,
4,
@@ -988,7 +988,7 @@ read_only global u8 beamformer_shader_compile_flag_counts[] = {
0,
};
-read_only global i32 beamformer_base_shader_to_bake_struct_id[] = {
+read_only i32 beamformer_base_shader_to_bake_struct_id[] = {
0,
1,
2,
@@ -999,7 +999,7 @@ read_only global i32 beamformer_base_shader_to_bake_struct_id[] = {
-1,
};
-read_only global u8 beamformer_shader_push_constant_sizes[] = {
+read_only u8 beamformer_shader_push_constant_sizes[] = {
sizeof(BeamformerDecodePushConstants),
sizeof(BeamformerFilterPushConstants),
sizeof(BeamformerDASPushConstants),
diff --git a/generated/beamformer_core.c b/generated/beamformer_core.c
@@ -90,7 +90,7 @@ typedef struct {
str8 description;
} BeamformerCommandInfo;
-read_only global BeamformerPanelInfo beamformer_panel_infos[] = {
+read_only BeamformerPanelInfo beamformer_panel_infos[] = {
{str8_comp(""), str8_comp("nil"), str8_comp(""), (0*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
{str8_comp(""), str8_comp("split"), str8_comp(""), (0*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
{str8_comp(""), str8_comp("group"), str8_comp(""), (0*BeamformerPanelFlags_List)|(0*BeamformerPanelFlags_NeedsFrame)|(0*BeamformerPanelFlags_HasSettings)},
@@ -116,7 +116,7 @@ read_only global BeamformerPanelInfo beamformer_panel_infos[] = {
.drop_target_tree = beamformer_registers()->drop_target_tree, \
.drop_child_index = beamformer_registers()->drop_child_index, \
-read_only global BeamformerCommandInfo beamformer_command_infos[] = {
+read_only BeamformerCommandInfo beamformer_command_infos[] = {
{0},
{str8_comp("close_tab"), str8_comp("Close Tab"), str8_comp("Closes currently active tab.")},
{str8_comp("focus_tab"), str8_comp("Focus Tab"), str8_comp("Focus the currently selected tab in its group.")},
diff --git a/lib/ogl_beamformer_lib.c b/lib/ogl_beamformer_lib.c
@@ -524,7 +524,7 @@ beamformer_push_data_base(void *data, u32 data_size, i32 timeout_ms, u32 block)
}break;
case BeamformerContrastMode_A1S2:{
- read_only local_persist u8 reduce_a1s2_index_map[] = {
+ read_only u8 reduce_a1s2_index_map[] = {
[BeamformerDataKind_Int16] = 0,
[BeamformerDataKind_Int16Complex] = 0,
[BeamformerDataKind_Float32] = 1,
diff --git a/math.c b/math.c
@@ -35,7 +35,7 @@ kronecker_product_f16(f16 *out, const f16 *a, iv2 a_dim, const f16 *b, iv2 b_dim
function f16 *
make_hadamard_transpose(Arena *arena, i32 dim, b32 row_major)
{
- read_only local_persist f16 hadamard_12_12_transpose[] = {
+ read_only f16 hadamard_12_12_transpose[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1,
1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1,
@@ -50,7 +50,7 @@ make_hadamard_transpose(Arena *arena, i32 dim, b32 row_major)
1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1,
};
- read_only local_persist f16 hadamard_20_20_transpose[] = {
+ read_only f16 hadamard_20_20_transpose[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1,
1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1,
diff --git a/meta.h b/meta.h
@@ -23,13 +23,13 @@
X(U8, u8, uint8_t, uint8_t, uint8, 1, 1) \
X(STR, str8, error, error, error, 16, 1) \
-read_only global str8 meta_kind_glsl_types[] = {
+read_only str8 meta_kind_glsl_types[] = {
#define X(_k, _c, glsl, ...) str8_comp(#glsl),
META_KIND_LIST
#undef X
};
-read_only global u8 meta_kind_byte_sizes[] = {
+read_only u8 meta_kind_byte_sizes[] = {
#define X(_k, _c, _g, _b, _m, bytes, ...) bytes,
META_KIND_LIST
#undef X
diff --git a/tests/decode.c b/tests/decode.c
@@ -14,7 +14,7 @@
//#define RF_TIME_SAMPLES 2432
#define RF_TIME_SAMPLES 4096
-read_only global u32 decode_transmit_counts[] = {
+read_only u32 decode_transmit_counts[] = {
2, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128, 160, 192, 256
};
@@ -201,7 +201,7 @@ send_parameters(Options *options, u32 transmit_count)
beamformer_push_parameters(&bp);
/* NOTE(rnp): use real channel mapping so that we still get ~random~ access pattern */
- read_only local_persist i16 channel_mapping[] = {
+ read_only i16 channel_mapping[] = {
217, 129, 212, 188, 255, 131, 237, 190, 241, 130, 248, 187, 219, 128, 218, 181,
216, 134, 247, 180, 220, 132, 238, 178, 246, 133, 240, 179, 221, 135, 239, 173,
231, 137, 211, 172, 222, 139, 213, 170, 249, 138, 210, 171, 223, 136, 232, 189,
diff --git a/tests/throughput.c b/tests/throughput.c
@@ -181,7 +181,7 @@ beamformer_simple_parameters_from_zbp_file(BeamformerSimpleParameters *bp, char
raw_data->kind = ZBP_DataKind_Int16;
raw_data->compression_kind = ZBP_DataCompressionKind_ZSTD;
- read_only local_persist u8 transmit_mode_to_orientation[] = {
+ read_only u8 transmit_mode_to_orientation[] = {
[0] = (ZBP_RCAOrientation_Rows << 4) | ZBP_RCAOrientation_Rows,
[1] = (ZBP_RCAOrientation_Rows << 4) | ZBP_RCAOrientation_Columns,
[2] = (ZBP_RCAOrientation_Columns << 4) | ZBP_RCAOrientation_Rows,
@@ -231,7 +231,7 @@ beamformer_simple_parameters_from_zbp_file(BeamformerSimpleParameters *bp, char
bp->channel_count = header->channel_count;
bp->acquisition_count = header->receive_event_count;
- read_only local_persist BeamformerSamplingMode zbp_sampling_mode_to_beamformer[] = {
+ read_only BeamformerSamplingMode zbp_sampling_mode_to_beamformer[] = {
[ZBP_SamplingMode_Standard] = BeamformerSamplingMode_4X,
[ZBP_SamplingMode_Bandpass] = BeamformerSamplingMode_2X,
};
diff --git a/ui.c b/ui.c
@@ -50,7 +50,7 @@
#define UI_HASH_TABLE_COUNT 4096
-read_only global v4 g_colour_palette[] = {
+read_only v4 g_colour_palette[] = {
{{0.32f, 0.20f, 0.50f, 1.00f}},
{{0.14f, 0.39f, 0.61f, 1.00f}},
{{0.61f, 0.14f, 0.25f, 1.00f}},
@@ -451,7 +451,7 @@ typedef struct {
global BeamformerUI *ui_context;
global BeamformerInput *beamformer_input;
-read_only global UINode ui_node_nil = {
+read_only UINode ui_node_nil = {
.parent = (UINode *)&ui_node_nil,
.first_child = (UINode *)&ui_node_nil,
.last_child = (UINode *)&ui_node_nil,
@@ -459,7 +459,7 @@ read_only global UINode ui_node_nil = {
.next_sibling = (UINode *)&ui_node_nil,
};
-#define X(type, name, impl_type, impl) read_only global type ui_##name##_node_nil = {.v = (impl_type)impl};
+#define X(type, name, impl_type, impl) read_only type ui_##name##_node_nil = {.v = (impl_type)impl};
UI_STACK_LIST
#undef X
@@ -2917,7 +2917,7 @@ ui_build_frame_view_context_menu(BeamformerUIPanel *panel, BeamformerFrameView *
UIPrefHeight(ui_text_dim(1.1f, 1.f))
UIPrefWidth(ui_text_dim(1.f, 1.f))
{
- read_only local_persist str8 dimension_strings[2][2] = {
+ read_only str8 dimension_strings[2][2] = {
{str8_comp("Extent Scale Bar"), str8_comp("Magnitude Scale Bar")},
{str8_comp("Lateral Scale Bar"), str8_comp("Axial Scale Bar") },
};
@@ -3465,7 +3465,7 @@ ui_build_parameters_listing(BeamformerUIPanel *panel)
i32 dimension = iv3_dimension(bp->output_points.xyz);
if (dimension > 0) {
- read_only local_persist str8 dimension_strings[3][2] = {
+ read_only str8 dimension_strings[3][2] = {
{str8_comp("Start Point"), str8_comp("End Point") },
{str8_comp("Lateral Extent"), str8_comp("Axial Extent")},
{str8_comp("Min Corner"), str8_comp("Max Corner") },
@@ -3495,7 +3495,7 @@ ui_build_parameters_listing(BeamformerUIPanel *panel)
UIParent(unit_column) ui_spacer(0);
}
- read_only local_persist str8 axis_strings[2][3] = {
+ read_only str8 axis_strings[2][3] = {
{str8_comp(" X:"), str8_comp(" Y:"), str8_comp(" Z:")},
{str8_comp(" Min:"), str8_comp(" Max:"), },
};
diff --git a/util.c b/util.c
@@ -992,7 +992,7 @@ push_str8_f(Arena *arena, const char *format, ...)
function NumberConversion
integer_from_str8(str8 raw)
{
- read_only local_persist alignas(64) i8 lut[64] = {
+ read_only alignas(64) i8 lut[64] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
-1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
diff --git a/vulkan.c b/vulkan.c
@@ -173,7 +173,7 @@ typedef struct {
i32 entity_lock;
} VulkanContext;
-read_only global char *vk_required_instance_extensions[] = {
+read_only char *vk_required_instance_extensions[] = {
};
#if OS_WINDOWS
@@ -198,14 +198,14 @@ read_only global char *vk_required_instance_extensions[] = {
VK_OS_REQUIRED_DEVICE_EXTENSIONS_LIST
#define X(str) str8_comp(str),
-read_only global str8 vk_required_device_extensions[] = {VK_REQUIRED_DEVICE_EXTENSIONS_LIST};
+read_only str8 vk_required_device_extensions[] = {VK_REQUIRED_DEVICE_EXTENSIONS_LIST};
#undef X
#define VK_OPTIONAL_DEVICE_EXTENSIONS_LIST \
X(VK_KHR, cooperative_matrix) \
#define X(p, s, ...) str8_comp(#p "_" #s),
-read_only global str8 vk_optional_device_extensions[] = {VK_OPTIONAL_DEVICE_EXTENSIONS_LIST};
+read_only str8 vk_optional_device_extensions[] = {VK_OPTIONAL_DEVICE_EXTENSIONS_LIST};
#undef X
#define VK_REQUIRED_PHYSICAL_FEATURES \
@@ -232,14 +232,14 @@ read_only global str8 vk_optional_device_extensions[] = {VK_OPTIONAL_DEVICE_EXTE
X(VK_KHR, shader_relaxed_extended_instruction) \
#define X(p, s, ...) str8_comp(#p "_" #s),
-read_only global str8 vk_debug_extensions[] = {VK_DEBUG_EXTENSIONS};
+read_only str8 vk_debug_extensions[] = {VK_DEBUG_EXTENSIONS};
#undef X
#define VK_INSTANCE_DEBUG_EXTENSIONS_LIST \
X(VK_EXT, debug_utils) \
#define X(p, s, ...) str8_comp(#p "_" #s),
-read_only global str8 vk_instance_debug_extensions[] = {VK_INSTANCE_DEBUG_EXTENSIONS_LIST};
+read_only str8 vk_instance_debug_extensions[] = {VK_INSTANCE_DEBUG_EXTENSIONS_LIST};
#undef X
#if VulkanDebug
@@ -250,7 +250,7 @@ read_only global str8 vk_instance_debug_extensions[] = {VK_INSTANCE_DEBUG_EXTENS
#define VK_VALIDATION_LAYERS_LIST
#endif
-read_only global str8 vk_validation_layers[] = {
+read_only str8 vk_validation_layers[] = {
#define X(vendor, name, ...) str8_comp("VK_LAYER_" #vendor "_" #name),
VK_VALIDATION_LAYERS_LIST
#undef X
@@ -589,7 +589,7 @@ vk_compile_shader_module(Arena *arena, u32 kind, str8 text, str8 name)
function VkShaderStageFlags
vk_stage_flags_from_shader_kind(VulkanShaderKind kind)
{
- read_only local_persist VkShaderStageFlags map[VulkanShaderKind_Count + 1] = {
+ read_only VkShaderStageFlags map[VulkanShaderKind_Count + 1] = {
[VulkanShaderKind_Vertex] = VK_SHADER_STAGE_VERTEX_BIT,
[VulkanShaderKind_Mesh] = VK_SHADER_STAGE_MESH_BIT_EXT,
[VulkanShaderKind_Fragment] = VK_SHADER_STAGE_FRAGMENT_BIT,
@@ -1910,7 +1910,7 @@ vk_load(OSLibrary vulkan_library_handle, Stream *err)
vk_load_queues(vk->arena, err);
vk_load_graphics();
- read_only local_persist str8 default_compute_shader = str8(""
+ read_only str8 default_compute_shader = str8(""
"#version 430 core\n"
"layout(push_constant) uniform pc { uint data[256 / 4]; };\n"
"void main() {}\n"
@@ -1918,12 +1918,12 @@ vk_load(OSLibrary vulkan_library_handle, Stream *err)
VulkanPipelineCreateInfo compute_create_info = {.text = default_compute_shader, .name = str8("error_compute_shader")};
vk->default_compute_pipeline = vk_compute_pipeline_from_info(vk->arena, &compute_create_info, 256);
- read_only local_persist str8 default_vertex_shader = str8(""
+ read_only str8 default_vertex_shader = str8(""
"#version 430 core\n"
"layout(push_constant) uniform pc { uint data[256 / 4]; };\n"
"void main() {gl_Position = vec4(0);}\n"
"\n");
- read_only local_persist str8 default_fragment_shader = str8(""
+ read_only str8 default_fragment_shader = str8(""
"#version 430 core\n"
"layout(location = 0) out vec4 out_colour;"
"layout(push_constant) uniform pc { uint data[256 / 4]; };\n"
@@ -2322,14 +2322,14 @@ vk_image_allocate(GPUImage *image, u32 width, u32 height, u32 mips, u32 samples,
[VulkanImageUsage_Count] = VK_FORMAT_UNDEFINED,
};
- read_only local_persist VkImageUsageFlagBits usage_extra_bit_map[VulkanImageUsage_Count + 1] = {
+ read_only VkImageUsageFlagBits usage_extra_bit_map[VulkanImageUsage_Count + 1] = {
[VulkanImageUsage_None] = 0,
[VulkanImageUsage_Colour] = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
[VulkanImageUsage_DepthStencil] = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
[VulkanImageUsage_Count] = 0,
};
- read_only local_persist VkImageAspectFlags usage_image_aspect_map[VulkanImageUsage_Count + 1] = {
+ read_only VkImageAspectFlags usage_image_aspect_map[VulkanImageUsage_Count + 1] = {
[VulkanImageUsage_None] = 0,
[VulkanImageUsage_Colour] = VK_IMAGE_ASPECT_COLOR_BIT,
[VulkanImageUsage_DepthStencil] = VK_IMAGE_ASPECT_DEPTH_BIT|VK_IMAGE_ASPECT_STENCIL_BIT,
@@ -2569,7 +2569,7 @@ gpu_command_bind_pipeline(GPUCommandList command, VulkanHandle pipeline)
InvalidCodePath;
}
- read_only local_persist VkPipelineBindPoint bind_point_lut[GPUTimeline_Count] = {
+ read_only VkPipelineBindPoint bind_point_lut[GPUTimeline_Count] = {
[GPUTimeline_Graphics] = VK_PIPELINE_BIND_POINT_GRAPHICS,
[GPUTimeline_Compute] = VK_PIPELINE_BIND_POINT_COMPUTE,
[GPUTimeline_Transfer] = -1,
@@ -2662,7 +2662,7 @@ gpu_command_timestamp(GPUCommandList command)
VulkanCommandBuffer *vcb = vk_entity_data(command.value, VulkanEntityKind_CommandBuffer);
VulkanCommandPool *vcp = vk->command_pools[vcb->timeline];
- read_only local_persist VkPipelineStageFlags2 stage_lut[GPUTimeline_Count] = {
+ read_only VkPipelineStageFlags2 stage_lut[GPUTimeline_Count] = {
[GPUTimeline_Graphics] = VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT,
[GPUTimeline_Compute] = VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT,
[GPUTimeline_Transfer] = -1,