зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1355430 - Part2: Implement Require Fastpath for texture copy; r=baku,jgilbert
MozReview-Commit-ID: EPNSJbbJHP4 --HG-- extra : rebase_source : b27a254e247a40285873b53edb036b5b97d4e0d8
This commit is contained in:
Родитель
5974ad86a4
Коммит
ca2cb984d5
|
@ -710,9 +710,16 @@ TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec, const char* fun
|
|||
return true;
|
||||
} while (false);
|
||||
|
||||
webgl->GeneratePerfWarning("%s: Failed to hit GPU-copy fast-path. (src type %u)"
|
||||
" Falling back to CPU upload. (%s)",
|
||||
funcName, uint32_t(mImage->GetFormat()), fallbackReason);
|
||||
const nsPrintfCString perfMsg("%s: Failed to hit GPU-copy fast-path: %s (src type %u)",
|
||||
funcName, fallbackReason, uint32_t(mImage->GetFormat()));
|
||||
|
||||
if (webgl->mPixelStore_RequireFastPath) {
|
||||
webgl->ErrorInvalidOperation("%s", perfMsg.BeginReading());
|
||||
return false;
|
||||
}
|
||||
|
||||
webgl->GeneratePerfWarning("%s Falling back to CPU upload.",
|
||||
perfMsg.BeginReading());
|
||||
|
||||
const RefPtr<gfx::SourceSurface> surf = mImage->GetAsSourceSurface();
|
||||
|
||||
|
|
|
@ -321,6 +321,9 @@ class WebGLContext
|
|||
enum {
|
||||
UNPACK_FLIP_Y_WEBGL = 0x9240,
|
||||
UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
|
||||
// We throw InvalidOperation in TexImage if we fail to use GPU fast-path
|
||||
// for texture copy when it is set to true, only for debug purpose.
|
||||
UNPACK_REQUIRE_FASTPATH = 0x10001,
|
||||
CONTEXT_LOST_WEBGL = 0x9242,
|
||||
UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243,
|
||||
BROWSER_DEFAULT_WEBGL = 0x9244,
|
||||
|
@ -1871,6 +1874,7 @@ protected:
|
|||
GLenum mPixelStore_ColorspaceConversion;
|
||||
bool mPixelStore_FlipY;
|
||||
bool mPixelStore_PremultiplyAlpha;
|
||||
bool mPixelStore_RequireFastPath;
|
||||
|
||||
////////////////////////////////////
|
||||
class FakeBlackTexture {
|
||||
|
|
|
@ -1128,6 +1128,13 @@ WebGLContext::PixelStorei(GLenum pname, GLint param)
|
|||
return;
|
||||
}
|
||||
|
||||
case UNPACK_REQUIRE_FASTPATH:
|
||||
if (IsExtensionEnabled(WebGLExtensionID::MOZ_debug)) {
|
||||
mPixelStore_RequireFastPath = bool(param);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case LOCAL_GL_PACK_ALIGNMENT:
|
||||
case LOCAL_GL_UNPACK_ALIGNMENT:
|
||||
switch (param) {
|
||||
|
|
|
@ -701,6 +701,7 @@ WebGLContext::InitAndValidateGL(FailureReason* const out_failReason)
|
|||
mPixelStore_FlipY = false;
|
||||
mPixelStore_PremultiplyAlpha = false;
|
||||
mPixelStore_ColorspaceConversion = BROWSER_DEFAULT_WEBGL;
|
||||
mPixelStore_RequireFastPath = false;
|
||||
|
||||
// GLES 3.0.4, p259:
|
||||
mPixelStore_UnpackImageHeight = 0;
|
||||
|
|
|
@ -1088,6 +1088,7 @@ interface EXT_disjoint_timer_query {
|
|||
interface MOZ_debug {
|
||||
const GLenum EXTENSIONS = 0x1F03;
|
||||
const GLenum WSI_INFO = 0x10000;
|
||||
const GLenum UNPACK_REQUIRE_FASTPATH = 0x10001;
|
||||
|
||||
[Throws]
|
||||
any getParameter(GLenum pname);
|
||||
|
|
Загрузка…
Ссылка в новой задаче