Reenable LyShine mask support now using Atom (#1218)
* Add option to set stencil ref in Dynamic Draw Context * Add depth/stencil attachment slot to UI pass * Rework mask rendering to use Atom * Add missing circle mask image
This commit is contained in:
@@ -138,6 +138,12 @@ namespace AZ
|
||||
//! Without per draw viewport, the viewport setup in pass is usually used.
|
||||
void UnsetViewport();
|
||||
|
||||
//! Set stencil reference for following draws which are added to this DynamicDrawContext
|
||||
void SetStencilReference(uint8_t stencilRef);
|
||||
|
||||
//! Get the current stencil reference.
|
||||
uint8_t GetStencilReference() const;
|
||||
|
||||
//! Draw Indexed primitives with vertex and index data and per draw srg
|
||||
//! The per draw srg need to be provided if it's required by shader.
|
||||
void DrawIndexed(void* vertexData, uint32_t vertexCount, void* indexData, uint32_t indexCount, RHI::IndexFormat indexFormat, Data::Instance < ShaderResourceGroup> drawSrg = nullptr);
|
||||
@@ -204,10 +210,13 @@ namespace AZ
|
||||
bool m_useScissor = false;
|
||||
RHI::Scissor m_scissor;
|
||||
|
||||
// current scissor
|
||||
// current viewport
|
||||
bool m_useViewport = false;
|
||||
RHI::Viewport m_viewport;
|
||||
|
||||
// Current stencil reference value
|
||||
uint8_t m_stencilRef = 0;
|
||||
|
||||
// Cached RHI pipeline states for different combination of render states
|
||||
AZStd::unordered_map<HashValue64, const RHI::PipelineState*> m_cachedRhiPipelineStates;
|
||||
|
||||
|
||||
@@ -382,6 +382,16 @@ namespace AZ
|
||||
m_useViewport = false;
|
||||
}
|
||||
|
||||
void DynamicDrawContext::SetStencilReference(uint8_t stencilRef)
|
||||
{
|
||||
m_stencilRef = stencilRef;
|
||||
}
|
||||
|
||||
uint8_t DynamicDrawContext::GetStencilReference() const
|
||||
{
|
||||
return m_stencilRef;
|
||||
}
|
||||
|
||||
void DynamicDrawContext::SetShaderVariant(ShaderVariantId shaderVariantId)
|
||||
{
|
||||
AZ_Assert( m_initialized && m_supportShaderVariants, "DynamicDrawContext is not initialized or unable to support shader variants. "
|
||||
@@ -475,6 +485,9 @@ namespace AZ
|
||||
drawItem.m_viewports = &m_viewport;
|
||||
}
|
||||
|
||||
// Set stencil reference. Used when stencil is enabled.
|
||||
drawItem.m_stencilRef = m_stencilRef;
|
||||
|
||||
drawItemInfo.m_sortKey = m_sortKey++;
|
||||
m_cachedDrawItems.emplace_back(drawItemInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user