Closed Bug 909176 Opened 12 years ago Closed 2 years ago

Have a preference value to replace all texture by tiny texture

Categories

(Core :: Graphics, defect)

ARM
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: u459114, Unassigned)

References

Details

Attachments

(1 file)

By replacing all textures by a static tiny texture(2X2 texture which can be fetched in singal texture access) to address GPU-fillrate bottleneck.
Use androd setprop to use small texture. Only available on phone device. adb shell "debug.gfx.texture.size 1" => enable small texture adb shell "debug.gfx.texture.size 0" => disable
Comment on attachment 795804 [details] [diff] [review] [WIP] force use small texture for gl composition Review of attachment 795804 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/opengl/CompositorOGL.cpp @@ +841,5 @@ > #ifndef MOZ_ANDROID_OMTC > mGLContext->fClearColor(0.0, 0.0, 0.0, 0.0); > mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT); > #endif > + #ifdef MOZ_WIDGET_GONK char prop[PROPERTY_VALUE_MAX]; property_get("debug.gfx.texture.size",prop,"0"); int use_simplified_texture=atoi(prop); mSimplifiedTexture.Enable(use_simplified_texture? true: false); mSimplifiedTexture.Reset(); #endif @@ +997,5 @@ > +#ifdef MOZ_WIDGET_GONK > + char prop[PROPERTY_VALUE_MAX]; > + property_get("debug.gfx.texture.size",prop,"0"); > + int use_simplified_texture=atoi(prop); > +#endif Get this property in BeginFrame. if (use_simplified_texture) mSimplifiedTexture.Enable() @@ +1080,5 @@ > + > +#ifdef MOZ_WIDGET_GONK > + if(use_simplified_texture){ > + mSimplifiedTexture.SetTexture(mGLContext,LOCAL_GL_TEXTURE0); > + } if (mSimplifiedTexture.IsEnable()) mSimplifiedTexture.SetTexture(mGLContext,LOCAL_GL_TEXTURE0); @@ +1263,5 @@ > + mSimplifiedTexture.SetTexture(mGLContext,LOCAL_GL_TEXTURE0); > + mSimplifiedTexture.SetTexture(mGLContext,LOCAL_GL_TEXTURE1); > + } > +#endif > + Prevent effect total number of GL call. #ifdef MOZ_WIDGET_GONK if(mSimplifiedTexture.IsEnable()){ mSimplifiedTexture.SetTexture(mGLContext,LOCAL_GL_TEXTURE0); mSimplifiedTexture.SetTexture(mGLContext,LOCAL_GL_TEXTURE1); } else { AutoBindTexture bindSourceOnBlack(sourceOnBlack, LOCAL_GL_TEXTURE0); AutoBindTexture bindSourceOnWhite(sourceOnWhite, LOCAL_GL_TEXTURE1); } #else AutoBindTexture bindSourceOnBlack(sourceOnBlack, LOCAL_GL_TEXTURE0); AutoBindTexture bindSourceOnWhite(sourceOnWhite, LOCAL_GL_TEXTURE1); #end @@ +1480,5 @@ > return result; > } > > +#ifdef MOZ_WIDGET_GONK > +CompositorOGL::SimplifiedTextureDataOGL::SimplifiedTextureDataOGL() : mCurrentTextureIndex(0), mInit(false) @@ +1487,5 @@ > + mInit=false; > + > + for(int i=0;i<TEXTURE_NUM;++i){ > + mTextures[i]=0; > + } memset(mTexture, 0, sizeof(GLuint) * TEXTURE_NUM); @@ +1492,5 @@ > +} > + > +CompositorOGL::SimplifiedTextureDataOGL::~SimplifiedTextureDataOGL() > +{ > + Clear data member for debugging purpose. @@ +1500,5 @@ > +{ > + if(mInit){ > + return true; > + } > + Have a comment to reveal the purpose of the following code. Generate a 1X1 dummy texture? Describe the reason that you create 16 1X1 texture. ::: gfx/layers/opengl/CompositorOGL.h @@ +347,5 @@ > + public: > + SimplifiedTextureDataOGL(); > + ~SimplifiedTextureDataOGL(); > + > + bool Init(GLContext *gl_context); Make it private @@ +351,5 @@ > + bool Init(GLContext *gl_context); > + void Destroy(GLContext *gl_context); > + > + void ResetIndex(void); > + Rename to Reset or BeginFrame. Client does not really need to know which kind of data need to be Reset
Please check how get_about_memory.py, in Tools folder, communicate with device
Comment on attachment 795804 [details] [diff] [review] [WIP] force use small texture for gl composition Review of attachment 795804 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/opengl/CompositorOGL.cpp @@ +1519,5 @@ > + 0x00008050, > + 0x80800050, > + 0x80008050, > + }; > + Instead of using 16 1X1 texture, I would suggest just use a single 2X2 texture. You can tell the shape of each layer since strech intopolation left top pixel: red; right top pixel: pink left botton pixel: pink; right bottom pixel: white ::: gfx/layers/opengl/CompositorOGL.h @@ +367,5 @@ > + unsigned int mCurrentTextureIndex; > + bool mInit; > + }; > + > + SimplifiedTextureDataOGL mSimplifiedTexture; Move whole class definition into cpp. Keep header unchange. Use singleton pattern.
(In reply to C.J. Ku[:CJKu] from comment #3) > Please check how get_about_memory.py, in Tools folder, communicate with > device Test MessageLoopForIO instead of android property system for debug option setting http://mxr.mozilla.org/mozilla-central/source/ipc/chromium/src/base/message_loop.h#436
(In reply to Jerry Shih[:jerry] from comment #5) > (In reply to C.J. Ku[:CJKu] from comment #3) > > Please check how get_about_memory.py, in Tools folder, communicate with > > device > > Test MessageLoopForIO instead of android property system for debug option > setting > > http://mxr.mozilla.org/mozilla-central/source/ipc/chromium/src/base/ > message_loop.h#436 Sorry, MessageLoopForIO is at http://mxr.mozilla.org/mozilla-central/source/ipc/chromium/src/base/message_loop.h#484

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: bignose1007+bugzilla → nobody
Severity: normal → S3

Closing old B2G bugs

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: