osor-io / osor_vulkan Goto Github PK
View Code? Open in Web Editor NEW:volcano: Vulkan module for Jai
License: Other
:volcano: Vulkan module for Jai
License: Other
Trying to compile generate_vulkan_code.jai
on beta 0.1.061 gives the following errors:
Vulkan_Latest/generate_code/generate_vulkan_code.jai:3626,29: Error: Undeclared identifier 'get_enum_name'.
for values
{
name := tprint("%", get_enum_name(it));
...
I assume that get_enum_name
was renamed to enum_value_to_name
, and I've tried to fixed that here Toocanzs@388af06
Then I ran into issues with table_find
now requiring a pointer to the table, which I fixed here Toocanzs@9ea758d
After attempting to fix those two, I ran generate_vulkan_code.exe on the vk.xml file provided by this repo, and the generated vulkan_header.jai
has half complete functions and it's missing a lot of structs.
Just as an example vulkan_header.jai:6327,32: Error: We parsed a declaration, so we expected a semicolon after it, but saw this instead.
commandBuffer : VkCommandBuffer,
pEncodeInfo : *VkVideoEncodeInfoKHR) #foreign;
}
It seems like the get_enum_name and table changes are either incorrect or there are other compiler changes under the hood changing the behavior. Here's the difference between those two functions
// beta 0.1.061
enum_value_to_name :: (e_value: $Enum) -> string {
info := type_info(Enum);
#assert type_of(<<info) == Type_Info_Enum; // Otherwise you called this wrong. Could use #modify to be cleaner, enable overloading.
for info.values {
if it == xx e_value {
return xx info.names[it_index];
}
}
return "";
}
// beta 0.0.048
get_enum_name :: (e_value : $Enum) -> string {
info := type_info(Enum);
assert(info.type == .ENUM);
for info.values {
if it == xx e_value {
return xx info.names[it_index];
}
}
return "";
}
// beta 0.1.061
table_find :: (table: *Table, key: table.Key_Type) -> (table.Value_Type, success: bool #must) {
pointer := inline table_find_pointer(table, key);
if pointer return << pointer, true;
dummy: table.Value_Type = ---;
return dummy, false;
}
table_find_pointer :: (table: *Table, key: table.Key_Type) -> *table.Value_Type {
if !table.allocated return null;
Walk_Table(#code {
entry := *table.entries[index];
if entry.hash == hash {
if table.compare_function(entry.key, key) return *entry.value;
}
#if COUNT_COLLISIONS table.find_collisions += 1;
});
return null;
}
// beta 0.0.048
table_find :: (table: Table, key: table.Key_Type) -> (table.Value_Type, success: bool #must) {
pointer := inline table_find_pointer(table, key);
if pointer return << pointer, true;
dummy: table.Value_Type = ---;
return dummy, false;
}
table_find_pointer :: (table: Table, key: table.Key_Type) -> *table.Value_Type {
if !table.allocated return null;
hash := table.hash_function(key);
if hash < FIRST_VALID_HASH hash += FIRST_VALID_HASH;
index := hash & (table.allocated - 1);
while table.entries[index].hash {
entry := *table.entries[index];
if entry.hash == hash {
if table.compare_function(entry.key, key) return *entry.value;
}
index += 1;
if index >= table.allocated index = 0;
}
return null;
}
I've also tried beta 0.1.058 but it seems that doesn't work either. Unsure what's going on here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.