зеркало из https://github.com/mozilla/gecko-dev.git
Bug 832576 - Fix perf regression in WebGL uniform setters - r=jgilbert
This commit is contained in:
Родитель
4ae30243dd
Коммит
e071c4e3f0
|
@ -707,10 +707,7 @@ WebGLContext::ValidateUniformArraySetter(const char* name, uint32_t expectedElem
|
||||||
{
|
{
|
||||||
if (!IsContextStable())
|
if (!IsContextStable())
|
||||||
return false;
|
return false;
|
||||||
nsCString nameString(name);
|
if (!ValidateUniformLocation(name, location_object))
|
||||||
nsCString suffix = NS_LITERAL_CSTRING(": location");
|
|
||||||
nsCString concatenated = nameString + suffix;
|
|
||||||
if (!ValidateUniformLocation(concatenated.get(), location_object))
|
|
||||||
return false;
|
return false;
|
||||||
location = location_object->Location();
|
location = location_object->Location();
|
||||||
uint32_t uniformElemSize = location_object->ElementSize();
|
uint32_t uniformElemSize = location_object->ElementSize();
|
||||||
|
@ -721,7 +718,6 @@ WebGLContext::ValidateUniformArraySetter(const char* name, uint32_t expectedElem
|
||||||
uniformElemSize);
|
uniformElemSize);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const WebGLUniformInfo& info = location_object->Info();
|
|
||||||
if (arrayLength == 0 ||
|
if (arrayLength == 0 ||
|
||||||
arrayLength % expectedElemSize)
|
arrayLength % expectedElemSize)
|
||||||
{
|
{
|
||||||
|
@ -731,6 +727,7 @@ WebGLContext::ValidateUniformArraySetter(const char* name, uint32_t expectedElem
|
||||||
arrayLength);
|
arrayLength);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
const WebGLUniformInfo& info = location_object->Info();
|
||||||
if (!info.isArray &&
|
if (!info.isArray &&
|
||||||
arrayLength != expectedElemSize) {
|
arrayLength != expectedElemSize) {
|
||||||
ErrorInvalidOperation("%s: expected an array of length exactly"
|
ErrorInvalidOperation("%s: expected an array of length exactly"
|
||||||
|
@ -753,10 +750,7 @@ WebGLContext::ValidateUniformMatrixArraySetter(const char* name, int dim, WebGLU
|
||||||
uint32_t expectedElemSize = (dim)*(dim);
|
uint32_t expectedElemSize = (dim)*(dim);
|
||||||
if (!IsContextStable())
|
if (!IsContextStable())
|
||||||
return false;
|
return false;
|
||||||
nsCString nameString(name);
|
if (!ValidateUniformLocation(name, location_object))
|
||||||
nsCString suffix = NS_LITERAL_CSTRING(": location");
|
|
||||||
nsCString concatenated = nameString + suffix;
|
|
||||||
if (!ValidateUniformLocation(concatenated.get(), location_object))
|
|
||||||
return false;
|
return false;
|
||||||
location = location_object->Location();
|
location = location_object->Location();
|
||||||
uint32_t uniformElemSize = location_object->ElementSize();
|
uint32_t uniformElemSize = location_object->ElementSize();
|
||||||
|
@ -767,7 +761,6 @@ WebGLContext::ValidateUniformMatrixArraySetter(const char* name, int dim, WebGLU
|
||||||
uniformElemSize);
|
uniformElemSize);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const WebGLUniformInfo& info = location_object->Info();
|
|
||||||
if (arrayLength == 0 ||
|
if (arrayLength == 0 ||
|
||||||
arrayLength % expectedElemSize)
|
arrayLength % expectedElemSize)
|
||||||
{
|
{
|
||||||
|
@ -777,6 +770,7 @@ WebGLContext::ValidateUniformMatrixArraySetter(const char* name, int dim, WebGLU
|
||||||
arrayLength);
|
arrayLength);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
const WebGLUniformInfo& info = location_object->Info();
|
||||||
if (!info.isArray &&
|
if (!info.isArray &&
|
||||||
arrayLength != expectedElemSize) {
|
arrayLength != expectedElemSize) {
|
||||||
ErrorInvalidOperation("%s: expected an array of length exactly"
|
ErrorInvalidOperation("%s: expected an array of length exactly"
|
||||||
|
@ -801,10 +795,7 @@ WebGLContext::ValidateUniformSetter(const char* name, WebGLUniformLocation *loca
|
||||||
{
|
{
|
||||||
if (!IsContextStable())
|
if (!IsContextStable())
|
||||||
return false;
|
return false;
|
||||||
nsCString nameString(name);
|
if (!ValidateUniformLocation(name, location_object))
|
||||||
nsCString suffix = NS_LITERAL_CSTRING(": location");
|
|
||||||
nsCString concatenated = nameString + suffix;
|
|
||||||
if (!ValidateUniformLocation(concatenated.get(), location_object))
|
|
||||||
return false;
|
return false;
|
||||||
location = location_object->Location();
|
location = location_object->Location();
|
||||||
return true;
|
return true;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче