1#ifndef SEAD_GRAPHICS_CONTEXT_MRT_H_
2#define SEAD_GRAPHICS_CONTEXT_MRT_H_
4#include <container/seadSafeArray.h>
5#include <gfx/seadColor.h>
6#include <gfx/seadGraphics.h>
7#include <prim/seadBitFlag.h>
186 return mBlendExpression[target];
207 u32 color_mask = r << 0 |
211 mColorMask = (mColorMask & ~(0xF << (target * 4))) | (color_mask << (target * 4));
227 mStencilTestRef = ref;
228 mStencilTestMask = mask;
241 mPolygonModeFront = front;
242 mPolygonModeBack = back;
249 mPolygonOffsetFrontEnable = fill_front_enable;
250 mPolygonOffsetBackEnable = fill_back_enable;
251 mPolygonOffsetPointLineEnable = point_line_enable;
287 return mBlendExpression[target];
307 return mAlphaTestRef;
312 u32 color_mask = mColorMask >> (target * 4) & 0xF;
313 return color_mask >> 0 & 1;
318 u32 color_mask = mColorMask >> (target * 4) & 0xF;
319 return color_mask >> 1 & 1;
324 u32 color_mask = mColorMask >> (target * 4) & 0xF;
325 return color_mask >> 2 & 1;
330 u32 color_mask = mColorMask >> (target * 4) & 0xF;
331 return color_mask >> 3 & 1;
351 return mStencilTestRef;
356 return mStencilTestMask;
377 return mPolygonModeFront;
384 return mPolygonModeBack;
391 return mPolygonOffsetFrontEnable;
398 return mPolygonOffsetBackEnable;
405 return mPolygonOffsetPointLineEnable;
437static_assert(
sizeof(
GraphicsContextMRT) == 0x11C,
"sead::GraphicsContextMRT size mismatch");
Definition seadGraphicsContextMRT.h:15
void setBlendFactorDst(Graphics::BlendFactor factor)
Definition seadGraphicsContextMRT.h:47
Graphics::BlendFactor getBlendFactorSrcAlpha() const
Definition seadGraphicsContextMRT.h:100
void setBlendFactor(Graphics::BlendFactor src_factor, Graphics::BlendFactor dst_factor)
Definition seadGraphicsContextMRT.h:27
void setBlendEquationRGB(Graphics::BlendEquation equation)
Definition seadGraphicsContextMRT.h:85
Graphics::BlendEquation getBlendEquationAlpha() const
Definition seadGraphicsContextMRT.h:120
Graphics::BlendFactor mBlendFactorSrcA
Definition seadGraphicsContextMRT.h:127
void setBlendEquationSeparate(Graphics::BlendEquation equation_rgb, Graphics::BlendEquation equation_a)
Definition seadGraphicsContextMRT.h:79
void setBlendFactorSeparate(Graphics::BlendFactor src_factor_rgb, Graphics::BlendFactor dst_factor_rgb, Graphics::BlendFactor src_factor_a, Graphics::BlendFactor dst_factor_a)
Definition seadGraphicsContextMRT.h:33
BlendExpression()
Definition seadGraphicsContextMRT.h:17
void setBlendFactorSrc(Graphics::BlendFactor factor)
Definition seadGraphicsContextMRT.h:41
void setBlendFactorDstRGB(Graphics::BlendFactor factor)
Definition seadGraphicsContextMRT.h:63
Graphics::BlendFactor getBlendFactorSrcRGB() const
Definition seadGraphicsContextMRT.h:95
Graphics::BlendFactor mBlendFactorDstA
Definition seadGraphicsContextMRT.h:129
void setBlendFactorDstAlpha(Graphics::BlendFactor factor)
Definition seadGraphicsContextMRT.h:68
void setBlendEquationAlpha(Graphics::BlendEquation equation)
Definition seadGraphicsContextMRT.h:90
Graphics::BlendEquation mBlendEquationA
Definition seadGraphicsContextMRT.h:131
Graphics::BlendEquation getBlendEquationRGB() const
Definition seadGraphicsContextMRT.h:115
Graphics::BlendEquation mBlendEquationRGB
Definition seadGraphicsContextMRT.h:130
void setBlendFactorSrcRGB(Graphics::BlendFactor factor)
Definition seadGraphicsContextMRT.h:53
Graphics::BlendFactor getBlendFactorDstAlpha() const
Definition seadGraphicsContextMRT.h:110
void setBlendFactorSrcAlpha(Graphics::BlendFactor factor)
Definition seadGraphicsContextMRT.h:58
Graphics::BlendFactor mBlendFactorDstRGB
Definition seadGraphicsContextMRT.h:128
void setBlendEquation(Graphics::BlendEquation equation)
Definition seadGraphicsContextMRT.h:73
Graphics::BlendFactor getBlendFactorDstRGB() const
Definition seadGraphicsContextMRT.h:105
Graphics::BlendFactor mBlendFactorSrcRGB
Definition seadGraphicsContextMRT.h:126
Definition seadGraphicsContextMRT.h:12
bool mDepthWriteEnable
Definition seadGraphicsContextMRT.h:411
bool mStencilTestEnable
Definition seadGraphicsContextMRT.h:421
u32 getColorMask() const
Definition seadGraphicsContextMRT.h:334
Graphics::StencilOp mStencilOpZPass
Definition seadGraphicsContextMRT.h:427
bool getColorMaskB(u32 target) const
Definition seadGraphicsContextMRT.h:322
u32 mColorMask
Definition seadGraphicsContextMRT.h:420
s32 mStencilTestRef
Definition seadGraphicsContextMRT.h:423
void applyCullingAndPolygonModeAndPolygonOffset() const
Definition seadGraphicsContextMRT.cpp:213
bool getPolygonOffsetBackEnable() const
Definition seadGraphicsContextMRT.h:395
void setAlphaTestEnable(bool enable)
Definition seadGraphicsContextMRT.h:194
GraphicsContextMRT()
Definition seadGraphicsContextMRT.cpp:5
u32 getStencilTestMask() const
Definition seadGraphicsContextMRT.h:354
bool getPolygonOffsetFrontEnable() const
Definition seadGraphicsContextMRT.h:388
bool getAlphaTestEnable() const
Definition seadGraphicsContextMRT.h:295
bool getPolygonOffsetPointLineEnable() const
Definition seadGraphicsContextMRT.h:402
u32 mStencilTestMask
Definition seadGraphicsContextMRT.h:424
void setColorMask(u32 target, bool r, bool g, bool b, bool a)
Definition seadGraphicsContextMRT.h:205
bool getBlendEnable(u32 target) const
Definition seadGraphicsContextMRT.h:275
void setCullingMode(Graphics::CullingMode mode)
Definition seadGraphicsContextMRT.h:169
bool mAlphaTestEnable
Definition seadGraphicsContextMRT.h:417
Graphics::AlphaFunc getAlphaTestFunc() const
Definition seadGraphicsContextMRT.h:300
Graphics::DepthFunc mDepthFunc
Definition seadGraphicsContextMRT.h:412
void setColorMask(u32 mask)
Definition seadGraphicsContextMRT.h:214
f32 getAlphaTestRef() const
Definition seadGraphicsContextMRT.h:305
void applyAlphaTest() const
Definition seadGraphicsContextMRT.cpp:128
Graphics::StencilOp getStencilTestOpFail() const
Definition seadGraphicsContextMRT.h:359
void setPolygonOffsetEnable(bool fill_front_enable, bool fill_back_enable, bool point_line_enable)
Definition seadGraphicsContextMRT.h:246
void setBlendEnableMask(u32 mask)
Definition seadGraphicsContextMRT.h:179
void setDepthWriteEnable(bool write_enable)
Definition seadGraphicsContextMRT.h:159
Graphics::StencilOp getStencilTestOpZFail() const
Definition seadGraphicsContextMRT.h:364
Graphics::CullingMode mCullingMode
Definition seadGraphicsContextMRT.h:413
bool getDepthTestEnable() const
Definition seadGraphicsContextMRT.h:255
virtual ~GraphicsContextMRT()
Definition seadGraphicsContextMRT.h:136
BlendExpression & getBlendExpression(u32 target)
Definition seadGraphicsContextMRT.h:184
Graphics::AlphaFunc mAlphaTestFunc
Definition seadGraphicsContextMRT.h:418
bool mDepthTestEnable
Definition seadGraphicsContextMRT.h:410
Color4f mBlendConstantColor
Definition seadGraphicsContextMRT.h:416
Graphics::StencilFunc mStencilTestFunc
Definition seadGraphicsContextMRT.h:422
Graphics::CullingMode getCullingMode() const
Definition seadGraphicsContextMRT.h:270
f32 mAlphaTestRef
Definition seadGraphicsContextMRT.h:419
bool getStencilTestEnable() const
Definition seadGraphicsContextMRT.h:339
void setDepthTestEnable(bool test_enable)
Definition seadGraphicsContextMRT.h:154
Graphics::StencilOp mStencilOpZFail
Definition seadGraphicsContextMRT.h:426
bool getColorMaskA(u32 target) const
Definition seadGraphicsContextMRT.h:328
void applyBlendConstantColor() const
Definition seadGraphicsContextMRT.cpp:203
u32 getBlendEnableMask() const
Definition seadGraphicsContextMRT.h:280
bool getColorMaskR(u32 target) const
Definition seadGraphicsContextMRT.h:310
void setPolygonMode(Graphics::PolygonMode front, Graphics::PolygonMode back)
Definition seadGraphicsContextMRT.h:238
void applyColorMask() const
Definition seadGraphicsContextMRT.cpp:161
void setStencilTestOp(Graphics::StencilOp fail, Graphics::StencilOp zfail, Graphics::StencilOp zpass)
Definition seadGraphicsContextMRT.h:231
void apply() const
Definition seadGraphicsContextMRT.cpp:39
void applyBlendAndFastZ() const
Definition seadGraphicsContextMRT.cpp:177
BitFlag32 mBlendEnableMask
Definition seadGraphicsContextMRT.h:414
void setAlphaTestFunc(Graphics::AlphaFunc func, f32 ref)
Definition seadGraphicsContextMRT.h:199
void setBlendConstantColor(const Color4f &color)
Definition seadGraphicsContextMRT.h:189
void setDepthFunc(Graphics::DepthFunc func)
Definition seadGraphicsContextMRT.h:164
bool getColorMaskG(u32 target) const
Definition seadGraphicsContextMRT.h:316
void setDepthEnable(bool test_enable, bool write_enable)
Definition seadGraphicsContextMRT.h:148
Graphics::StencilOp mStencilOpFail
Definition seadGraphicsContextMRT.h:425
Graphics::StencilOp getStencilTestOpZPass() const
Definition seadGraphicsContextMRT.h:369
const BlendExpression & getBlendExpression(u32 target) const
Definition seadGraphicsContextMRT.h:285
Graphics::DepthFunc getDepthFunc() const
Definition seadGraphicsContextMRT.h:265
void setStencilTestFunc(Graphics::StencilFunc func, s32 ref, u32 mask)
Definition seadGraphicsContextMRT.h:224
Graphics::StencilFunc getStencilTestFunc() const
Definition seadGraphicsContextMRT.h:344
void setBlendEnable(u32 target, bool blend)
Definition seadGraphicsContextMRT.h:174
void applyDepthAndStencilTest() const
Definition seadGraphicsContextMRT.cpp:137
Graphics::PolygonMode getPolygonModeFront() const
Definition seadGraphicsContextMRT.h:374
SafeArray< BlendExpression, Graphics::cRenderTarget_Num > mBlendExpression
Definition seadGraphicsContextMRT.h:415
bool getDepthWriteEnable() const
Definition seadGraphicsContextMRT.h:260
const Color4f & getBlendConstantColor() const
Definition seadGraphicsContextMRT.h:290
void setStencilTestEnable(bool enable)
Definition seadGraphicsContextMRT.h:219
s32 getStencilTestRef() const
Definition seadGraphicsContextMRT.h:349
Graphics::PolygonMode getPolygonModeBack() const
Definition seadGraphicsContextMRT.h:381
Definition seadGraphics.h:17
DepthFunc
Definition seadGraphics.h:44
BlendEquation
Definition seadGraphics.h:89
StencilFunc
Definition seadGraphics.h:114
PolygonMode
Definition seadGraphics.h:142
AlphaFunc
Definition seadGraphics.h:100
StencilOp
Definition seadGraphics.h:128
BlendFactor
Definition seadGraphics.h:68
CullingMode
Definition seadGraphics.h:58
Definition seadSafeArray.h:19
Definition seadAssert.h:44
BitFlag< u32 > BitFlag32
Definition seadBitFlag.h:125