Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failing when using CreateBlobFromPinned #4814

Closed
mrsaturnsan opened this issue Nov 23, 2022 · 2 comments
Closed

Compilation failing when using CreateBlobFromPinned #4814

mrsaturnsan opened this issue Nov 23, 2022 · 2 comments

Comments

@mrsaturnsan
Copy link

It seems like an hlsl::Exception is being thrown when calling Compile for preprocessing data. However, the exception is not being caught by the try-catch block in Compile. Perhaps it's being thrown by clang elsewhere once compilation has begun? I'm using IDxcCompiler3. It looks like compilation is failing inside here.

if (isPreprocessing) {
        // These settings are back-compatible with fxc.
        clang::PreprocessorOutputOptions &PPOutOpts =
          compiler.getPreprocessorOutputOpts();
        PPOutOpts.ShowCPP = 1;            // Print normal preprocessed output.
        PPOutOpts.ShowComments = 0;       // Show comments.
        PPOutOpts.ShowLineMarkers = 1;    // Show \#line markers.
        PPOutOpts.UseLineDirectives = 1;  // Use \#line instead of GCC-style \# N.
        PPOutOpts.ShowMacroComments = 0;  // Show comments, even in macros.
        PPOutOpts.ShowMacros = 0;         // Print macro definitions.
        PPOutOpts.RewriteIncludes = 0;    // Preprocess include directives only.

        FrontendInputFile file(pUtf8SourceName, IK_HLSL);
        clang::PrintPreprocessedAction action;
        if (action.BeginSourceFile(compiler, file)) {
          action.Execute();
          action.EndSourceFile();
        }
        outStream.flush();
      }
@mrsaturnsan
Copy link
Author

I'm passing in a UTF8 const char* without any BOM from C#.

@mrsaturnsan
Copy link
Author

Actually, it may be related to the fact that i'm trying to compile shaders via many threads at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant