[Shader Playground] Make PC shader models work at least with invalid shaders
This commit is contained in:
parent
b8ec553f96
commit
582089392c
|
@ -134,8 +134,10 @@ namespace shader_playground {
|
|||
}
|
||||
|
||||
void Process(string shaderSourceCode) {
|
||||
if (shaderSourceCode.IndexOf("xvs_3_0") != -1 || shaderSourceCode.IndexOf("xps_3_0") != -1) {
|
||||
shaderSourceCode += "\ncnop";
|
||||
shaderSourceCode += "\ncnop";
|
||||
}
|
||||
var preprocessorDefines = new CompilerMacro[2];
|
||||
preprocessorDefines[0].Name = "XBOX";
|
||||
preprocessorDefines[1].Name = "XBOX360";
|
||||
|
@ -170,7 +172,7 @@ namespace shader_playground {
|
|||
UpdateTextBox(outputTextBox, disassembledSourceCode, true);
|
||||
|
||||
string shaderType =
|
||||
shaderSourceCode.IndexOf("xvs_") == -1 ? "ps" : "vs";
|
||||
shaderSourceCode.IndexOf("vs_") == -1 ? "ps" : "vs";
|
||||
var ucodeWords = ExtractAndDumpWords(shaderType, compiledShader.GetShaderCode());
|
||||
if (ucodeWords != null) {
|
||||
TryCompiler(shaderType, ucodeWords);
|
||||
|
|
Loading…
Reference in New Issue