Verified Commit f4c87ed0 authored by Lee Salzman's avatar Lee Salzman Committed by ma1
Browse files

Bug 2060000. r=gfx-reviewers,nical, a=dsmith

parent 8014b877
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1361,8 +1361,8 @@ void WebGLContext::UniformData(
  // -

  const auto lengthInType = data.size();
  const auto elemCount = lengthInType / channels;
  if (elemCount > 1 && !validationInfo.isArray) {
  const size_t availElemCount = lengthInType / channels;
  if (availElemCount > 1 && !validationInfo.isArray) {
    GenerateError(
        LOCAL_GL_INVALID_OPERATION,
        "(uniform %s) `values` length (%u) must exactly match size of %s.",
@@ -1370,6 +1370,10 @@ void WebGLContext::UniformData(
        EnumString(activeInfo.elemType).c_str());
    return;
  }
  const size_t elemCount =
      validationInfo.isArray
          ? std::min(availElemCount, size_t(activeInfo.elemCount))
          : availElemCount;

  // -