Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lev2 glfx parser : "storage_interface" #163

Open
tweakoz opened this issue May 27, 2023 · 1 comment
Open

lev2 glfx parser : "storage_interface" #163

tweakoz opened this issue May 27, 2023 · 1 comment

Comments

@tweakoz
Copy link
Owner

tweakoz commented May 27, 2023

add a new interface type to the glfx language / parser.
basically allow storage objects (SSBOS) to be in standalone interface blocks so we can share (inherit) them across multiple shaders

Say I want an SSBO layout to be shared between a compute shader and vertex shader.
eg.

/////////////////////////////////////////////

storage_interface my_storage_interface {

layout(std430, binding = 0) buffer {
int num_vertices;
mat4 mvp_L;
mat4 mvp_R;
vec3 obj_nrmz;
vec2 LW;
InputVertex inp_vertex[16384];
OutputVertex out_vertex[65536];

} ssbo_compute;

} // storage_interface my_storage_interface {

compute_interface my_compute_interface
: my_storage_interface {
inputs {
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1);
}
}
vertex_interface my_vertex_interface
: my_storage_interface {
outputs {
vec2 frg_uv;
vec2 frg_age_rand;
}
}

/////////////////////////////////////////////

Also create a StorageBlock AST node so we can have improved introspective abilities for improved automation (automatic address calculation based on layout std.
Also remove GL details from grammar so we can use same storage nodes across graphics api's (OpenGL, Vulkan, Metal, etc)

@tweakoz
Copy link
Owner Author

tweakoz commented Aug 21, 2023

Rework this a bit in light of new shader PEG parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant