Do not use result index for types. #3

Open
opened 2026-02-28 17:46:51 +00:00 by kbz_8 · 0 comments
Owner

Instead of

Variable: struct {
        storage_class: spv.SpvStorageClass,
        type_word: SpvWord,
        type: Type,
        value: Value,
},

use

Variable: struct {
        storage_class: spv.SpvStorageClass,
        type: *const TypeData,
        value: Value,
},

It may be a good idea to have a separate types table only in the module to be used by runtimes. It would avoid a ton of useless allocations and may even speed up them

Instead of ```zig Variable: struct { storage_class: spv.SpvStorageClass, type_word: SpvWord, type: Type, value: Value, }, ``` use ```zig Variable: struct { storage_class: spv.SpvStorageClass, type: *const TypeData, value: Value, }, ``` It may be a good idea to have a separate types table only in the module to be used by runtimes. It would avoid a ton of useless allocations and may even speed up them
kbz_8 added reference improved-types-management 2026-02-28 17:49:34 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kbz_8/SPIRV-Interpreter#3