Rewriter: improvements plus extract uniforms to global scope#2730
Rewriter: improvements plus extract uniforms to global scope#2730tex3d merged 2 commits intomicrosoft:masterfrom
Conversation
tex3d
commented
Mar 2, 2020
- Added rewriter functions for extracting uniforms into global scope
- Will not work if name collides (namespaces have bugs)
- Values under cbuffer _Params, resources outside (more bugs)
- Added rewriter HLSLOptions and support all through RewriteWithOptions
- Refactored dxr.exe to use HLSLOptions and RewriteWithOptions
- Exposed Write*VersionInfo functions from dxclib
- Fixed issue with External[Lib/Fn] for version printing.
- Added rewriter functions for extracting uniforms into global scope - Will not work if name collides (namespaces have bugs) - Values under cbuffer _Params, resources outside (more bugs) - Added rewriter HLSLOptions and support all through RewriteWithOptions - Refactored dxr.exe to use HLSLOptions and RewriteWithOptions - Exposed Write*VersionInfo functions from dxclib - Fixed issue with External[Lib/Fn] for version printing.
|
✅ Build DirectXShaderCompiler 1.0.2798 completed (commit f2e2deb553 by @tex3d) |
pow2clk
left a comment
There was a problem hiding this comment.
Looks good! I just included a few suggestions you can take or leave.
| } // namespace dxc | ||
|
|
||
| // Collects compiler/validator version info | ||
| void DxcContext::GetCompilerVersionInfo(llvm::raw_string_ostream &OS) { |
There was a problem hiding this comment.
It's pre-existing, but Get* seems like the wrong prefix and that comment is also misleading. Nothing is gotten or collected, it's printed out to the given stream. I think adopting the prefix Write* might make this less confusing.
| NamedDecl *entryDecl = l.front(); | ||
| FunctionDecl *entryFnDecl = dyn_cast_or_null<FunctionDecl>(entryDecl); | ||
| if (entryFnDecl == nullptr) { | ||
| w << "//entry point found but is not a function declaration\n"; |
There was a problem hiding this comment.
Pre-existing, but for these outputs, including the name of the entry point might be helpful.
There was a problem hiding this comment.
Yeah, I'm not sure I want to get into improving this bit of code more at the moment... besides the name of the entry point was given by the user as an argument to the operation here presumably.
|
✅ Build DirectXShaderCompiler 1.0.2820 completed (commit 56479e5ccf by @tex3d) |
…ft#2730) - Added rewriter functions for extracting uniforms into global scope - Will not work if name collides (namespaces have bugs) - Values under cbuffer _Params, resources outside (more bugs) - Added rewriter HLSLOptions and support all through RewriteWithOptions - Refactored dxr.exe to use HLSLOptions and RewriteWithOptions - Exposed Write*VersionInfo functions from dxclib - Fixed issue with External[Lib/Fn] for version printing.