[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) {
|
void Process(string shaderSourceCode) {
|
||||||
shaderSourceCode += "\ncnop";
|
if (shaderSourceCode.IndexOf("xvs_3_0") != -1 || shaderSourceCode.IndexOf("xps_3_0") != -1) {
|
||||||
shaderSourceCode += "\ncnop";
|
shaderSourceCode += "\ncnop";
|
||||||
|
shaderSourceCode += "\ncnop";
|
||||||
|
}
|
||||||
var preprocessorDefines = new CompilerMacro[2];
|
var preprocessorDefines = new CompilerMacro[2];
|
||||||
preprocessorDefines[0].Name = "XBOX";
|
preprocessorDefines[0].Name = "XBOX";
|
||||||
preprocessorDefines[1].Name = "XBOX360";
|
preprocessorDefines[1].Name = "XBOX360";
|
||||||
|
@ -170,7 +172,7 @@ namespace shader_playground {
|
||||||
UpdateTextBox(outputTextBox, disassembledSourceCode, true);
|
UpdateTextBox(outputTextBox, disassembledSourceCode, true);
|
||||||
|
|
||||||
string shaderType =
|
string shaderType =
|
||||||
shaderSourceCode.IndexOf("xvs_") == -1 ? "ps" : "vs";
|
shaderSourceCode.IndexOf("vs_") == -1 ? "ps" : "vs";
|
||||||
var ucodeWords = ExtractAndDumpWords(shaderType, compiledShader.GetShaderCode());
|
var ucodeWords = ExtractAndDumpWords(shaderType, compiledShader.GetShaderCode());
|
||||||
if (ucodeWords != null) {
|
if (ucodeWords != null) {
|
||||||
TryCompiler(shaderType, ucodeWords);
|
TryCompiler(shaderType, ucodeWords);
|
||||||
|
|
Loading…
Reference in New Issue