From 7c0bf75f7a3f79c6e767189215403cfd2f78997c Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 23 Mar 2018 11:56:17 -1000 Subject: [PATCH] Various windows fixes and additions --- CMakeLists.txt | 2 + DataSpec/DNACommon/ParticleCommon.cpp | 32 +++ DataSpec/SpecBase.cpp | 47 ++-- DataSpec/SpecBase.hpp | 10 +- DataSpec/SpecMP1.cpp | 35 ++- DataSpec/SpecMP2.cpp | 35 ++- DataSpec/SpecMP3.cpp | 64 +++--- Editor/ProjectManager.cpp | 3 +- Editor/ProjectResourceFactoryBase.cpp | 6 +- Runtime/Graphics/Shaders/CDecalShaders.hpp | 2 +- .../Graphics/Shaders/CDecalShadersGLSL.cpp | 153 ++----------- .../Graphics/Shaders/CDecalShadersHLSL.cpp | 208 ++---------------- amuse | 2 +- hecl | 2 +- hecl-gui | 2 +- 15 files changed, 171 insertions(+), 432 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac19982f3..3da3bf9d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,8 +63,10 @@ if(MSVC) # Link-time Code Generation for Release builds set(CMAKE_C_FLAGS_RELEASE "/DNDEBUG /O2 /Oy /GL /Gy /MD") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") + set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG") set(CMAKE_C_FLAGS_RELWITHDEBINFO "/DNDEBUG /Zi /O2 /Oy- /GL /Gy /MD") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "/LTCG") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO") set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup") diff --git a/DataSpec/DNACommon/ParticleCommon.cpp b/DataSpec/DNACommon/ParticleCommon.cpp index 79435e03c..2a59bc5bf 100644 --- a/DataSpec/DNACommon/ParticleCommon.cpp +++ b/DataSpec/DNACommon/ParticleCommon.cpp @@ -1223,6 +1223,11 @@ void EESimpleEmitterTR::Enumerate(typename Write::StreamT& w) velocity.write(w); } +template <> +const char* UVEConstant::DNAType() { return "UVEConstant"; } +template <> +const char* UVEConstant::DNAType() { return "UVEConstant"; } + template void UVEConstant::_read(typename ReadYaml::StreamT& r) { @@ -1264,6 +1269,11 @@ AT_SUBSPECIALIZE_DNA_YAML(UVEConstant) template struct UVEConstant; template struct UVEConstant; +template <> +const char* UVEAnimTexture::DNAType() { return "UVEAnimTexture"; } +template <> +const char* UVEAnimTexture::DNAType() { return "UVEAnimTexture"; } + template void UVEAnimTexture::_read(typename ReadYaml::StreamT& r) { @@ -1348,6 +1358,11 @@ AT_SUBSPECIALIZE_DNA_YAML(UVEAnimTexture) template struct UVEAnimTexture; template struct UVEAnimTexture; +template <> +const char* UVElementFactory::DNAType() { return "UVElementFactory"; } +template <> +const char* UVElementFactory::DNAType() { return "UVElementFactory"; } + template void UVElementFactory::_read(typename Read::StreamT& r) { @@ -1415,6 +1430,13 @@ AT_SUBSPECIALIZE_DNA_YAML(UVElementFactory) template struct UVElementFactory; template struct UVElementFactory; +template <> +const char* SpawnSystemKeyframeData::SpawnSystemKeyframeInfo::DNAType() +{ return "SpawnSystemKeyframeData::SpawnSystemKeyframeInfo"; } +template <> +const char* SpawnSystemKeyframeData::SpawnSystemKeyframeInfo::DNAType() +{ return "SpawnSystemKeyframeData::SpawnSystemKeyframeInfo"; } + template template void SpawnSystemKeyframeData::SpawnSystemKeyframeInfo::Enumerate(typename Op::StreamT& s) @@ -1425,6 +1447,11 @@ void SpawnSystemKeyframeData::SpawnSystemKeyframeInfo::Enumerate(typenam Do({"c"}, c, s); } +template <> +const char* SpawnSystemKeyframeData::DNAType() { return "SpawnSystemKeyframeData"; } +template <> +const char* SpawnSystemKeyframeData::DNAType() { return "SpawnSystemKeyframeData"; } + template void SpawnSystemKeyframeData::_read(typename ReadYaml::StreamT& r) { @@ -1559,6 +1586,11 @@ AT_SUBSPECIALIZE_DNA_YAML(SpawnSystemKeyframeData) template struct SpawnSystemKeyframeData; template struct SpawnSystemKeyframeData; +template <> +const char* ChildResourceFactory::DNAType() { return "ChildResourceFactory"; } +template <> +const char* ChildResourceFactory::DNAType() { return "ChildResourceFactory"; } + template void ChildResourceFactory::_read(typename ReadYaml::StreamT& r) { diff --git a/DataSpec/SpecBase.cpp b/DataSpec/SpecBase.cpp index 8c6b60591..15d2fbebc 100644 --- a/DataSpec/SpecBase.cpp +++ b/DataSpec/SpecBase.cpp @@ -11,6 +11,7 @@ #include "hecl/ClientProcess.hpp" #include "nod/nod.hpp" #include "hecl/Blender/Connection.hpp" +#include "hecl/MultiProgressPrinter.hpp" #include @@ -103,7 +104,7 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vectorgetDataPartition(); const nod::Node& root = data->getFSTRoot(); for (const nod::Node& child : root) if (child.getKind() == nod::Node::Kind::File) child.extractToDirectory(outDir.getAbsolutePath(), ctx); - progress(_S("Trilogy Files"), _S(""), 1, 1.0); + progress.print(_S("Trilogy Files"), _S(""), 1.0); } } extractFromDisc(*m_disc, info.force, progress); @@ -492,15 +493,16 @@ void SpecBase::recursiveBuildResourceList(std::vector& listOut void SpecBase::copyBuildListData(std::vector>& fileIndex, const std::vector& buildList, const hecl::Database::DataSpecEntry* entry, - bool fast, FProgress progress, athena::io::FileWriter& pakOut) + bool fast, const hecl::MultiProgressPrinter& progress, + athena::io::FileWriter& pakOut) { fileIndex.reserve(buildList.size()); - size_t loadIdx = 0; + int loadIdx = 0; for (const auto& tag : buildList) { - fprintf(stderr, "\r %" PRISize " / %" PRISize " %.4s %08X", ++loadIdx, buildList.size(), - tag.type.getChars(), (unsigned int)tag.id.Value()); - fflush(stderr); + hecl::SystemString str = hecl::SysFormat(_S("Copying %.4") FMT_CSTR_SYS " %08X", + tag.type.getChars(), (unsigned int)tag.id.Value()); + progress.print(str.c_str(), nullptr, ++loadIdx / float(buildList.size())); fileIndex.emplace_back(); auto& thisIdx = fileIndex.back(); @@ -532,11 +534,12 @@ void SpecBase::copyBuildListData(std::vector>& pakOut.writeUByte(0xff); } } - fprintf(stderr, "\n"); + progress.startNewLine(); } void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::DataSpecEntry* entry, - bool fast, hecl::blender::Token& btok, FProgress progress, hecl::ClientProcess* cp) + bool fast, hecl::blender::Token& btok, const hecl::MultiProgressPrinter& progress, + hecl::ClientProcess* cp) { /* Prepare complete resource index */ if (!m_backgroundRunning && m_tagToPath.empty()) @@ -560,7 +563,10 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da !hecl::StrCmp(path.getLastComponent().data(), _S("!world.blend"))) /* World PAK */ { /* Force-cook MLVL and write resource list structure */ - m_project.cookPath(path, progress, false, true, fast); + m_project.cookPath(path, progress, false, true, fast, entry, cp); + if (cp) + cp->waitUntilComplete(); + progress.startNewLine(); hecl::ProjectPath cooked = getCookedPath(path, true); buildWorldPakList(path, cooked, btok, pakOut, buildList, resTableOffset); if (int64_t rem = pakOut.position() % 32) @@ -628,12 +634,9 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da addedTags.reserve(buildList.size()); Log.report(logvisor::Info, _S("Validating resources")); - size_t loadIdx = 0; + progress.setMainIndeterminate(true); for (auto& tag : buildList) { - fprintf(stderr, "\r %" PRISize " / %" PRISize " %.4s %08X", ++loadIdx, buildList.size(), - tag.type.getChars(), (unsigned int)tag.id.Value()); - fflush(stderr); if (addedTags.find(tag) != addedTags.end()) continue; addedTags.insert(tag); @@ -641,15 +644,14 @@ void SpecBase::doPackage(const hecl::ProjectPath& path, const hecl::Database::Da hecl::ProjectPath depPath = pathFromTag(tag); if (!depPath) { - fprintf(stderr, "\n"); Log.report(logvisor::Fatal, _S("Unable to resolve %.4s %08X"), tag.type.getChars(), tag.id.Value()); } - m_project.cookPath(depPath, progress, false, false, fast, cp); + m_project.cookPath(depPath, progress, false, false, fast, entry, cp); } - fprintf(stderr, "\n"); - Log.report(logvisor::Info, _S("Waiting for remaining cook transactions")); + progress.setMainIndeterminate(false); cp->waitUntilComplete(); + progress.startNewLine(); } /* Write resource data and build file index */ @@ -1205,9 +1207,12 @@ void SpecBase::backgroundIndexProc() m_pathToTag[path.hash()] = pathTag; WriteTag(cacheWriter, pathTag, path); } - fprintf(stderr, "\r %" PRISize " / %" PRISize, ++loadIdx, tagCount); + + ++loadIdx; + if (!(loadIdx % 100)) + fprintf(stderr, "\r %" PRISize " / %" PRISize, loadIdx, tagCount); } - fprintf(stderr, "\n"); + fprintf(stderr, "\r %" PRISize " / %" PRISize "\n", loadIdx, tagCount); } Log.report(logvisor::Info, _S("Cache index of '%s' loaded; %d tags"), getOriginalSpec().m_name.data(), m_tagToPath.size()); diff --git a/DataSpec/SpecBase.hpp b/DataSpec/SpecBase.hpp index fcd11f3de..bfa6bbfb7 100644 --- a/DataSpec/SpecBase.hpp +++ b/DataSpec/SpecBase.hpp @@ -28,7 +28,7 @@ struct SpecBase : hecl::Database::IDataSpec /* HECL Adaptors */ void setThreadProject(); bool canExtract(const ExtractPassInfo& info, std::vector& reps); - void doExtract(const ExtractPassInfo& info, FProgress progress); + void doExtract(const ExtractPassInfo& info, const hecl::MultiProgressPrinter& progress); bool canCook(const hecl::ProjectPath& path, hecl::blender::Token& btok); const hecl::Database::DataSpecEntry* overrideDataSpec(const hecl::ProjectPath& path, @@ -39,7 +39,8 @@ struct SpecBase : hecl::Database::IDataSpec bool canPackage(const hecl::ProjectPath& path); void doPackage(const hecl::ProjectPath& path, const hecl::Database::DataSpecEntry* entry, - bool fast, hecl::blender::Token& btok, FProgress progress, hecl::ClientProcess* cp); + bool fast, hecl::blender::Token& btok, const hecl::MultiProgressPrinter& progress, + hecl::ClientProcess* cp); /* Extract handlers */ virtual bool checkStandaloneID(const char* id) const=0; @@ -52,7 +53,7 @@ struct SpecBase : hecl::Database::IDataSpec const std::vector& args, std::vector& reps)=0; virtual bool extractFromDisc(nod::DiscBase& disc, bool force, - FProgress progress)=0; + const hecl::MultiProgressPrinter& progress)=0; /* Convert path to object tag */ virtual urde::SObjectTag buildTagFromPath(const hecl::ProjectPath& path, @@ -207,7 +208,8 @@ protected: void copyBuildListData(std::vector>& fileIndex, const std::vector& buildList, const hecl::Database::DataSpecEntry* entry, - bool fast, FProgress progress, athena::io::FileWriter& pakOut); + bool fast, const hecl::MultiProgressPrinter& progress, + athena::io::FileWriter& pakOut); private: std::unique_ptr m_disc; diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index dde4bf8b0..231b8f9e6 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -46,6 +46,7 @@ #include "DNAMP1/SnowForces.hpp" #include "hecl/ClientProcess.hpp" +#include "hecl/MultiProgressPrinter.hpp" #include "hecl/Blender/Connection.hpp" #include "nod/nod.hpp" @@ -356,7 +357,7 @@ struct SpecMP1 : SpecBase return true; } - bool extractFromDisc(nod::DiscBase& disc, bool force, FProgress progress) + bool extractFromDisc(nod::DiscBase& disc, bool force, const hecl::MultiProgressPrinter& progress) { m_project.enableDataSpecs({_S("MP1-PC")}); @@ -364,9 +365,10 @@ struct SpecMP1 : SpecBase m_workPath.makeDir(); - progress(_S("Indexing PAKs"), _S(""), 2, 0.0); - m_pakRouter.build(m_paks, [&progress](float factor) { progress(_S("Indexing PAKs"), _S(""), 2, factor); }); - progress(_S("Indexing PAKs"), _S(""), 2, 1.0); + progress.startNewLine(); + progress.print(_S("Indexing PAKs"), _S(""), 0.0); + m_pakRouter.build(m_paks, [&progress](float factor) { progress.print(_S("Indexing PAKs"), _S(""), factor); }); + progress.print(_S("Indexing PAKs"), _S(""), 1.0); hecl::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out")); outPath.makeDir(); @@ -374,24 +376,23 @@ struct SpecMP1 : SpecBase mp1OutPath.makeDir(); /* Extract non-pak files */ - progress(_S("MP1 Root"), _S(""), 3, 0.0); + progress.startNewLine(); + progress.print(_S("MP1 Root"), _S(""), 0.0); int prog = 0; ctx.progressCB = [&](std::string_view name, float) { hecl::SystemStringConv nameView(name); - progress(_S("MP1 Root"), nameView.c_str(), 3, prog / (float)m_nonPaks.size()); + progress.print(_S("MP1 Root"), nameView.c_str(), prog / (float)m_nonPaks.size()); }; for (const nod::Node* node : m_nonPaks) { node->extractToDirectory(mp1OutPath.getAbsolutePath(), ctx); prog++; } - progress(_S("MP1 Root"), _S(""), 3, 1.0); + progress.print(_S("MP1 Root"), _S(""), 1.0); /* Extract unique resources */ - std::mutex msgLock; hecl::ClientProcess process; - int compIdx = 4; - prog = 0; + progress.startNewLine(); for (std::pair& pair : m_orderedPaks) { #if 0 @@ -414,16 +415,12 @@ struct SpecMP1 : SpecBase auto name = pak.getName(); hecl::SystemStringConv sysName(name); - { - std::unique_lock lk(msgLock); - progress(sysName.c_str(), _S(""), compIdx, 0.0); - } - auto pakName = hecl::SystemString(sysName.sys_str()); - process.addLambdaTransaction([&, pakName](hecl::blender::Token& btok) { - m_pakRouter.extractResources(pak, force, btok, [&](const hecl::SystemChar* substr, float factor) { - std::unique_lock lk(msgLock); - progress(pakName.c_str(), substr, compIdx, factor); + process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) { + int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx(); + m_pakRouter.extractResources(pak, force, btok, + [&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) { + progress.print(pakName.c_str(), substr, factor, threadIdx); }); }); } diff --git a/DataSpec/SpecMP2.cpp b/DataSpec/SpecMP2.cpp index 456c3afab..228de33b3 100644 --- a/DataSpec/SpecMP2.cpp +++ b/DataSpec/SpecMP2.cpp @@ -12,6 +12,7 @@ #include "hecl/ClientProcess.hpp" #include "hecl/Blender/Connection.hpp" +#include "hecl/MultiProgressPrinter.hpp" #include "Runtime/RetroTypes.hpp" #include "nod/nod.hpp" @@ -222,40 +223,40 @@ struct SpecMP2 : SpecBase return true; } - bool extractFromDisc(nod::DiscBase&, bool force, FProgress progress) + bool extractFromDisc(nod::DiscBase&, bool force, const hecl::MultiProgressPrinter& progress) { nod::ExtractionContext ctx = {force, nullptr}; m_workPath.makeDir(); - progress(_S("Indexing PAKs"), _S(""), 2, 0.0); + progress.startNewLine(); + progress.print(_S("Indexing PAKs"), _S(""), 0.0); m_pakRouter.build(m_paks, [&progress](float factor) { - progress(_S("Indexing PAKs"), _S(""), 2, factor); + progress.print(_S("Indexing PAKs"), _S(""), factor); }); - progress(_S("Indexing PAKs"), _S(""), 2, 1.0); + progress.print(_S("Indexing PAKs"), _S(""), 1.0); hecl::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out")); outPath.makeDir(); hecl::ProjectPath mp2OutPath(outPath, _S("MP2")); mp2OutPath.makeDir(); - progress(_S("MP2 Root"), _S(""), 3, 0.0); + progress.startNewLine(); + progress.print(_S("MP2 Root"), _S(""), 0.0); int prog = 0; - ctx.progressCB = [&](std::string_view name, float) { + ctx.progressCB = [&prog, &progress](std::string_view name, float) { hecl::SystemStringConv nameView(name); - progress(_S("MP2 Root"), nameView.c_str(), 3, prog); + progress.print(_S("MP2 Root"), nameView.c_str(), prog); }; for (const nod::Node* node : m_nonPaks) { node->extractToDirectory(mp2OutPath.getAbsolutePath(), ctx); prog++; } - progress(_S("MP2 Root"), _S(""), 3, 1.0); + progress.print(_S("MP2 Root"), _S(""), 1.0); - std::mutex msgLock; hecl::ClientProcess process; - int compIdx = 4; - prog = 0; + progress.startNewLine(); for (std::pair& pair : m_orderedPaks) { DNAMP2::PAKBridge& pak = *pair.second; @@ -265,18 +266,14 @@ struct SpecMP2 : SpecBase auto name = pak.getName(); hecl::SystemStringConv sysName(name); - { - std::unique_lock lk(msgLock); - progress(sysName.c_str(), _S(""), compIdx, 0.0); - } auto pakName = hecl::SystemString(sysName.sys_str()); - process.addLambdaTransaction([&, pakName](hecl::blender::Token& btok) + process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) { + int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx(); m_pakRouter.extractResources(pak, force, btok, - [&](const hecl::SystemChar* substr, float factor) + [&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) { - std::unique_lock lk(msgLock); - progress(pakName.c_str(), substr, compIdx, factor); + progress.print(pakName.c_str(), substr, factor, threadIdx); }); }); } diff --git a/DataSpec/SpecMP3.cpp b/DataSpec/SpecMP3.cpp index 20d892753..011df6b25 100644 --- a/DataSpec/SpecMP3.cpp +++ b/DataSpec/SpecMP3.cpp @@ -11,6 +11,7 @@ #include "hecl/ClientProcess.hpp" #include "hecl/Blender/Connection.hpp" +#include "hecl/MultiProgressPrinter.hpp" #include "Runtime/RetroTypes.hpp" #include "nod/nod.hpp" @@ -351,9 +352,8 @@ struct SpecMP3 : SpecBase return doMP3 || doMPTFE; } - bool extractFromDisc(nod::DiscBase&, bool force, FProgress progress) + bool extractFromDisc(nod::DiscBase&, bool force, const hecl::MultiProgressPrinter& progress) { - int compIdx = 2; hecl::SystemString currentTarget = _S(""); size_t nodeCount = 0; int prog = 0; @@ -361,25 +361,27 @@ struct SpecMP3 : SpecBase [&](std::string_view name, float) { hecl::SystemStringConv nameView(name); - progress(currentTarget.c_str(), nameView.c_str(), compIdx, prog / (float)nodeCount); + progress.print(currentTarget.c_str(), nameView.c_str(), prog / (float)nodeCount); }}; if (doMP3) { m_workPath.makeDir(); - progress(_S("Indexing PAKs"), _S(""), compIdx, 0.0); - m_pakRouter.build(m_paks, [&progress, &compIdx](float factor) + progress.startNewLine(); + progress.print(_S("Indexing PAKs"), _S(""), 0.0); + m_pakRouter.build(m_paks, [&progress](float factor) { - progress(_S("Indexing PAKs"), _S(""), compIdx, factor); + progress.print(_S("Indexing PAKs"), _S(""), factor); }); - progress(_S("Indexing PAKs"), _S(""), compIdx++, 1.0); + progress.print(_S("Indexing PAKs"), _S(""), 1.0); + progress.startNewLine(); hecl::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out")); outPath.makeDir(); hecl::ProjectPath mp3OutPath(outPath, _S("MP3")); mp3OutPath.makeDir(); currentTarget = _S("MP3 Root"); - progress(currentTarget.c_str(), _S(""), compIdx, 0.0); + progress.print(currentTarget.c_str(), _S(""), 0.0); prog = 0; nodeCount = m_nonPaks.size(); @@ -391,11 +393,10 @@ struct SpecMP3 : SpecBase } ctx.progressCB = nullptr; - progress(currentTarget.c_str(), _S(""), compIdx++, 1.0); + progress.print(currentTarget.c_str(), _S(""), 1.0); + progress.startNewLine(); - std::mutex msgLock; hecl::ClientProcess process; - prog = 0; for (std::pair& pair : m_orderedPaks) { DNAMP3::PAKBridge& pak = *pair.second; @@ -405,18 +406,14 @@ struct SpecMP3 : SpecBase auto name = pak.getName(); hecl::SystemStringConv sysName(name); - { - std::unique_lock lk(msgLock); - progress(sysName.c_str(), _S(""), compIdx, 0.0); - } auto pakName = hecl::SystemString(sysName.sys_str()); - process.addLambdaTransaction([&, pakName](hecl::blender::Token& btok) + process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) { + int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx(); m_pakRouter.extractResources(pak, force, btok, - [&](const hecl::SystemChar* substr, float factor) + [&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) { - std::unique_lock lk(msgLock); - progress(pakName.c_str(), substr, compIdx, factor); + progress.print(pakName.c_str(), substr, factor); }); }); } @@ -428,19 +425,21 @@ struct SpecMP3 : SpecBase { m_feWorkPath.makeDir(); - progress(_S("Indexing PAKs"), _S(""), compIdx, 0.0); - m_fePakRouter.build(m_fePaks, [&progress, &compIdx](float factor) + progress.startNewLine(); + progress.print(_S("Indexing PAKs"), _S(""), 0.0); + m_fePakRouter.build(m_fePaks, [&progress](float factor) { - progress(_S("Indexing PAKs"), _S(""), compIdx, factor); + progress.print(_S("Indexing PAKs"), _S(""), factor); }); - progress(_S("Indexing PAKs"), _S(""), compIdx++, 1.0); + progress.print(_S("Indexing PAKs"), _S(""), 1.0); + progress.startNewLine(); hecl::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out")); outPath.makeDir(); hecl::ProjectPath feOutPath(outPath, _S("fe")); feOutPath.makeDir(); currentTarget = _S("fe Root"); - progress(currentTarget.c_str(), _S(""), compIdx, 0.0); + progress.print(currentTarget.c_str(), _S(""), 0.0); prog = 0; nodeCount = m_feNonPaks.size(); @@ -450,11 +449,10 @@ struct SpecMP3 : SpecBase node->extractToDirectory(feOutPath.getAbsolutePath(), ctx); prog++; } - progress(currentTarget.c_str(), _S(""), compIdx++, 1.0); + progress.print(currentTarget.c_str(), _S(""), 1.0); + progress.startNewLine(); - std::mutex msgLock; hecl::ClientProcess process; - prog = 0; for (std::pair pair : m_feOrderedPaks) { DNAMP3::PAKBridge& pak = *pair.second; @@ -464,18 +462,14 @@ struct SpecMP3 : SpecBase auto name = pak.getName(); hecl::SystemStringConv sysName(name); - { - std::unique_lock lk(msgLock); - progress(sysName.c_str(), _S(""), compIdx, 0.0); - } hecl::SystemString pakName(sysName.sys_str()); - process.addLambdaTransaction([&, pakName](hecl::blender::Token& btok) + process.addLambdaTransaction([this, &progress, &pak, pakName, force](hecl::blender::Token& btok) { + int threadIdx = hecl::ClientProcess::GetThreadWorkerIdx(); m_fePakRouter.extractResources(pak, force, btok, - [&](const hecl::SystemChar* substr, float factor) + [&progress, &pakName, threadIdx](const hecl::SystemChar* substr, float factor) { - std::unique_lock lk(msgLock); - progress(pakName.c_str(), substr, compIdx, factor); + progress.print(pakName.c_str(), substr, factor); }); }); } diff --git a/Editor/ProjectManager.cpp b/Editor/ProjectManager.cpp index ceb9cecc1..c093488e0 100644 --- a/Editor/ProjectManager.cpp +++ b/Editor/ProjectManager.cpp @@ -40,7 +40,8 @@ CToken ProjectResourcePool::GetObj(std::string_view name, const CVParamTransfer& bool ProjectManager::m_registeredSpecs = false; ProjectManager::ProjectManager(ViewManager &vm) -: m_vm(vm), m_clientProc(1), m_factoryMP1(m_clientProc), m_objStore(m_factoryMP1, *this) +: m_vm(vm), m_clientProc(nullptr, 1), + m_factoryMP1(m_clientProc), m_objStore(m_factoryMP1, *this) { if (!m_registeredSpecs) { diff --git a/Editor/ProjectResourceFactoryBase.cpp b/Editor/ProjectResourceFactoryBase.cpp index b03e45dc8..15f0b9689 100644 --- a/Editor/ProjectResourceFactoryBase.cpp +++ b/Editor/ProjectResourceFactoryBase.cpp @@ -24,7 +24,8 @@ void ProjectResourceFactoryBase::BeginBackgroundIndex bool ProjectResourceFactoryBase::SyncCook(const hecl::ProjectPath& working) { Log.report(logvisor::Warning, _S("sync-cooking %s"), working.getRelativePath().data()); - return m_clientProc.syncCook(working, m_cookSpec.get(), hecl::blender::SharedBlenderToken); + return m_clientProc.syncCook(working, m_cookSpec.get(), hecl::blender::SharedBlenderToken, + false, false); } CFactoryFnReturn ProjectResourceFactoryBase::BuildSync(const SObjectTag& tag, @@ -97,7 +98,8 @@ void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& t m_cookedPath.getModtime() < path.getModtime()) { /* Start a background cook here */ - m_cookTransaction = m_parent.m_clientProc.addCookTransaction(path, m_parent.m_cookSpec.get()); + m_cookTransaction = m_parent.m_clientProc. + addCookTransaction(path, m_parent.m_cookSpec.get(), false, false); return; } } diff --git a/Runtime/Graphics/Shaders/CDecalShaders.hpp b/Runtime/Graphics/Shaders/CDecalShaders.hpp index 9840c20cf..551e2f486 100644 --- a/Runtime/Graphics/Shaders/CDecalShaders.hpp +++ b/Runtime/Graphics/Shaders/CDecalShaders.hpp @@ -10,7 +10,7 @@ namespace urde { -class CQuadDecal; +struct CQuadDecal; class CDecalShaders { diff --git a/Runtime/Graphics/Shaders/CDecalShadersGLSL.cpp b/Runtime/Graphics/Shaders/CDecalShadersGLSL.cpp index 0bbc57090..2df96246b 100644 --- a/Runtime/Graphics/Shaders/CDecalShadersGLSL.cpp +++ b/Runtime/Graphics/Shaders/CDecalShadersGLSL.cpp @@ -183,22 +183,18 @@ TShader::IDataBindingFactory* CDecalShaders::Initialize(boo::GLDa boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_texAdditiveZTest = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, 1, TexNames, 1, UniNames, boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_texRedToAlphaZTest = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX_REDTOALPHA, 1, TexNames, 1, UniNames, boo::BlendFactor::One, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - + true, true, boo::CullMode::None); m_noTexZTestNoZWrite = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, 0, nullptr, 1, UniNames, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_noTexAdditiveZTest = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, 0, nullptr, 1, UniNames, boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, @@ -219,75 +215,44 @@ void CDecalShaders::Shutdown() } #if BOO_HAS_VULKAN -struct VulkanDecalDataBindingFactory : TShader::IDataBindingFactory +struct VulkanDecalDataBindingFactory : TShader::IDataBindingFactory { boo::ObjToken BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, - CElementGenShaders& shaders) + CDecalShaders& shaders) { - CElementGen& gen = shaders.m_gen; - CGenDescription* desc = gen.GetDesc(); + CQuadDecal& decal = shaders.m_decal; + const SQuadDescr* desc = decal.m_desc; - CUVElement* texr = desc->x54_x40_TEXR.get(); - CUVElement* tind = desc->x58_x44_TIND.get(); + CUVElement* texr = desc->x14_TEX.get(); int texCount = 0; - boo::ObjToken textures[3]; + boo::ObjToken textures[1]; if (texr) { textures[0] = texr->GetValueTexture(0).GetObj()->GetBooTexture(); texCount = 1; - if (tind) - { - textures[1] = CGraphics::g_SpareTexture.get(); - textures[2] = tind->GetValueTexture(0).GetObj()->GetBooTexture(); - texCount = 3; - } } - if (gen.m_instBuf) + if (decal.m_instBuf) { - boo::ObjToken uniforms[] = {gen.m_uniformBuf.get()}; + boo::ObjToken uniforms[] = {decal.m_uniformBuf.get()}; if (shaders.m_regPipeline) - gen.m_normalDataBind = ctx.newShaderDataBinding(shaders.m_regPipeline, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, + decal.m_normalDataBind = ctx.newShaderDataBinding(shaders.m_regPipeline, nullptr, nullptr, + decal.m_instBuf.get(), nullptr, 1, uniforms, nullptr, texCount, textures, nullptr, nullptr); - if (shaders.m_regPipelineSub) - gen.m_normalSubDataBind = ctx.newShaderDataBinding(shaders.m_regPipelineSub, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, nullptr, nullptr); if (shaders.m_redToAlphaPipeline) - gen.m_redToAlphaDataBind = ctx.newShaderDataBinding(shaders.m_redToAlphaPipeline, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, + decal.m_redToAlphaDataBind = ctx.newShaderDataBinding(shaders.m_redToAlphaPipeline, nullptr, nullptr, + decal.m_instBuf.get(), nullptr, 1, uniforms, nullptr, texCount, textures, nullptr, nullptr); - if (shaders.m_redToAlphaPipelineSub) - gen.m_redToAlphaSubDataBind = ctx.newShaderDataBinding(shaders.m_redToAlphaPipelineSub, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, nullptr, nullptr); - - } - - if (gen.m_instBufPmus) - { - boo::ObjToken uniforms[] = {gen.m_uniformBufPmus.get()}; - texCount = std::min(texCount, 1); - - if (shaders.m_regPipelinePmus) - gen.m_normalDataBindPmus = ctx.newShaderDataBinding(shaders.m_regPipelinePmus, nullptr, nullptr, - gen.m_instBufPmus.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, nullptr, nullptr); - if (shaders.m_redToAlphaPipelinePmus) - gen.m_redToAlphaDataBindPmus = ctx.newShaderDataBinding(shaders.m_redToAlphaPipelinePmus, nullptr, nullptr, - gen.m_instBufPmus.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, nullptr, nullptr); } return nullptr; } }; -TShader::IDataBindingFactory* CElementGenShaders::Initialize(boo::VulkanDataFactory::Context& ctx) +TShader::IDataBindingFactory* CDecalShaders::Initialize(boo::VulkanDataFactory::Context& ctx) { static const boo::VertexElementDescriptor TexFmtTex[] = { @@ -313,116 +278,32 @@ TShader::IDataBindingFactory* CElementGenShaders::Initialize }; m_vtxFormatNoTex = ctx.newVertexFormat(5, TexFmtNoTex); - m_texZTestZWrite = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - m_texNoZTestZWrite = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); m_texZTestNoZWrite = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_texNoZTestNoZWrite = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_texAdditiveZTest = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_texAdditiveNoZTest = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_texRedToAlphaZTest = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX_REDTOALPHA, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, + boo::BlendFactor::One, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_texRedToAlphaNoZTest = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX_REDTOALPHA, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - - m_texZTestNoZWriteSub = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_texNoZTestNoZWriteSub = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - - m_texRedToAlphaZTestSub = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX_REDTOALPHA, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_texRedToAlphaNoZTestSub = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX_REDTOALPHA, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - - m_indTexZWrite = ctx.newShaderPipeline(VS_GLSL_INDTEX, FS_GLSL_INDTEX, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - m_indTexNoZWrite = ctx.newShaderPipeline(VS_GLSL_INDTEX, FS_GLSL_INDTEX, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_indTexAdditive = ctx.newShaderPipeline(VS_GLSL_INDTEX, FS_GLSL_INDTEX, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - - m_cindTexZWrite = ctx.newShaderPipeline(VS_GLSL_INDTEX, FS_GLSL_CINDTEX, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - m_cindTexNoZWrite = ctx.newShaderPipeline(VS_GLSL_INDTEX, FS_GLSL_CINDTEX, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_cindTexAdditive = ctx.newShaderPipeline(VS_GLSL_INDTEX, FS_GLSL_CINDTEX, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - - m_noTexZTestZWrite = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - m_noTexNoZTestZWrite = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); + true, true, boo::CullMode::None); m_noTexZTestNoZWrite = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_vtxFormatNoTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_noTexNoZTestNoZWrite = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_noTexAdditiveZTest = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_vtxFormatNoTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_noTexAdditiveNoZTest = ctx.newShaderPipeline(VS_GLSL_NOTEX, FS_GLSL_NOTEX, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); return new struct VulkanDecalDataBindingFactory; } template <> -void CElementGenShaders::Shutdown() +void CDecalShaders::Shutdown() { m_vtxFormatTex.reset(); m_vtxFormatNoTex.reset(); diff --git a/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp b/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp index a954dd8fc..1fc598e3a 100644 --- a/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp +++ b/Runtime/Graphics/Shaders/CDecalShadersHLSL.cpp @@ -104,80 +104,46 @@ static const char* FS_HLSL_NOTEX = " return vtf.color;\n" "}\n"; -struct D3DElementDataBindingFactory : TShader::IDataBindingFactory +struct D3DDecalDataBindingFactory : TShader::IDataBindingFactory { boo::ObjToken BuildShaderDataBinding(boo::IGraphicsDataFactory::Context& ctx, - CElementGenShaders& shaders) + CDecalShaders& shaders) { - CElementGen& gen = shaders.m_gen; - CGenDescription* desc = gen.GetDesc(); + CQuadDecal& decal = shaders.m_decal; + const SQuadDescr* desc = decal.m_desc; - CUVElement* texr = desc->x54_x40_TEXR.get(); - CUVElement* tind = desc->x58_x44_TIND.get(); + CUVElement* texr = desc->x14_TEX.get(); int texCount = 0; - boo::ObjToken textures[3]; + boo::ObjToken textures[1]; if (texr) { textures[0] = texr->GetValueTexture(0).GetObj()->GetBooTexture(); texCount = 1; - if (tind) - { - textures[1] = CGraphics::g_SpareTexture.get(); - textures[2] = tind->GetValueTexture(0).GetObj()->GetBooTexture(); - texCount = 3; - } } - if (gen.m_instBuf) + if (decal.m_instBuf) { - boo::ObjToken uniforms[] = {gen.m_uniformBuf.get()}; + boo::ObjToken uniforms[] = {decal.m_uniformBuf.get()}; if (shaders.m_regPipeline) - gen.m_normalDataBind = ctx.newShaderDataBinding(shaders.m_regPipeline, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, + decal.m_normalDataBind = ctx.newShaderDataBinding(shaders.m_regPipeline, nullptr, nullptr, + decal.m_instBuf.get(), nullptr, 1, uniforms, nullptr, texCount, textures, nullptr, nullptr); - if (shaders.m_regPipelineSub) - gen.m_normalSubDataBind = ctx.newShaderDataBinding(shaders.m_regPipelineSub, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, - nullptr, nullptr); if (shaders.m_redToAlphaPipeline) - gen.m_redToAlphaDataBind = ctx.newShaderDataBinding(shaders.m_redToAlphaPipeline, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, + decal.m_redToAlphaDataBind = ctx.newShaderDataBinding(shaders.m_redToAlphaPipeline, nullptr, nullptr, + decal.m_instBuf.get(), nullptr, 1, uniforms, nullptr, texCount, textures, nullptr, nullptr); - if (shaders.m_redToAlphaPipelineSub) - gen.m_redToAlphaSubDataBind = ctx.newShaderDataBinding(shaders.m_redToAlphaPipelineSub, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, - nullptr, nullptr); - } - - if (gen.m_instBufPmus) - { - boo::ObjToken uniforms[] = {gen.m_uniformBufPmus.get()}; - texCount = std::min(texCount, 1); - - if (shaders.m_regPipelinePmus) - gen.m_normalDataBindPmus = ctx.newShaderDataBinding(shaders.m_regPipelinePmus, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, - nullptr, nullptr); - if (shaders.m_redToAlphaPipelinePmus) - gen.m_redToAlphaDataBindPmus = ctx.newShaderDataBinding(shaders.m_redToAlphaPipelinePmus, nullptr, nullptr, - gen.m_instBuf.get(), nullptr, 1, uniforms, - nullptr, texCount, textures, - nullptr, nullptr); } return nullptr; } }; -TShader::IDataBindingFactory* CElementGenShaders::Initialize(boo::ID3DDataFactory::Context& ctx) +TShader::IDataBindingFactory* CDecalShaders::Initialize(boo::ID3DDataFactory::Context& ctx) { static const boo::VertexElementDescriptor TexFmtTex[] = { @@ -193,21 +159,6 @@ TShader::IDataBindingFactory* CElementGenShaders::Initialize }; m_vtxFormatTex = ctx.newVertexFormat(9, TexFmtTex); - static const boo::VertexElementDescriptor TexFmtIndTex[] = - { - {nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0}, - {nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 1}, - {nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 2}, - {nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 3}, - {nullptr, nullptr, boo::VertexSemantic::Color | boo::VertexSemantic::Instanced}, - {nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 0}, - {nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 1}, - {nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 2}, - {nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 3}, - {nullptr, nullptr, boo::VertexSemantic::UV4 | boo::VertexSemantic::Instanced, 4} - }; - m_vtxFormatIndTex = ctx.newVertexFormat(10, TexFmtIndTex); - static const boo::VertexElementDescriptor TexFmtNoTex[] = { {nullptr, nullptr, boo::VertexSemantic::Position4 | boo::VertexSemantic::Instanced, 0}, @@ -218,172 +169,47 @@ TShader::IDataBindingFactory* CElementGenShaders::Initialize }; m_vtxFormatNoTex = ctx.newVertexFormat(5, TexFmtNoTex); - m_texZTestZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - m_texNoZTestZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); m_texZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, nullptr, m_vtxFormatTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_texNoZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_texAdditiveZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, nullptr, m_vtxFormatTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_texAdditiveNoZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_texRedToAlphaZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, nullptr, nullptr, nullptr, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, + boo::BlendFactor::One, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_texRedToAlphaNoZTest = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - - m_texZTestNoZWriteSub = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_texNoZTestNoZWriteSub = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - - m_texRedToAlphaZTestSub = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::LEqual, false, - true, false, boo::CullMode::None); - m_texRedToAlphaNoZTestSub = ctx.newShaderPipeline(VS_HLSL_TEX, FS_HLSL_TEX_REDTOALPHA, nullptr, nullptr, - nullptr, m_vtxFormatTex, - boo::BlendFactor::Subtract, boo::BlendFactor::Subtract, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - - m_indTexZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, nullptr, nullptr, - nullptr, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); - m_indTexNoZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, nullptr, nullptr, - nullptr, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_indTexAdditive = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_INDTEX, nullptr, nullptr, - nullptr, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); - - m_cindTexZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_CINDTEX, nullptr, nullptr, - nullptr, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); - m_cindTexNoZWrite = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_CINDTEX, nullptr, nullptr, - nullptr, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_cindTexAdditive = ctx.newShaderPipeline(VS_HLSL_INDTEX, FS_HLSL_CINDTEX, nullptr, nullptr, - nullptr, m_vtxFormatIndTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); - - m_noTexZTestZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr, - nullptr, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::LEqual, true, - true, false, boo::CullMode::None); - m_noTexNoZTestZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr, - nullptr, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); + true, true, boo::CullMode::None); m_noTexZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr, nullptr, m_vtxFormatNoTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, boo::ZTest::LEqual, false, true, false, boo::CullMode::None); - m_noTexNoZTestNoZWrite = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr, - nullptr, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, - boo::Primitive::TriStrips, boo::ZTest::None, false, - true, false, boo::CullMode::None); - m_noTexAdditiveZTest = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr, nullptr, m_vtxFormatNoTex, boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, boo::Primitive::TriStrips, boo::ZTest::LEqual, true, true, false, boo::CullMode::None); - m_noTexAdditiveNoZTest = ctx.newShaderPipeline(VS_HLSL_NOTEX, FS_HLSL_NOTEX, nullptr, nullptr, - nullptr, m_vtxFormatNoTex, - boo::BlendFactor::SrcAlpha, boo::BlendFactor::One, - boo::Primitive::TriStrips, boo::ZTest::None, true, - true, false, boo::CullMode::None); - return new struct D3DElementDataBindingFactory; + return new struct D3DDecalDataBindingFactory; } template <> -void CElementGenShaders::Shutdown() +void CDecalShaders::Shutdown() { m_vtxFormatTex.reset(); - m_vtxFormatIndTex.reset(); m_vtxFormatNoTex.reset(); - m_texZTestZWrite.reset(); - m_texNoZTestZWrite.reset(); m_texZTestNoZWrite.reset(); - m_texNoZTestNoZWrite.reset(); m_texAdditiveZTest.reset(); - m_texAdditiveNoZTest.reset(); m_texRedToAlphaZTest.reset(); - m_texRedToAlphaNoZTest.reset(); - m_texZTestNoZWriteSub.reset(); - m_texNoZTestNoZWriteSub.reset(); - m_texRedToAlphaZTestSub.reset(); - m_texRedToAlphaNoZTestSub.reset(); - m_indTexZWrite.reset(); - m_indTexNoZWrite.reset(); - m_indTexAdditive.reset(); - - m_cindTexZWrite.reset(); - m_cindTexNoZWrite.reset(); - m_cindTexAdditive.reset(); - - m_noTexZTestZWrite.reset(); - m_noTexNoZTestZWrite.reset(); m_noTexZTestNoZWrite.reset(); - m_noTexNoZTestNoZWrite.reset(); m_noTexAdditiveZTest.reset(); - m_noTexAdditiveNoZTest.reset(); } } diff --git a/amuse b/amuse index f5a0a4645..912eb7950 160000 --- a/amuse +++ b/amuse @@ -1 +1 @@ -Subproject commit f5a0a46453b32aac586d69c0c51870746ef0f9c0 +Subproject commit 912eb7950cc93d984d2c29149c29775de3a0e234 diff --git a/hecl b/hecl index 81d489a71..1c7c56bc4 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 81d489a710893bee49e75447e92dd962b2849a0f +Subproject commit 1c7c56bc4405db1398a2246e010966e6fe7bde34 diff --git a/hecl-gui b/hecl-gui index 354e9d5cc..450914810 160000 --- a/hecl-gui +++ b/hecl-gui @@ -1 +1 @@ -Subproject commit 354e9d5cca416bfc0cbc3431945ce4d32049894c +Subproject commit 450914810a148082ad8ee4dbf6b289b3b8042ff0