Bug 1878930 - r/RawBuffer/Span/: TexImage: Don't copy desc. r=gfx-reviewers,lsalzman

Differential Revision: https://phabricator.services.mozilla.com/D202026
This commit is contained in:
Kelsey Gilbert 2024-02-29 00:37:29 +00:00
parent cc11a296b3
commit 56c7f1eafc

View File

@ -929,23 +929,7 @@ void WebGLTexture::TexStorage(TexTarget target, uint32_t levels,
void WebGLTexture::TexImage(uint32_t level, GLenum respecFormat,
const uvec3& offset, const webgl::PackingInfo& pi,
const webgl::TexUnpackBlobDesc& src) {
Maybe<RawBuffer<>> cpuDataView;
if (src.cpuData) {
cpuDataView = Some(RawBuffer<>{src.cpuData->Data()});
}
const auto srcViewDesc = webgl::TexUnpackBlobDesc{src.imageTarget,
src.size,
src.srcAlphaType,
std::move(cpuDataView),
src.pboOffset,
src.structuredSrcSize,
src.image,
src.sd,
src.dataSurf,
src.unpacking,
src.applyUnpackTransforms};
const auto blob = webgl::TexUnpackBlob::Create(srcViewDesc);
const auto blob = webgl::TexUnpackBlob::Create(src);
if (!blob) {
MOZ_ASSERT(false);
return;