mirror of https://github.com/AxioDL/metaforce.git
Changes to support MSAA rendering
This commit is contained in:
parent
8869646bae
commit
78dee431dc
|
@ -16,7 +16,7 @@ RootView::RootView(IViewManager& viewMan, ViewResources& res, boo::IWindow* wind
|
||||||
{
|
{
|
||||||
buildResources(ctx, res);
|
buildResources(ctx, res);
|
||||||
m_splitMenuSystem.emplace(*this, ctx);
|
m_splitMenuSystem.emplace(*this, ctx);
|
||||||
m_renderTex = ctx.newRenderTexture(rect.size[0], rect.size[1], boo::TextureClampMode::Repeat, 3, 3);
|
m_renderTex = ctx.newRenderTexture(rect.size[0], rect.size[1], boo::TextureClampMode::ClampToEdge, 3, 3);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
resized(rect, rect);
|
resized(rect, rect);
|
||||||
|
|
|
@ -224,14 +224,15 @@ void TextView::Resources::init(boo::MetalDataFactory::Context& ctx, FontCache* f
|
||||||
static const char* FSReg =
|
static const char* FSReg =
|
||||||
"#include <metal_stdlib>\n"
|
"#include <metal_stdlib>\n"
|
||||||
"using namespace metal;\n"
|
"using namespace metal;\n"
|
||||||
"constexpr sampler samp(address::repeat);\n"
|
|
||||||
"struct VertToFrag\n"
|
"struct VertToFrag\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" float4 position [[ position ]];\n"
|
" float4 position [[ position ]];\n"
|
||||||
" float3 uv;\n"
|
" float3 uv;\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]], texture2d_array<float> fontTex [[ texture(0) ]])\n"
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
||||||
|
" sampler samp [[ sampler(0) ]],\n"
|
||||||
|
" texture2d_array<float> fontTex [[ texture(0) ]])\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" float4 colorOut = vtf.color;\n"
|
" float4 colorOut = vtf.color;\n"
|
||||||
" colorOut.a *= fontTex.sample(samp, vtf.uv.xy, vtf.uv.z).r;\n"
|
" colorOut.a *= fontTex.sample(samp, vtf.uv.xy, vtf.uv.z).r;\n"
|
||||||
|
@ -257,7 +258,7 @@ void TextView::Resources::init(boo::MetalDataFactory::Context& ctx, FontCache* f
|
||||||
m_vtxFmt = ctx.newVertexFormat(13, vdescs);
|
m_vtxFmt = ctx.newVertexFormat(13, vdescs);
|
||||||
|
|
||||||
m_regular =
|
m_regular =
|
||||||
ctx.newShaderPipeline(VS, FSReg, nullptr, nullptr, m_vtxFmt, 1,
|
ctx.newShaderPipeline(VS, FSReg, nullptr, nullptr, m_vtxFmt,
|
||||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||||
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,14 +253,15 @@ void View::Resources::init(boo::MetalDataFactory::Context& ctx, const IThemeData
|
||||||
static const char* TexFS =
|
static const char* TexFS =
|
||||||
"#include <metal_stdlib>\n"
|
"#include <metal_stdlib>\n"
|
||||||
"using namespace metal;\n"
|
"using namespace metal;\n"
|
||||||
"constexpr sampler samp(address::repeat);\n"
|
|
||||||
"struct VertToFrag\n"
|
"struct VertToFrag\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" float4 position [[ position ]];\n"
|
" float4 position [[ position ]];\n"
|
||||||
" float4 color;\n"
|
" float4 color;\n"
|
||||||
" float2 uv;\n"
|
" float2 uv;\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]], texture2d<float> tex [[ texture(0) ]])\n"
|
"fragment float4 fmain(VertToFrag vtf [[ stage_in ]],\n"
|
||||||
|
" sampler samp [[ sampler(0) ]],\n"
|
||||||
|
" texture2d<float> tex [[ texture(0) ]])\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" return tex.sample(samp, vtf.uv) * vtf.color;\n"
|
" return tex.sample(samp, vtf.uv) * vtf.color;\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
@ -272,7 +273,7 @@ void View::Resources::init(boo::MetalDataFactory::Context& ctx, const IThemeData
|
||||||
};
|
};
|
||||||
m_solidVtxFmt = ctx.newVertexFormat(2, solidvdescs);
|
m_solidVtxFmt = ctx.newVertexFormat(2, solidvdescs);
|
||||||
|
|
||||||
m_solidShader = ctx.newShaderPipeline(SolidVS, SolidFS, nullptr, nullptr, m_solidVtxFmt, 1,
|
m_solidShader = ctx.newShaderPipeline(SolidVS, SolidFS, nullptr, nullptr, m_solidVtxFmt,
|
||||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||||
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||||
|
|
||||||
|
@ -283,7 +284,7 @@ void View::Resources::init(boo::MetalDataFactory::Context& ctx, const IThemeData
|
||||||
};
|
};
|
||||||
m_texVtxFmt = ctx.newVertexFormat(2, texvdescs);
|
m_texVtxFmt = ctx.newVertexFormat(2, texvdescs);
|
||||||
|
|
||||||
m_texShader = ctx.newShaderPipeline(TexVS, TexFS, nullptr, nullptr, m_texVtxFmt, 1,
|
m_texShader = ctx.newShaderPipeline(TexVS, TexFS, nullptr, nullptr, m_texVtxFmt,
|
||||||
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
|
||||||
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
boo::Primitive::TriStrips, boo::ZTest::None, false, true, false, boo::CullMode::None);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit c466fd21d1cbca1371ee92e062cbb43770e50657
|
Subproject commit f82efe058341810dec71954bf11eb21222059403
|
Loading…
Reference in New Issue