Skip to content

Commit

Permalink
[tzsl] tzsl syntax MAJOR CHANGE: resource(id = x) const buffer xyz...…
Browse files Browse the repository at this point in the history
… is now buffer(id = x) const xyz...
  • Loading branch information
harrand committed Nov 16, 2024
1 parent 7f523bf commit d49cd31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/tz/imgui.vertex.tzsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ struct ImGuiVertex
uint col;
};

resource(id = 0) const buffer vertex
buffer(id = 0) const vertex
{
ImGuiVertex data[];
};

resource(id = 1) const buffer index
buffer(id = 1) const index
{
uint data[];
};

resource(id = 2) const buffer render
buffer(id = 2) const render
{
mat4 vp;
uint index_offset;
Expand Down
6 changes: 3 additions & 3 deletions src/tz/ren/quad.vertex.tzsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ struct quad_data
uint texture_id;
};

resource(id = 0) const buffer quad
buffer(id = 0) const quad
{
quad_data data[];
};

resource(id = 1) const buffer camera
buffer(id = 1) const camera
{
mat4 projection;
};

resource(id = 2) const buffer settings
buffer(id = 2) const settings
{
uint value;
};
Expand Down
2 changes: 1 addition & 1 deletion tools/tzslc/tzsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ namespace tzslc

// Finally, resources.
// Start with buffer resources.
constexpr char buffer_resource_regex[] = "resource\\(id ?= ?([0-9]+)\\) ?([a-zA-Z]*) ?buffer ([a-zA-Z_]+)";
constexpr char buffer_resource_regex[] = "buffer\\(id ?= ?([0-9]+)\\) ?([a-zA-Z]*) ?([a-zA-Z_]+)";
tzslc::transform(shader_source, std::regex{buffer_resource_regex},
[](auto beg, auto end)
{
Expand Down

0 comments on commit d49cd31

Please sign in to comment.