Fix vertex state shader compilation in Spy vs Spy^

This commit is contained in:
Luke Usher 2019-12-19 19:34:46 +00:00
parent 56af31aede
commit f23c9adae1
1 changed files with 22 additions and 4 deletions

View File

@ -1633,8 +1633,7 @@ extern HRESULT EmuRecompileVshFunction
case VERSION_XVS: case VERSION_XVS:
break; break;
case VERSION_XVSS: case VERSION_XVSS:
EmuLog(LOG_LEVEL::WARNING, "Might not support vertex state shaders?"); LOG_TEST_CASE("Might not support vertex state shaders?");
hRet = E_FAIL;
break; break;
case VERSION_XVSW: case VERSION_XVSW:
EmuLog(LOG_LEVEL::WARNING, "Might not support vertex read/write shaders?"); EmuLog(LOG_LEVEL::WARNING, "Might not support vertex read/write shaders?");
@ -1697,8 +1696,27 @@ extern HRESULT EmuRecompileVshFunction
&pErrors // ppErrorMsgs out &pErrors // ppErrorMsgs out
); );
if (FAILED(hRet)) { if (FAILED(hRet)) {
LOG_TEST_CASE("Couldn't assemble recompiled vertex shader"); // Attempt to retry in compatibility mode, this allows some vertex-state shaders to compile
//EmuLog(LOG_LEVEL::WARNING, "Couldn't assemble recompiled vertex shader"); // Test Case: Spy vs Spy
flags1 |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
hRet = D3DCompile(
hlsl_str.c_str(),
hlsl_str.length(),
nullptr, // pSourceName
nullptr, // pDefines
nullptr, // pInclude // TODO precompile x_* HLSL functions?
"main", // shader entry poiint
"vs_3_0", // shader profile
flags1, // flags1
0, // flags2
ppRecompiledShader, // out
&pErrors // ppErrorMsgs out
);
if (FAILED(hRet)) {
LOG_TEST_CASE("Couldn't assemble recompiled vertex shader");
//EmuLog(LOG_LEVEL::WARNING, "Couldn't assemble recompiled vertex shader");
}
} }
// Determine the log level // Determine the log level