Closed
Bug 1179935
Opened 8 years ago
Closed 8 years ago
replace Compositor::PrepareViewport with projection info stored on render targets
Categories
(Core :: Graphics: Layers, defect)
Core
Graphics: Layers
Tracking
()
RESOLVED
FIXED
mozilla42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: vlad, Assigned: vlad)
Details
(Whiteboard: [gfx-noted][vrm2])
Attachments
(1 file)
15.42 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
With VR (and possibly other things in the future), we may need to specify a complex viewport and projection. Instead of extending PrepareViewport and needing to carry this data around, this introduces projection information directly on CompositingRenderTarget which is applied when SetRenderTarget is called. The default projection is a simple one, like what PrepareViewport normally sets up. Calling ClearProjection() on a rendertarget returns to this projection. Calling SetProjection() allows the caller to specify a full projection matrix, znear/zfar, and whether depth buffering should be enabled.
Attachment #8629031 -
Flags: review?(mstange)
Assignee | ||
Updated•8 years ago
|
QA Contact: vladimir
Comment 1•8 years ago
|
||
Comment on attachment 8629031 [details] [diff] [review] Compositor complex projections, v0 Review of attachment 8629031 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/composite/TextureHost.h @@ +760,5 @@ > gfx::IntPoint mOrigin; > + > + bool mHasComplexProjection; > + gfx::Matrix4x4 mProjectionMatrix; > + bool mEnableDepthBuffer; Might want to move the bools to the end, for better packing. ::: gfx/layers/opengl/CompositingRenderTargetOGL.cpp @@ +38,4 @@ > if (mInitParams.mStatus != InitParams::INITIALIZED) { > InitializeImpl(); > + if (mInitParams.mInit == INIT_MODE_CLEAR) { > + needsClear = true; What required this change? Does it fix an existing bug? ::: gfx/layers/opengl/CompositorOGL.cpp @@ +545,4 @@ > = static_cast<CompositingRenderTargetOGL*>(aSurface); > if (mCurrentRenderTarget != surface) { > mCurrentRenderTarget = surface; > + if (mCurrentRenderTarget) { What prompted this change?
Attachment #8629031 -
Flags: review?(mstange) → review+
Assignee | ||
Comment 2•8 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #1) > Comment on attachment 8629031 [details] [diff] [review] > Compositor complex projections, v0 > > Review of attachment 8629031 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: gfx/layers/composite/TextureHost.h > @@ +760,5 @@ > > gfx::IntPoint mOrigin; > > + > > + bool mHasComplexProjection; > > + gfx::Matrix4x4 mProjectionMatrix; > > + bool mEnableDepthBuffer; > > Might want to move the bools to the end, for better packing. > > ::: gfx/layers/opengl/CompositingRenderTargetOGL.cpp > @@ +38,4 @@ > > if (mInitParams.mStatus != InitParams::INITIALIZED) { > > InitializeImpl(); > > + if (mInitParams.mInit == INIT_MODE_CLEAR) { > > + needsClear = true; > > What required this change? Does it fix an existing bug? No -- the code that did this was previously in InitializeImpl, and was removed from there to consolidate it in one place (see the chunk below), to avoid duplicating additional code. > ::: gfx/layers/opengl/CompositorOGL.cpp > @@ +545,4 @@ > > = static_cast<CompositingRenderTargetOGL*>(aSurface); > > if (mCurrentRenderTarget != surface) { > > mCurrentRenderTarget = surface; > > + if (mCurrentRenderTarget) { > > What prompted this change? The mContextStateTracker.PushOGLSection(gl(), "Frame"); was removed just below (from BeginFrame), again to consolidate code so that SetRenderTarget() could do extra work without needing to duplicate it twice in BeginFrame. A compositor frame starts with mCurrentRenderTarget == nullptr, so this would cause a mismatched Pop() otherwise.
Updated•8 years ago
|
Whiteboard: [gfx-noted] → [gfx-noted][vrm2]
https://hg.mozilla.org/mozilla-central/rev/fa2405094adb
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in
before you can comment on or make changes to this bug.
Description
•