Windows fixes

This commit is contained in:
Jack Andersen 2016-02-24 10:28:37 -10:00
parent 4c3323778a
commit 7b4bf7582f
2 changed files with 21 additions and 21 deletions

View File

@ -96,7 +96,7 @@ void TextView::Resources::init(boo::ID3DDataFactory* factory, FontCache* fcache)
" float3 uvIn[4] : UV;\n" " float3 uvIn[4] : UV;\n"
" float4 colorIn : COLOR;\n" " float4 colorIn : COLOR;\n"
"};\n" "};\n"
SPECTER_VIEW_VERT_BLOCK_HLSL SPECTER_HLSL_VIEW_VERT_BLOCK
"struct VertToFrag\n" "struct VertToFrag\n"
"{\n" "{\n"
" float4 position : SV_Position;\n" " float4 position : SV_Position;\n"
@ -183,14 +183,14 @@ void TextView::Resources::init(boo::ID3DDataFactory* factory, FontCache* fcache)
boo::BlendFactor::SrcColor1, boo::BlendFactor::InvSrcColor1, boo::BlendFactor::SrcColor1, boo::BlendFactor::InvSrcColor1,
false, false, false); false, false, false);
} }
#endif #endif
#if BOO_HAS_METAL #if BOO_HAS_METAL
void TextView::Resources::init(boo::MetalDataFactory* factory, FontCache* fcache) void TextView::Resources::init(boo::MetalDataFactory* factory, FontCache* fcache)
{ {
m_fcache = fcache; m_fcache = fcache;
static const char* VS = static const char* VS =
"#include <metal_stdlib>\n" "#include <metal_stdlib>\n"
"using namespace metal;\n" "using namespace metal;\n"
@ -219,7 +219,7 @@ void TextView::Resources::init(boo::MetalDataFactory* factory, FontCache* fcache
" vtf.position = view.mv * v.mvMtx * float4(v.posIn[vertId], 1.0);\n" " vtf.position = view.mv * v.mvMtx * float4(v.posIn[vertId], 1.0);\n"
" return vtf;\n" " return vtf;\n"
"}\n"; "}\n";
static const char* FSReg = static const char* FSReg =
"#include <metal_stdlib>\n" "#include <metal_stdlib>\n"
"using namespace metal;\n" "using namespace metal;\n"
@ -236,7 +236,7 @@ void TextView::Resources::init(boo::MetalDataFactory* factory, FontCache* fcache
" 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"
" return colorOut;\n" " return colorOut;\n"
"}\n"; "}\n";
boo::VertexElementDescriptor vdescs[] = boo::VertexElementDescriptor vdescs[] =
{ {
{nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0}, {nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0},
@ -254,13 +254,13 @@ void TextView::Resources::init(boo::MetalDataFactory* factory, FontCache* fcache
{nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced} {nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced}
}; };
m_vtxFmt = factory->newVertexFormat(13, vdescs); m_vtxFmt = factory->newVertexFormat(13, vdescs);
m_regular = m_regular =
factory->newShaderPipeline(VS, FSReg, m_vtxFmt, 1, factory->newShaderPipeline(VS, FSReg, m_vtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
false, false, false); false, false, false);
} }
#endif #endif
#if BOO_HAS_VULKAN #if BOO_HAS_VULKAN

View File

@ -83,7 +83,7 @@ void View::Resources::init(boo::GLDataFactory* factory, const IThemeData& theme)
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
false, false, false); false, false, false);
} }
#if _WIN32 #if _WIN32
void View::Resources::init(boo::ID3DDataFactory* factory, const IThemeData& theme) void View::Resources::init(boo::ID3DDataFactory* factory, const IThemeData& theme)
@ -94,7 +94,7 @@ void View::Resources::init(boo::ID3DDataFactory* factory, const IThemeData& them
" float3 posIn : POSITION;\n" " float3 posIn : POSITION;\n"
" float4 colorIn : COLOR;\n" " float4 colorIn : COLOR;\n"
"};\n" "};\n"
SPECTER_VIEW_VERT_BLOCK_HLSL SPECTER_HLSL_VIEW_VERT_BLOCK
"struct VertToFrag\n" "struct VertToFrag\n"
"{\n" "{\n"
" float4 position : SV_Position;\n" " float4 position : SV_Position;\n"
@ -125,7 +125,7 @@ void View::Resources::init(boo::ID3DDataFactory* factory, const IThemeData& them
" float3 posIn : POSITION;\n" " float3 posIn : POSITION;\n"
" float2 uvIn : UV;\n" " float2 uvIn : UV;\n"
"};\n" "};\n"
SPECTER_VIEW_VERT_BLOCK_HLSL SPECTER_HLSL_VIEW_VERT_BLOCK
"struct VertToFrag\n" "struct VertToFrag\n"
"{\n" "{\n"
" float4 position : SV_Position;\n" " float4 position : SV_Position;\n"
@ -183,10 +183,10 @@ void View::Resources::init(boo::ID3DDataFactory* factory, const IThemeData& them
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
false, false, false); false, false, false);
} }
#endif #endif
#if BOO_HAS_METAL #if BOO_HAS_METAL
void View::Resources::init(boo::MetalDataFactory* factory, const IThemeData& theme) void View::Resources::init(boo::MetalDataFactory* factory, const IThemeData& theme)
{ {
static const char* SolidVS = static const char* SolidVS =
@ -210,7 +210,7 @@ void View::Resources::init(boo::MetalDataFactory* factory, const IThemeData& the
" vtf.position = view.mv * float4(v.posIn, 1.0);\n" " vtf.position = view.mv * float4(v.posIn, 1.0);\n"
" return vtf;\n" " return vtf;\n"
"}\n"; "}\n";
static const char* SolidFS = static const char* SolidFS =
"#include <metal_stdlib>\n" "#include <metal_stdlib>\n"
"using namespace metal;\n" "using namespace metal;\n"
@ -262,14 +262,14 @@ void View::Resources::init(boo::MetalDataFactory* factory, const IThemeData& the
"{\n" "{\n"
" return tex.sample(samp, vtf.uv) * vtf.color;\n" " return tex.sample(samp, vtf.uv) * vtf.color;\n"
"}\n"; "}\n";
boo::VertexElementDescriptor solidvdescs[] = boo::VertexElementDescriptor solidvdescs[] =
{ {
{nullptr, nullptr, boo::VertexSemantic::Position4}, {nullptr, nullptr, boo::VertexSemantic::Position4},
{nullptr, nullptr, boo::VertexSemantic::Color} {nullptr, nullptr, boo::VertexSemantic::Color}
}; };
m_solidVtxFmt = factory->newVertexFormat(2, solidvdescs); m_solidVtxFmt = factory->newVertexFormat(2, solidvdescs);
m_solidShader = factory->newShaderPipeline(SolidVS, SolidFS, m_solidVtxFmt, 1, m_solidShader = factory->newShaderPipeline(SolidVS, SolidFS, m_solidVtxFmt, 1,
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
false, false, false); false, false, false);
@ -285,7 +285,7 @@ void View::Resources::init(boo::MetalDataFactory* factory, const IThemeData& the
boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha,
false, false, false); false, false, false);
} }
#endif #endif
#if BOO_HAS_VULKAN #if BOO_HAS_VULKAN
@ -378,11 +378,11 @@ void View::commitResources(ViewResources& res)
Log.report(LogVisor::FatalError, "multiple resource commits not allowed"); Log.report(LogVisor::FatalError, "multiple resource commits not allowed");
m_gfxData = res.m_factory->commit(); m_gfxData = res.m_factory->commit();
} }
void View::VertexBufferBinding::initSolid(ViewResources& res, size_t count, boo::IGraphicsBuffer* viewBlockBuf) void View::VertexBufferBinding::initSolid(ViewResources& res, size_t count, boo::IGraphicsBuffer* viewBlockBuf)
{ {
m_vertsBuf = res.m_factory->newDynamicBuffer(boo::BufferUse::Vertex, sizeof(SolidShaderVert), count); m_vertsBuf = res.m_factory->newDynamicBuffer(boo::BufferUse::Vertex, sizeof(SolidShaderVert), count);
if (!res.m_viewRes.m_solidVtxFmt) if (!res.m_viewRes.m_solidVtxFmt)
{ {
boo::VertexElementDescriptor vdescs[] = boo::VertexElementDescriptor vdescs[] =
@ -405,11 +405,11 @@ void View::VertexBufferBinding::initSolid(ViewResources& res, size_t count, boo:
nullptr, 1, bufs, 0, nullptr); nullptr, 1, bufs, 0, nullptr);
} }
} }
void View::VertexBufferBinding::initTex(ViewResources& res, size_t count, boo::IGraphicsBuffer* viewBlockBuf, boo::ITexture* texture) void View::VertexBufferBinding::initTex(ViewResources& res, size_t count, boo::IGraphicsBuffer* viewBlockBuf, boo::ITexture* texture)
{ {
m_vertsBuf = res.m_factory->newDynamicBuffer(boo::BufferUse::Vertex, sizeof(TexShaderVert), count); m_vertsBuf = res.m_factory->newDynamicBuffer(boo::BufferUse::Vertex, sizeof(TexShaderVert), count);
if (!res.m_viewRes.m_texVtxFmt) if (!res.m_viewRes.m_texVtxFmt)
{ {
boo::VertexElementDescriptor vdescs[] = boo::VertexElementDescriptor vdescs[] =