Commit 3c1d6cf2 by Alexis Hetu Committed by Alexis Hétu

Fragment output fix

Allow not specifying a fragment output location. Change-Id: I76c6e6efdff3161586f5d5422e97731969b9396c Reviewed-on: https://swiftshader-review.googlesource.com/17028Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent d2ec29e4
...@@ -3183,7 +3183,8 @@ namespace glsl ...@@ -3183,7 +3183,8 @@ namespace glsl
int registerCount = fragmentOutput->totalRegisterCount(); int registerCount = fragmentOutput->totalRegisterCount();
if(requestedLocation < 0) if(requestedLocation < 0)
{ {
mContext.error(fragmentOutput->getLine(), "Invalid fragment output location", "fragment shader"); ASSERT(requestedLocation == -1); // All other negative values would have been prevented in TParseContext::parseLayoutQualifier
return; // No requested location
} }
else if((requestedLocation + registerCount) > sw::RENDERTARGETS) else if((requestedLocation + registerCount) > sw::RENDERTARGETS)
{ {
......
...@@ -2826,7 +2826,7 @@ TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierTyp ...@@ -2826,7 +2826,7 @@ TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierTyp
{ {
TLayoutQualifier qualifier; TLayoutQualifier qualifier;
qualifier.location = -1; qualifier.location = -1; // -1 isn't a valid location, it means the value isn't set. Negative values are checked lower in this function.
qualifier.matrixPacking = EmpUnspecified; qualifier.matrixPacking = EmpUnspecified;
qualifier.blockStorage = EbsUnspecified; qualifier.blockStorage = EbsUnspecified;
......
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