summaryrefslogtreecommitdiffstats
path: root/dom/canvas/WebGLContextGL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/canvas/WebGLContextGL.cpp')
-rw-r--r--dom/canvas/WebGLContextGL.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp
index 7411cec02f..ef068c8999 100644
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -1280,7 +1280,7 @@ void WebGLContext::StencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail,
void WebGLContext::UniformData(
const uint32_t loc, const bool transpose,
- const Range<const webgl::UniformDataVal>& data) const {
+ const Span<const webgl::UniformDataVal>& data) const {
const FuncScope funcScope(*this, "uniform setter");
if (!IsWebGL2() && transpose) {
@@ -1306,13 +1306,13 @@ void WebGLContext::UniformData(
// -
- const auto lengthInType = data.length();
+ const auto lengthInType = data.size();
const auto elemCount = lengthInType / channels;
if (elemCount > 1 && !validationInfo.isArray) {
GenerateError(
LOCAL_GL_INVALID_OPERATION,
"(uniform %s) `values` length (%u) must exactly match size of %s.",
- activeInfo.name.c_str(), lengthInType,
+ activeInfo.name.c_str(), (uint32_t)lengthInType,
EnumString(activeInfo.elemType).c_str());
return;
}
@@ -1321,9 +1321,9 @@ void WebGLContext::UniformData(
const auto& samplerInfo = locInfo->samplerInfo;
if (samplerInfo) {
- const auto idata = reinterpret_cast<const uint32_t*>(data.begin().get());
+ const auto idata = ReinterpretToSpan<const uint32_t>::From(data);
const auto maxTexUnits = GLMaxTextureUnits();
- for (const auto& val : Range<const uint32_t>(idata, elemCount)) {
+ for (const auto& val : idata) {
if (val >= maxTexUnits) {
ErrorInvalidValue(
"This uniform location is a sampler, but %d"
@@ -1337,7 +1337,7 @@ void WebGLContext::UniformData(
// -
// This is a little galaxy-brain, sorry!
- const auto ptr = static_cast<const void*>(data.begin().get());
+ const auto ptr = static_cast<const void*>(data.data());
(*pfn)(*gl, static_cast<GLint>(loc), elemCount, transpose, ptr);
// -
@@ -1345,12 +1345,12 @@ void WebGLContext::UniformData(
if (samplerInfo) {
auto& texUnits = samplerInfo->texUnits;
- const auto srcBegin = reinterpret_cast<const uint32_t*>(data.begin().get());
+ const auto srcBegin = reinterpret_cast<const uint32_t*>(data.data());
auto destIndex = locInfo->indexIntoUniform;
if (destIndex < texUnits.length()) {
// Only sample as many indexes as available tex units allow.
const auto destCount = std::min(elemCount, texUnits.length() - destIndex);
- for (const auto& val : Range<const uint32_t>(srcBegin, destCount)) {
+ for (const auto& val : Span<const uint32_t>(srcBegin, destCount)) {
texUnits[destIndex] = AssertedCast<uint8_t>(val);
destIndex += 1;
}