Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/code-generator-static-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,14 @@ export class StaticCodeGenerator implements CodeGenerator, SourceBuilder {
return code.join("");
}

#buildGenerateIndex(repo: TemplateRepository<TemplatePass2>, includePathPrefix: string): string {
#buildGenerateIndex(repo: TemplateRepository<TemplatePass2>): string {
const indexContent = [];
indexContent.push("// This file is auto-generated by wgsl-gen. Do not edit manually.");
indexContent.push("");
//indexContent.push("#pragma once");
indexContent.push("#ifndef INCLUDED_BY_WGSL_GEN_HEADER");
indexContent.push('#error "This file is expected to be included by wgsl-gen header. Do not include it directly."');
indexContent.push("#endif");
if (this.#stringTable) {
indexContent.push(`#include "${includePathPrefix}wgsl_gen/string_table.h"`);
}
indexContent.push("");
for (const [name, template] of repo.templates) {
indexContent.push(`//`);
Expand Down Expand Up @@ -308,7 +305,7 @@ std::string pass_as_string(T&& v) {
const result = new Map<string, TemplateBuildResult>();

// STEP.1. Generate the index.h
result.set("index.h", this.#buildGenerateIndex(repo, options.includePathPrefix ?? ""));
result.set("index.h", this.#buildGenerateIndex(repo));

// STEP.2. Generate the string table if needed
if (this.#stringTable) {
Expand Down
1 change: 0 additions & 1 deletion test/testcases/build-basic/expected/static-cpp/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#ifndef INCLUDED_BY_WGSL_GEN_HEADER
#error "This file is expected to be included by wgsl-gen header. Do not include it directly."
#endif
#include "wgsl_gen/string_table.h"

//
// Template: shader/triangle.wgsl.template
Expand Down