Coder Social home page Coder Social logo

osor_vulkan's People

Contributors

dlandahl avatar osor-io avatar toocanzs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

osor_vulkan's Issues

Unable to compile generate_vulkan_code.jai on beta 0.1.061

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.