Skip to content

Commit f7df17a

Browse files
committed
Fix.
1 parent e81a6b7 commit f7df17a

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

source/slang/hlsl.meta.slang

+4-3
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,16 @@ vector<T,N+1> __makeVector(vector<T,N> vec, T scalar);
380380
/// @see `Texture1D`, `Texture2D`, `Texture3D`, `TextureCube`, `Texture1DArray`,
381381
/// `Texture2DArray`, `TextureCubeArray`, `Sampler1D`, `Sampler2D`, `Sampler3D`, `SamplerCube`, `Sampler1DArray`, `Sampler2DArray`, `SamplerCubeArray`,
382382
/// `Texture2DMS`, `Texture2DMSArray`, `RWTexture1D`, `RWTexture2D`, `RWTexture3D`, `RWTexture1DArray`, `RWTexture2DArray`,
383-
/// `RWTexture2DMS`, `RWTexture2DMSArray`, `RWTextureBuffer`, `FeedbackTexture2D`, `FeedbackTexture2DArray`.
383+
/// `RWTexture2DMS`, `RWTexture2DMSArray`, `Buffer`, `RWBuffer`, `FeedbackTexture2D`, `FeedbackTexture2DArray`.
384384
/// @remarks
385385
/// HLSL texture types are implemented as typealiases to the builtin `_Texture` type. Users
386386
/// are advised to use the HLSL-specific texture types instead of `_Texture` directly.
387387
///
388388
/// For read-write textures, Slang will automatically infer `format` from `T`.
389389
/// To explicitly specify texel storage formats for read-write textures,
390-
/// use the `[format("...")]` attribute on the texture parameter declaration.
391-
/// Allowed `format` values are:
390+
/// use the `[format("formatString")]` attribute on the texture parameter declaration.
391+
/// Allowed `formatString` values are:
392+
///
392393
/// |id | Format string | Meaning |
393394
/// |:--|:---------------------|:------------------|
394395
/// |1 |`"rgba32f"` | 4 channel 32-bit floating point texture |

source/slang/slang-doc-markdown-writer.cpp

+22-1
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,17 @@ void DocMarkdownWriter::writeAggType(DocumentPage* page, const ASTMarkup::Entry&
16791679
}
16801680
}
16811681
}
1682+
1683+
if (paramList[i].text.getLength() == 0)
1684+
{
1685+
ParamDocumentation paramDoc;
1686+
if (declDoc.parameters.tryGetValue(getText(param->getName()), paramDoc))
1687+
{
1688+
StringBuilder sb;
1689+
sb << paramDoc.description.ownedText;
1690+
paramList[i].text = sb.produceString();
1691+
}
1692+
}
16821693
}
16831694
_appendAsBullets(paramList, false, 0);
16841695
out << toSlice("\n");
@@ -1849,6 +1860,16 @@ String DocMarkdownWriter::translateToMarkdownWithLinks(String text, bool strictC
18491860
for (; !reader.IsEnd(); )
18501861
{
18511862
auto token = reader.ReadToken();
1863+
1864+
// If the token is a string literal, we want to treat it as an identifier.
1865+
if (token.Type == Slang::Misc::TokenType::StringLiteral)
1866+
{
1867+
token.Type = Slang::Misc::TokenType::Identifier;
1868+
StringBuilder stringSB;
1869+
StringEscapeUtil::appendQuoted(StringEscapeUtil::getHandler(StringEscapeUtil::Style::Cpp), token.Content.getUnownedSlice(), stringSB);
1870+
token.Content = stringSB.produceString();
1871+
}
1872+
18521873
if (token.Type == Slang::Misc::TokenType::Identifier)
18531874
{
18541875
if (requireSpaceBeforeNextToken)
@@ -2083,7 +2104,7 @@ void DeclDocumentation::writeSection(StringBuilder& out, DocMarkdownWriter* writ
20832104
}
20842105
if (sectionDoc && sectionDoc->ownedText.getLength() > 0)
20852106
{
2086-
out << "## \"" << getSectionTitle(section) << "\n\n";
2107+
out << "## " << getSectionTitle(section) << "\n\n";
20872108
sectionDoc->write(writer, out);
20882109
}
20892110
}

0 commit comments

Comments
 (0)