Skip to content

Commit

Permalink
[Link] Enable to compile HLSLs to Dxil modules, and link them
Browse files Browse the repository at this point in the history
Related work item: Github #10
  • Loading branch information
Minmin Gong committed Apr 24, 2020
1 parent f75d8c7 commit 3abff09
Show file tree
Hide file tree
Showing 15 changed files with 802 additions and 74 deletions.
2 changes: 1 addition & 1 deletion External/googletest.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set(googletest_REV "440527a61e1c91188195f7de212c63c77e8f0a45")
set(googletest_REV "dcc92d0ab6c4ce022162a23566d44f673251eee4")

UpdateExternalLib("googletest" "https://github.com/google/googletest.git" ${googletest_REV})

Expand Down
22 changes: 21 additions & 1 deletion Include/ShaderConductor/ShaderConductor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ namespace ShaderConductor
{
ShadingLanguage language;
const char* version;
bool asModule;
};

struct ResultDesc
Expand All @@ -178,15 +179,34 @@ namespace ShaderConductor
struct DisassembleDesc
{
ShadingLanguage language;
uint8_t* binary;
const uint8_t* binary;
uint32_t binarySize;
};

struct ModuleDesc
{
const char* name;
Blob* target;
};

struct LinkDesc
{
const char* entryPoint;
ShaderStage stage;

const ModuleDesc** modules;
uint32_t numModules;
};

public:
static ResultDesc Compile(const SourceDesc& source, const Options& options, const TargetDesc& target);
static void Compile(const SourceDesc& source, const Options& options, const TargetDesc* targets, uint32_t numTargets,
ResultDesc* results);
static ResultDesc Disassemble(const DisassembleDesc& source);

// Currently only Dxil on Windows supports linking
static bool LinkSupport();
static ResultDesc Link(const LinkDesc& modules, const Options& options, const TargetDesc& target);
};
} // namespace ShaderConductor

Expand Down
Loading

0 comments on commit 3abff09

Please sign in to comment.