-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from floooh/dlang-generator
New attempt at D language generator.
- Loading branch information
Showing
7 changed files
with
543 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#pragma once | ||
#include "generator.h" | ||
|
||
namespace shdc::gen { | ||
|
||
class SokolDGenerator : public Generator { | ||
protected: | ||
virtual void gen_prolog(const GenInput& gen); | ||
virtual void gen_epilog(const GenInput& gen); | ||
virtual void gen_prerequisites(const GenInput& gen); | ||
virtual void gen_uniform_block_decl(const GenInput& gen, const refl::UniformBlock& ub); | ||
virtual void gen_storage_buffer_decl(const GenInput& gen, const refl::StorageBuffer& sbuf); | ||
virtual void gen_shader_array_start(const GenInput& gen, const std::string& array_name, size_t num_bytes, Slang::Enum slang); | ||
virtual void gen_shader_array_end(const GenInput& gen); | ||
virtual void gen_shader_desc_func(const GenInput& gen, const refl::ProgramReflection& prog); | ||
virtual std::string lang_name(); | ||
virtual std::string comment_block_start(); | ||
virtual std::string comment_block_line_prefix(); | ||
virtual std::string comment_block_end(); | ||
virtual std::string shader_bytecode_array_name(const std::string& snippet_name, Slang::Enum slang); | ||
virtual std::string shader_source_array_name(const std::string& snippet_name, Slang::Enum slang); | ||
virtual std::string get_shader_desc_help(const std::string& prog_name); | ||
virtual std::string uniform_type(refl::Type::Enum e); | ||
virtual std::string flattened_uniform_type(refl::Type::Enum e); | ||
virtual std::string image_type(refl::ImageType::Enum e); | ||
virtual std::string image_sample_type(refl::ImageSampleType::Enum e); | ||
virtual std::string sampler_type(refl::SamplerType::Enum e); | ||
virtual std::string backend(Slang::Enum e); | ||
virtual std::string struct_name(const std::string& name); | ||
virtual std::string vertex_attr_name(const std::string& snippet_name, const refl::StageAttr& attr); | ||
virtual std::string image_bind_slot_name(const refl::Image& img); | ||
virtual std::string sampler_bind_slot_name(const refl::Sampler& smp); | ||
virtual std::string uniform_block_bind_slot_name(const refl::UniformBlock& ub); | ||
virtual std::string storage_buffer_bind_slot_name(const refl::StorageBuffer& sbuf); | ||
virtual std::string vertex_attr_definition(const std::string& snippet_name, const refl::StageAttr& attr); | ||
virtual std::string image_bind_slot_definition(const refl::Image& img); | ||
virtual std::string sampler_bind_slot_definition(const refl::Sampler& smp); | ||
virtual std::string uniform_block_bind_slot_definition(const refl::UniformBlock& ub); | ||
virtual std::string storage_buffer_bind_slot_definition(const refl::StorageBuffer& sbuf); | ||
private: | ||
virtual void gen_struct_interior_decl_std430(const GenInput& gen, const refl::Type& struc, int alignment, int pad_to_size); | ||
}; | ||
|
||
} // namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters