ShaderCompiler2

Functions

int64_t get_git_files_last_commit_timestamp(dag::ConstSpan<SimpleString> file_path)

Get the timestamp of the most recent commit for list of files.

Note

The timestamp is in milliseconds

Note

If any of the files are locally modified or there are local commits not present in remote, the function will return 0

Parameters:

file_paths – The list of file paths

Returns:

The timestamp of the most recent commit

Functions

void close_shader_class()
void add_shader_class(ShaderClass *sc, shc::TargetContext &ctx)
int add_fshader(dag::ConstSpan<unsigned> code, shc::TargetContext &ctx)
int add_vprog(dag::ConstSpan<unsigned> vs, dag::ConstSpan<unsigned> hs, dag::ConstSpan<unsigned> ds, dag::ConstSpan<unsigned> gs, shc::TargetContext &ctx)
int add_render_state(const SemanticShaderPass &state, shc::TargetContext &ctx)
int add_stcode(dag::ConstSpan<int> code, shc::TargetContext &ctx)
void add_stcode_validation_mask(int stcode_id, shader_layout::StcodeConstValidationMask *mask, shc::TargetContext &ctx)
void count_shader_stats(unsigned &uniqueFshBytesInFile, unsigned &uniqueFshCountInFile, unsigned &uniqueVprBytesInFile, unsigned &uniqueVprCountInFile, unsigned &stcodeBytes, const shc::TargetContext &ctx)
bool load_shaders_bindump(ShadersBindump &shaders, bindump::IReader &full_file_reader, shc::TargetContext &ctx)
void save_scripted_shaders(const char *filename, dag::ConstSpan<SimpleString> files, shc::TargetContext &ctx, bool need_cppstcode_file_write = true)
void update_shaders_timestamps(dag::ConstSpan<SimpleString> dependencies, shc::TargetContext &ctx)

Update the timestamps of the shader classes.

Note

If dagor git repo is present and files are not locally git modified, the function will use the timestamp of the last commit for file dependencies. Otherwise, it will use the filesystem timestamp

Parameters:

dependencies – The list of files that the shader classes depend on

struct ShadersBindump
#include <linkShaders.h>

Public Members

SerializableTab<ShaderGlobal::Var> variable_list
SerializableTab<Sampler> static_samplers
IntervalList intervals
bindump::Ptr<ShaderStateBlock> empty_block
SerializableTab<ShaderStateBlock*> state_blocks
SerializableTab<ShaderClass*> shaderClasses
SerializableTab<shaders::RenderState> renderStates
SerializableTab<TabFsh> shadersFsh
SerializableTab<TabVpr> shadersVpr
SerializableTab<TabStcode> shadersStcode
SerializableTab<CryptoHash> dynamicCppcodeHashes
SerializableTab<CryptoHash> staticCppcodeHashes
SerializableTab<bindump::string> dynamicCppcodeRoutineNames
SerializableTab<bindump::string> staticCppcodeRoutineNames
SerializableTab<SerializableTab<int32_t>> cppcodeRegisterTables
SerializableTab<int32_t> cppcodeRegisterTableOffsets
SerializableTab<shader_layout::StcodeConstValidationMask*> stcodeConstMasks = {}
struct ShadersBindumpHeader
#include <linkShaders.h>

Subclassed by CompressedShadersBindump

Public Members

int cache_sign = -1
int cache_version = -1
BlkHashBytes last_blk_hash = {}
bindump::EnableHash<ShadersBindump> hash
bindump::vector<bindump::string> dependency_files
struct CompressedShadersBindump : public ShadersBindumpHeader
#include <linkShaders.h>

Public Members

uint64_t decompressed_size = 0
bindump::vector<uint8_t> compressed_shaders
int eof = 0
namespace shaders