Bug 1655101 - Allow webgl.texImage gpu-blit for RGB8 if supported. r=gfx-reviewers,aosmond

Differential Revision: https://phabricator.services.mozilla.com/D194943
This commit is contained in:
Kelsey Gilbert
2023-11-30 17:40:42 +00:00
parent 1c1f7e1e26
commit b8e33d2390
13 changed files with 110 additions and 59 deletions

View File

@@ -4394,6 +4394,8 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
// -
// -
mozilla::ipc::Shmem* pShmem = nullptr;
// Image to release after WebGLContext::TexImage().
RefPtr<layers::Image> keepAliveImage;
@@ -4404,7 +4406,12 @@ void ClientWebGLContext::TexImage(uint8_t funcDims, GLenum imageTarget,
const auto& contextInfo = mNotLost->info;
const auto fallbackReason = [&]() -> Maybe<std::string> {
auto fallbackReason = BlitPreventReason(level, offset, pi, *desc);
if (!respecFormat) {
return Some(std::string{
"Fast uploads not supported for TexSubImage. Use TexImage."});
}
auto fallbackReason = BlitPreventReason(
level, offset, respecFormat, pi, *desc, contextInfo.isRgb8Renderable);
if (fallbackReason) return fallbackReason;
const bool canUploadViaSd = contextInfo.uploadableSdTypes[sdType];