D3D12 Tests add uint32_t compileOptions to Compile()

Current options are:
SkipOptimie : the default
Enable16BitTypes
This commit is contained in:
Jake Turner
2024-12-03 05:21:41 +00:00
parent 6d3e08a285
commit 56fffb5dc2
3 changed files with 17 additions and 4 deletions
@@ -340,8 +340,10 @@ void main(uint3 threadID : SV_DispatchThreadID)
valid[i] = true;
// can't skip optimising and still have the extensions work, sadly
psblob[i] = Compile(ags_header + BaryCentricPixel, "main", "ps" + profilesuffix[i], false);
csblob[i] = Compile(ags_header + MaxCompute, "main", "cs" + profilesuffix[i], false);
psblob[i] = Compile(ags_header + BaryCentricPixel, "main", "ps" + profilesuffix[i],
CompileOptionFlags::None);
csblob[i] = Compile(ags_header + MaxCompute, "main", "cs" + profilesuffix[i],
CompileOptionFlags::None);
pso[i] = MakePSO().RootSig(sig).InputLayout().VS(vsblob[i]).PS(psblob[i]);
cso[i] = MakePSO().RootSig(sig).CS(csblob[i]);
+5 -1
View File
@@ -1332,9 +1332,11 @@ COM_SMARTPTR(IDxcOperationResult);
COM_SMARTPTR(IDxcBlob);
ID3DBlobPtr D3D12GraphicsTest::Compile(std::string src, std::string entry, std::string profile,
bool skipoptimise)
uint32_t compileOptions)
{
ID3DBlobPtr blob = NULL;
bool skipoptimise = (compileOptions && CompileOptionFlags::SkipOptimise);
bool enable16BitTypes = (compileOptions && CompileOptionFlags::Enable16BitTypes);
if(profile[3] >= '6')
{
@@ -1389,6 +1391,8 @@ ID3DBlobPtr D3D12GraphicsTest::Compile(std::string src, std::string entry, std::
}
argStorage.push_back(L"-Zi");
argStorage.push_back(L"-Qembed_debug");
if(enable16BitTypes)
argStorage.push_back(L"-enable-16bit-types");
for(size_t i = 0; i < argStorage.size(); i++)
args[0].push_back(argStorage[i].c_str());
+8 -1
View File
@@ -77,8 +77,15 @@ struct D3D12GraphicsTest : public GraphicsTest
BufUAVType = 0xf00,
};
enum CompileOptionFlags
{
None = 0,
SkipOptimise = 1 << 0,
Enable16BitTypes = 1 << 1,
};
ID3DBlobPtr Compile(std::string src, std::string entry, std::string profile,
bool skipoptimise = true);
uint32_t compileOptions = CompileOptionFlags::SkipOptimise);
void WriteBlob(std::string name, ID3DBlobPtr blob, bool compress);
void SetBlobPath(std::string name, ID3DBlobPtr &blob);