PitchHut
Log in / Sign up
HCC
50 views
Compile C code to SPIR-V for seamless GPU programming.
Pitch

HCC is a C compiler designed to translate C code into SPIR-V for Vulkan, facilitating efficient code sharing between CPU and GPU. With features like support for modern Vulkan, shader types, and a dedicated maths library, it enhances GPU programming while simplifying shader development. Join the alpha testing to contribute and shape the future of this promising tool.

Description

Hero C Compiler (HCC) is an innovative C compiler designed specifically to compile C codebases into SPIR-V for seamless integration with the Vulkan graphics API. With HCC, developers can effortlessly share structures, enums, and functions between CPU and GPU code, paving the way for more efficient graphics programming.

Key Features:

  • Cross-Platform Compatibility: Enjoy full support for both Windows and Linux environments.
  • Latest Vulkan Support: Compatible with Vulkan version 1.3 and higher, ensuring you have the tools needed for modern graphics development.
  • C11 Compatibility: The compiler aims to support a substantial part of the C11 standard, making it easier for developers to use familiar syntax.
  • Shader Types Supported: Create and manage Vertex, Pixel, and Compute shaders effortlessly.
  • Integrated Maths Library: Utilize our built-in maths library for both CPU and GPU programming - check it out here.
  • Advanced Features: Access textures, atomics, and various intrinsics for enhanced performance—details here.
  • _Generic Support: Leverage C-compliant overloaded functions for maths and intrinsic operations.
  • Vulkan Interop Code: Easily integrate with your graphic engine using our Vulkan setup code—further details here.
  • Multiple Shader Support: Compile multiple shaders in a single file to streamline shader management.
  • Live Playground Application: Experiment and test your shader code in real-time with our playground application—explore this feature here.
  • Robust Sample Applications: Directly interact with 5 working samples and a comprehensive samples application for guidance—more info here.

Limitations:

While HCC is a powerful tool, it does come with certain limitations:

  • Pointer support is restricted outside compiler intrinsics.
  • Union support is not implemented yet.
  • Limited string and struct bitfield support across platforms.

Usage Example:

Here’s a concise example of a vertex and pixel shader using HCC:

typedef struct Vertex Vertex;
struct Vertex {
    f32x2    pos;
    uint32_t color;
};

// Additional structs for TriangleBC and RasterizerState... 
HCC_VERTEX void triangle_vs(...) {
    // Vertex shader code here...
}

HCC_PIXEL void triangle_ps(...) {
    // Pixel shader code here...
}

Find Out More:

To explore further, download the latest release here and access comprehensive documentation here.

Community and Support:

Join our vibrant Discord community to engage in discussions related to HCC or graphics programming. You can also witness live coding sessions on Twitch.

Join Us as a Contributor:

We welcome contributors who are passionate about C programming to help expand HCC’s capabilities. Join the conversation on Discord or contribute by opening GitHub issues for features you’re interested in working on.