Commit c6e8ab13 by Nicolas Capens

Only apply the enable mask on instructions requiring predication.

parent 36b989cb
...@@ -115,6 +115,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved ...@@ -115,6 +115,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved
switch(reason) switch(reason)
{ {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
// MessageBoxA(0, "Attach debugger now and press OK", "SwiftShader loaded", MB_OK);
return eglAttachProcess(); return eglAttachProcess();
break; break;
case DLL_THREAD_ATTACH: case DLL_THREAD_ATTACH:
......
...@@ -4007,7 +4007,7 @@ namespace sw ...@@ -4007,7 +4007,7 @@ namespace sw
if(dst.w) d.w = Min(d.w, Float4(1.0f)); if(dst.w) d.w = Min(d.w, Float4(1.0f));
} }
if(shader->containsDynamicBranching()) if(instruction->isPredicated())
{ {
Vector4f pDst; // FIXME: Rename Vector4f pDst; // FIXME: Rename
......
...@@ -1024,6 +1024,15 @@ namespace sw ...@@ -1024,6 +1024,15 @@ namespace sw
return opcode == OPCODE_ENDLOOP || opcode == OPCODE_ENDREP || opcode == OPCODE_ENDWHILE; return opcode == OPCODE_ENDLOOP || opcode == OPCODE_ENDREP || opcode == OPCODE_ENDWHILE;
} }
bool Shader::Instruction::isPredicated() const
{
return predicate ||
analysisBranch ||
analysisBreak ||
analysisContinue ||
analysisLeave;
}
Shader::Shader() : serialID(serialCounter++) Shader::Shader() : serialID(serialCounter++)
{ {
usedSamplers = 0; usedSamplers = 0;
......
...@@ -430,6 +430,8 @@ namespace sw ...@@ -430,6 +430,8 @@ namespace sw
bool isLoop() const; bool isLoop() const;
bool isEndLoop() const; bool isEndLoop() const;
bool isPredicated() const;
Opcode opcode; Opcode opcode;
union union
......
...@@ -283,7 +283,7 @@ namespace sw ...@@ -283,7 +283,7 @@ namespace sw
if(dst.w) d.w = Min(d.w, Float4(1.0f)); if(dst.w) d.w = Min(d.w, Float4(1.0f));
} }
if(shader->containsDynamicBranching()) if(instruction->isPredicated())
{ {
Vector4f pDst; // FIXME: Rename Vector4f pDst; // FIXME: Rename
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment