aurora: Add more GX state functions & cleanup

This commit is contained in:
Luke Street 2022-02-27 16:58:27 -05:00
parent 004d78100f
commit fb69d3fdba
8 changed files with 92 additions and 69 deletions

View File

@ -157,6 +157,7 @@ void CCubeModel::DrawFlat(TVectorRef positions, TVectorRef normals, ESurfaceSele
while (surface != nullptr) { while (surface != nullptr) {
const auto mat = GetMaterialByIndex(surface->GetMaterialIndex()); const auto mat = GetMaterialByIndex(surface->GetMaterialIndex());
// TODO draw // TODO draw
surface = surface->GetNextSurface();
} }
} }
if (surfaces != ESurfaceSelection::Unsorted) { if (surfaces != ESurfaceSelection::Unsorted) {
@ -164,6 +165,7 @@ void CCubeModel::DrawFlat(TVectorRef positions, TVectorRef normals, ESurfaceSele
while (surface != nullptr) { while (surface != nullptr) {
const auto mat = GetMaterialByIndex(surface->GetMaterialIndex()); const auto mat = GetMaterialByIndex(surface->GetMaterialIndex());
// TODO draw // TODO draw
surface = surface->GetNextSurface();
} }
} }
} }

View File

@ -203,6 +203,7 @@ void CCubeRenderer::ReallyDrawPhazonSuitEffect(const zeus::CColor& modColor, con
void CCubeRenderer::DoPhazonSuitIndirectAlphaBlur(float blurRadius, float f2, const TLockedToken<CTexture>& indTex) {} void CCubeRenderer::DoPhazonSuitIndirectAlphaBlur(float blurRadius, float f2, const TLockedToken<CTexture>& indTex) {}
void CCubeRenderer::AddStaticGeometry(const std::vector<CMetroidModelInstance>* geometry, void CCubeRenderer::AddStaticGeometry(const std::vector<CMetroidModelInstance>* geometry,
const CAreaRenderOctTree* octTree, int areaIdx) {} const CAreaRenderOctTree* octTree, int areaIdx) {}
void CCubeRenderer::EnablePVS(const CPVSVisSet& set, u32 areaIdx) { void CCubeRenderer::EnablePVS(const CPVSVisSet& set, u32 areaIdx) {
if (!xdc_) { if (!xdc_) {
xc8_pvs.emplace(set); xc8_pvs.emplace(set);
@ -213,7 +214,9 @@ void CCubeRenderer::EnablePVS(const CPVSVisSet& set, u32 areaIdx) {
xe0_pvsAreaIdx = areaIdx; xe0_pvsAreaIdx = areaIdx;
} }
void CCubeRenderer::DisablePVS() { xc8_pvs.reset(); } void CCubeRenderer::DisablePVS() { xc8_pvs.reset(); }
void CCubeRenderer::RemoveStaticGeometry(const std::vector<CMetroidModelInstance>* geometry) {} void CCubeRenderer::RemoveStaticGeometry(const std::vector<CMetroidModelInstance>* geometry) {}
void CCubeRenderer::DrawUnsortedGeometry(int areaIdx, int mask, int targetMask, bool shadowRender) {} void CCubeRenderer::DrawUnsortedGeometry(int areaIdx, int mask, int targetMask, bool shadowRender) {}
void CCubeRenderer::DrawSortedGeometry(int areaIdx, int mask, int targetMask) {} void CCubeRenderer::DrawSortedGeometry(int areaIdx, int mask, int targetMask) {}
@ -230,9 +233,11 @@ void CCubeRenderer::AddParticleGen(CParticleGen& gen) {
Buckets::Insert(closestPoint, *bounds, EDrawableType::Particle, reinterpret_cast<void*>(&gen), xb0_viewPlane, 0); Buckets::Insert(closestPoint, *bounds, EDrawableType::Particle, reinterpret_cast<void*>(&gen), xb0_viewPlane, 0);
} }
} }
void CCubeRenderer::AddParticleGen(CParticleGen& gen, const zeus::CVector3f& pos, const zeus::CAABox& bounds) { void CCubeRenderer::AddParticleGen(CParticleGen& gen, const zeus::CVector3f& pos, const zeus::CAABox& bounds) {
Buckets::Insert(pos, bounds, EDrawableType::Particle, reinterpret_cast<void*>(&gen), xb0_viewPlane, 0); Buckets::Insert(pos, bounds, EDrawableType::Particle, reinterpret_cast<void*>(&gen), xb0_viewPlane, 0);
} }
void CCubeRenderer::AddPlaneObject(void* obj, const zeus::CAABox& aabb, const zeus::CPlane& plane, int type) { void CCubeRenderer::AddPlaneObject(void* obj, const zeus::CAABox& aabb, const zeus::CPlane& plane, int type) {
auto closestPoint = aabb.closestPointAlongVector(xb0_viewPlane.normal()); auto closestPoint = aabb.closestPointAlongVector(xb0_viewPlane.normal());
@ -258,6 +263,7 @@ void CCubeRenderer::AddPlaneObject(void* obj, const zeus::CAABox& aabb, const ze
Buckets::InsertPlaneObject(closestDist, furthestDist, aabb, invertTest, plane, zOnly, EDrawableType(type + 2), obj); Buckets::InsertPlaneObject(closestDist, furthestDist, aabb, invertTest, plane, zOnly, EDrawableType(type + 2), obj);
} }
} }
void CCubeRenderer::AddDrawable(void* obj, const zeus::CVector3f& pos, const zeus::CAABox& aabb, int mode, void CCubeRenderer::AddDrawable(void* obj, const zeus::CVector3f& pos, const zeus::CAABox& aabb, int mode,
IRenderer::EDrawableSorting sorting) { IRenderer::EDrawableSorting sorting) {
if (sorting == EDrawableSorting::UnsortedCallback) { if (sorting == EDrawableSorting::UnsortedCallback) {
@ -266,6 +272,7 @@ void CCubeRenderer::AddDrawable(void* obj, const zeus::CVector3f& pos, const zeu
Buckets::Insert(pos, aabb, EDrawableType(mode + 2), obj, xb0_viewPlane, 0); Buckets::Insert(pos, aabb, EDrawableType(mode + 2), obj, xb0_viewPlane, 0);
} }
} }
void CCubeRenderer::SetDrawableCallback(IRenderer::TDrawableCallback cb, void* ctx) { void CCubeRenderer::SetDrawableCallback(IRenderer::TDrawableCallback cb, void* ctx) {
xa8_drawableCallback = cb; xa8_drawableCallback = cb;
xac_drawableCallbackUserData = ctx; xac_drawableCallbackUserData = ctx;
@ -276,9 +283,11 @@ void CCubeRenderer::SetWorldViewpoint(const zeus::CTransform& xf) {
auto front = xf.frontVector(); auto front = xf.frontVector();
xb0_viewPlane = zeus::CPlane(front, front.dot(xf.origin)); xb0_viewPlane = zeus::CPlane(front, front.dot(xf.origin));
} }
void CCubeRenderer::SetPerspective(float fovy, float aspect, float znear, float zfar) { void CCubeRenderer::SetPerspective(float fovy, float aspect, float znear, float zfar) {
CGraphics::SetPerspective(fovy, aspect, znear, zfar); CGraphics::SetPerspective(fovy, aspect, znear, zfar);
} }
void CCubeRenderer::SetPerspective(float fovy, float width, float height, float znear, float zfar) { void CCubeRenderer::SetPerspective(float fovy, float width, float height, float znear, float zfar) {
CGraphics::SetPerspective(fovy, width / height, znear, zfar); CGraphics::SetPerspective(fovy, width / height, znear, zfar);
} }
@ -286,11 +295,14 @@ void CCubeRenderer::SetPerspective(float fovy, float width, float height, float
std::pair<zeus::CVector2f, zeus::CVector2f> CCubeRenderer::SetViewportOrtho(bool centered, float znear, float zfar) { std::pair<zeus::CVector2f, zeus::CVector2f> CCubeRenderer::SetViewportOrtho(bool centered, float znear, float zfar) {
return std::pair<zeus::CVector2f, zeus::CVector2f>(); return std::pair<zeus::CVector2f, zeus::CVector2f>();
} }
void CCubeRenderer::SetClippingPlanes(const zeus::CFrustum& frustum) { x44_frustumPlanes = frustum; } void CCubeRenderer::SetClippingPlanes(const zeus::CFrustum& frustum) { x44_frustumPlanes = frustum; }
void CCubeRenderer::SetViewport(int left, int bottom, int width, int height) { void CCubeRenderer::SetViewport(int left, int bottom, int width, int height) {
CGraphics::SetViewport(left, bottom, width, height); CGraphics::SetViewport(left, bottom, width, height);
CGraphics::SetScissor(left, bottom, width, height); CGraphics::SetScissor(left, bottom, width, height);
} }
void CCubeRenderer::BeginScene() { void CCubeRenderer::BeginScene() {
CGraphics::SetUseVideoFilter(true); CGraphics::SetUseVideoFilter(true);
CGraphics::SetViewport(0, 0, CGraphics::g_Viewport.x8_width, CGraphics::g_Viewport.xc_height); CGraphics::SetViewport(0, 0, CGraphics::g_Viewport.x8_width, CGraphics::g_Viewport.xc_height);
@ -314,10 +326,11 @@ void CCubeRenderer::BeginScene() {
} }
// GXSetPixelFmt(x318_26_requestRGBA6, GX_ZC_LINEAR); // GXSetPixelFmt(x318_26_requestRGBA6, GX_ZC_LINEAR);
// GXSetAlphaUpdate(true); aurora::gfx::set_alpha_update(true);
// GXSetDstAlpha(true, 0); aurora::gfx::set_dst_alpha(true, 0.f);
CGraphics::BeginScene(); CGraphics::BeginScene();
} }
void CCubeRenderer::EndScene() { void CCubeRenderer::EndScene() {
x318_31_persistRGBA6 = !CGraphics::g_IsBeginSceneClearFb; x318_31_persistRGBA6 = !CGraphics::g_IsBeginSceneClearFb;
CGraphics::EndScene(); CGraphics::EndScene();
@ -332,14 +345,9 @@ void CCubeRenderer::EndScene() {
void CCubeRenderer::SetDebugOption(IRenderer::EDebugOption option, int value) { void CCubeRenderer::SetDebugOption(IRenderer::EDebugOption option, int value) {
if (option == EDebugOption::PVSState) { if (option == EDebugOption::PVSState) {
xc8_pvs->SetState(EPVSVisSetState(value)); xc8_pvs->SetState(EPVSVisSetState(value));
return; } else if (option == EDebugOption::PVSMode) {
}
if (option == EDebugOption::PVSMode) {
xc0_pvsMode = EPVSMode(value); xc0_pvsMode = EPVSMode(value);
} } else if (option == EDebugOption::FogDisabled) {
if (option == EDebugOption::FogDisabled) {
x318_28_disableFog = true; x318_28_disableFog = true;
} }
} }
@ -375,12 +383,16 @@ void CCubeRenderer::SetThermalColdScale(float scale) {}
void CCubeRenderer::DoThermalBlendCold() {} void CCubeRenderer::DoThermalBlendCold() {}
void CCubeRenderer::DoThermalBlendHot() {} void CCubeRenderer::DoThermalBlendHot() {}
u32 CCubeRenderer::GetStaticWorldDataSize() { return 0; } u32 CCubeRenderer::GetStaticWorldDataSize() { return 0; }
void CCubeRenderer::SetGXRegister1Color(const zeus::CColor& color) { void CCubeRenderer::SetGXRegister1Color(const zeus::CColor& color) {
CGraphics::g_ColorRegs[1] = color; CGraphics::g_ColorRegs[1] = color;
// GXSetTevColor(GX_TEVREG1, color); aurora::gfx::set_gx_reg1_color(color);
} }
void CCubeRenderer::SetWorldLightFadeLevel(float level) { x2fc_tevReg1Color = zeus::CColor(level, level, level, 1.f); } void CCubeRenderer::SetWorldLightFadeLevel(float level) { x2fc_tevReg1Color = zeus::CColor(level, level, level, 1.f); }
void CCubeRenderer::SetWorldLightMultiplyColor(const zeus::CColor& color) { CGraphics::g_ColorRegs[2] = color; } void CCubeRenderer::SetWorldLightMultiplyColor(const zeus::CColor& color) { CGraphics::g_ColorRegs[2] = color; }
void CCubeRenderer::PrepareDynamicLights(const std::vector<CLight>& lights) {} void CCubeRenderer::PrepareDynamicLights(const std::vector<CLight>& lights) {}
void CCubeRenderer::AllocatePhazonSuitMaskTexture() {} void CCubeRenderer::AllocatePhazonSuitMaskTexture() {}
void CCubeRenderer::DrawPhazonSuitIndirectEffect(const zeus::CColor& nonIndirectMod, void CCubeRenderer::DrawPhazonSuitIndirectEffect(const zeus::CColor& nonIndirectMod,

View File

@ -43,7 +43,6 @@ u32 CGraphics::g_FramesPast = 0;
frame_clock::time_point CGraphics::g_FrameStartTime = frame_clock::now(); frame_clock::time_point CGraphics::g_FrameStartTime = frame_clock::now();
ERglEnum CGraphics::g_depthFunc = ERglEnum::Never; ERglEnum CGraphics::g_depthFunc = ERglEnum::Never;
ERglCullMode CGraphics::g_cullMode = ERglCullMode::None; ERglCullMode CGraphics::g_cullMode = ERglCullMode::None;
// bool CGraphics::g_commitAsLazy = false;
const std::array<zeus::CMatrix3f, 6> CGraphics::skCubeBasisMats{{ const std::array<zeus::CMatrix3f, 6> CGraphics::skCubeBasisMats{{
/* Right */ /* Right */
@ -125,7 +124,7 @@ void CGraphics::BeginScene() {
} }
void CGraphics::EndScene() { void CGraphics::EndScene() {
//CGX::SetZMode(true, GX_LEQUAL, true); aurora::gfx::set_depth_mode(true, ERglEnum::LEqual, true);
/* Spinwait until g_NumBreakpointsWaiting is 0 */ /* Spinwait until g_NumBreakpointsWaiting is 0 */
/* ++g_NumBreakpointsWaiting; */ /* ++g_NumBreakpointsWaiting; */
/* GXCopyDisp to g_CurrenFrameBuf with clear enabled */ /* GXCopyDisp to g_CurrenFrameBuf with clear enabled */
@ -498,77 +497,72 @@ void CGraphics::SetUseVideoFilter(bool filter) {
void CGraphics::SetClearColor(const zeus::CColor& color) { void CGraphics::SetClearColor(const zeus::CColor& color) {
g_ClearColor = color; g_ClearColor = color;
// GXSetCopyClear(g_ClearColor, g_ClearDepthValue); aurora::gfx::set_clear_color(color);
} }
void CGraphics::SetCopyClear(const zeus::CColor& color, float depth) { void CGraphics::SetCopyClear(const zeus::CColor& color, float depth) {
g_ClearColor = color; g_ClearColor = color;
g_ClearDepthValue = depth; // 1.6777215E7 * depth; Metroid Prime needed this to convert float [0,1] depth into 24 bit g_ClearDepthValue = depth; // 1.6777215E7 * depth; Metroid Prime needed this to convert float [0,1] depth into 24 bit
// range, we no longer have this requirement // range, we no longer have this requirement
aurora::gfx::set_clear_color(color);
// TODO do we care about depth value?
// GXSetCopyClear(g_ClearColor, g_ClearDepthValue); // GXSetCopyClear(g_ClearColor, g_ClearDepthValue);
} }
void CGraphics::SetIsBeginSceneClearFb(bool clear) { void CGraphics::SetIsBeginSceneClearFb(bool clear) { g_IsBeginSceneClearFb = clear; }
g_IsBeginSceneClearFb = clear;
}
// boo::IGraphicsDataFactory::Platform CGraphics::g_BooPlatform = boo::IGraphicsDataFactory::Platform::Null;
// boo::IGraphicsDataFactory* CGraphics::g_BooFactory = nullptr;
// boo::IGraphicsCommandQueue* CGraphics::g_BooMainCommandQueue = nullptr;
// boo::ObjToken<boo::ITextureR> CGraphics::g_SpareTexture;
// const char* CGraphics::g_BooPlatformName = nullptr;
const CTevCombiners::CTevPass CGraphics::sTevPass805a564c({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, const CTevCombiners::CTevPass CGraphics::sTevPass805a564c{
GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA},
GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a5698({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC, const CTevCombiners::CTevPass CGraphics::sTevPass805a5698{
GX::TevColorArg::CC_C0, GX::TevColorArg::CC_ZERO}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_C0, GX::TevColorArg::CC_ZERO},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_A0, GX::TevAlphaArg::CA_ZERO},
GX::TevAlphaArg::CA_A0, GX::TevAlphaArg::CA_ZERO}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a5e70({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, const CTevCombiners::CTevPass CGraphics::sTevPass805a5e70{
GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_C0}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_C0},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_A0},
GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_A0}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a5ebc({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC, const CTevCombiners::CTevPass CGraphics::sTevPass805a5ebc{
GX::TevColorArg::CC_TEXC, GX::TevColorArg::CC_ZERO}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_TEXC, GX::TevColorArg::CC_ZERO},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_TEXA, GX::TevAlphaArg::CA_ZERO},
GX::TevAlphaArg::CA_TEXA, GX::TevAlphaArg::CA_ZERO}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a5f08({GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_TEXC, const CTevCombiners::CTevPass CGraphics::sTevPass805a5f08{
GX::TevColorArg::CC_TEXA, GX::TevColorArg::CC_ZERO}, {GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_TEXC, GX::TevColorArg::CC_TEXA, GX::TevColorArg::CC_ZERO},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA},
GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a5f54({GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_ONE, const CTevCombiners::CTevPass CGraphics::sTevPass805a5f54{
GX::TevColorArg::CC_TEXC, GX::TevColorArg::CC_ZERO}, {GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_ONE, GX::TevColorArg::CC_TEXC, GX::TevColorArg::CC_ZERO},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_TEXA, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_TEXA, GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_ZERO},
GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_ZERO}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a5fa0({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, const CTevCombiners::CTevPass CGraphics::sTevPass805a5fa0{
GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_TEXC}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_TEXC},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_TEXA},
GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_TEXA}); };
const CTevCombiners::CTevPass CGraphics::sTevPass804bfcc0({GX::TevColorArg::CC_C0, GX::TevColorArg::CC_TEXC, const CTevCombiners::CTevPass CGraphics::sTevPass804bfcc0{
GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_ZERO}, {GX::TevColorArg::CC_C0, GX::TevColorArg::CC_TEXC, GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_ZERO},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA},
GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_RASA}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a5fec({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, const CTevCombiners::CTevPass CGraphics::sTevPass805a5fec{
GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_RASC},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_TEXA, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_TEXA, GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_ZERO},
GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_ZERO}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a6038({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_TEXC, const CTevCombiners::CTevPass CGraphics::sTevPass805a6038{
GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_ZERO}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_TEXC, GX::TevColorArg::CC_RASC, GX::TevColorArg::CC_ZERO},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_KONST, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_KONST, GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_ZERO},
GX::TevAlphaArg::CA_RASA, GX::TevAlphaArg::CA_ZERO}); };
const CTevCombiners::CTevPass CGraphics::sTevPass805a6084({GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_CPREV, const CTevCombiners::CTevPass CGraphics::sTevPass805a6084{
GX::TevColorArg::CC_APREV, GX::TevColorArg::CC_ZERO}, {GX::TevColorArg::CC_ZERO, GX::TevColorArg::CC_CPREV, GX::TevColorArg::CC_APREV, GX::TevColorArg::CC_ZERO},
{GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, {GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_APREV},
GX::TevAlphaArg::CA_ZERO, GX::TevAlphaArg::CA_APREV}); };
} // namespace metaforce } // namespace metaforce

View File

@ -142,7 +142,11 @@ enum class ZComp : uint8_t {
void set_cull_mode(metaforce::ERglCullMode mode) noexcept; void set_cull_mode(metaforce::ERglCullMode mode) noexcept;
void set_blend_mode(metaforce::ERglBlendMode mode, metaforce::ERglBlendFactor src, metaforce::ERglBlendFactor dst, void set_blend_mode(metaforce::ERglBlendMode mode, metaforce::ERglBlendFactor src, metaforce::ERglBlendFactor dst,
metaforce::ERglLogicOp op) noexcept; metaforce::ERglLogicOp op) noexcept;
void set_depth_mode(bool compare_enable, metaforce::ERglEnum func, bool update_enable); void set_depth_mode(bool compare_enable, metaforce::ERglEnum func, bool update_enable) noexcept;
void set_gx_reg1_color(const zeus::CColor& color) noexcept;
void set_alpha_update(bool enabled) noexcept;
void set_dst_alpha(bool enabled, float value) noexcept;
void set_clear_color(const zeus::CColor& color) noexcept;
// Model state // Model state
void set_alpha_discard(bool v); void set_alpha_discard(bool v);

View File

@ -121,7 +121,11 @@ bool get_dxt_compression_supported() noexcept { return g_device.HasFeature(wgpu:
void set_cull_mode(metaforce::ERglCullMode mode) noexcept {} void set_cull_mode(metaforce::ERglCullMode mode) noexcept {}
void set_blend_mode(metaforce::ERglBlendMode mode, metaforce::ERglBlendFactor src, metaforce::ERglBlendFactor dst, void set_blend_mode(metaforce::ERglBlendMode mode, metaforce::ERglBlendFactor src, metaforce::ERglBlendFactor dst,
metaforce::ERglLogicOp op) noexcept {} metaforce::ERglLogicOp op) noexcept {}
void set_depth_mode(bool compare_enable, metaforce::ERglEnum func, bool update_enable) {} void set_depth_mode(bool compare_enable, metaforce::ERglEnum func, bool update_enable) noexcept {}
void set_gx_reg1_color(const zeus::CColor& color) noexcept {}
void set_alpha_update(bool enabled) noexcept {}
void set_dst_alpha(bool enabled, float value) noexcept {}
void set_clear_color(const zeus::CColor& color) noexcept {}
// Model state // Model state
void set_alpha_discard(bool v) {} void set_alpha_discard(bool v) {}

View File

@ -128,7 +128,9 @@ void initialize(SDL_Window* window) {
g_Adapter.GetProperties(&g_AdapterProperties); g_Adapter.GetProperties(&g_AdapterProperties);
g_backendType = g_AdapterProperties.backendType; g_backendType = g_AdapterProperties.backendType;
const auto backendName = magic_enum::enum_name(g_backendType); const auto backendName = magic_enum::enum_name(g_backendType);
Log.report(logvisor::Info, FMT_STRING("Using {} graphics backend"), backendName); Log.report(logvisor::Info, FMT_STRING("Graphics adapter information\n API: {}\n Device: {} ({})\n Driver: {}"),
backendName, g_AdapterProperties.name, magic_enum::enum_name(g_AdapterProperties.adapterType),
g_AdapterProperties.driverDescription);
{ {
const std::array<wgpu::FeatureName, 1> requiredFeatures{ const std::array<wgpu::FeatureName, 1> requiredFeatures{

View File

@ -64,7 +64,7 @@ void new_frame(const WindowSize& size) noexcept {
ImGui_ImplSDL2_NewFrame(); ImGui_ImplSDL2_NewFrame();
// Render at full DPI // Render at full DPI
ImGui::GetIO().DisplaySize = ImVec2{static_cast<float>(size.fb_width), static_cast<float>(size.fb_height)}; ImGui::GetIO().DisplaySize = {static_cast<float>(size.fb_width), static_cast<float>(size.fb_height)};
ImGui::NewFrame(); ImGui::NewFrame();
} }

View File

@ -3,6 +3,11 @@
#include <zeus/CVector2f.hpp> #include <zeus/CVector2f.hpp>
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS #define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
#define IMGUI_DISABLE_OBSOLETE_KEYIO
#ifdef NDEBUG
#define IMGUI_DISABLE_DEMO_WINDOWS
#endif
#define IM_VEC2_CLASS_EXTRA \ #define IM_VEC2_CLASS_EXTRA \
ImVec2(const zeus::CVector2f& v) { \ ImVec2(const zeus::CVector2f& v) { \