Various windows fixes and additions

This commit is contained in:
Jack Andersen 2018-03-23 11:56:17 -10:00
parent 7100ed437f
commit 7c0bf75f7a
15 changed files with 171 additions and 432 deletions

View File

@ -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")

View File

@ -1223,6 +1223,11 @@ void EESimpleEmitterTR::Enumerate<BigDNA::Write>(typename Write::StreamT& w)
velocity.write(w);
}
template <>
const char* UVEConstant<UniqueID32>::DNAType() { return "UVEConstant<UniqueID32>"; }
template <>
const char* UVEConstant<UniqueID64>::DNAType() { return "UVEConstant<UniqueID64>"; }
template <class IDType>
void UVEConstant<IDType>::_read(typename ReadYaml::StreamT& r)
{
@ -1264,6 +1269,11 @@ AT_SUBSPECIALIZE_DNA_YAML(UVEConstant<UniqueID64>)
template struct UVEConstant<UniqueID32>;
template struct UVEConstant<UniqueID64>;
template <>
const char* UVEAnimTexture<UniqueID32>::DNAType() { return "UVEAnimTexture<UniqueID32>"; }
template <>
const char* UVEAnimTexture<UniqueID64>::DNAType() { return "UVEAnimTexture<UniqueID64>"; }
template <class IDType>
void UVEAnimTexture<IDType>::_read(typename ReadYaml::StreamT& r)
{
@ -1348,6 +1358,11 @@ AT_SUBSPECIALIZE_DNA_YAML(UVEAnimTexture<UniqueID64>)
template struct UVEAnimTexture<UniqueID32>;
template struct UVEAnimTexture<UniqueID64>;
template <>
const char* UVElementFactory<UniqueID32>::DNAType() { return "UVElementFactory<UniqueID32>"; }
template <>
const char* UVElementFactory<UniqueID64>::DNAType() { return "UVElementFactory<UniqueID64>"; }
template <class IDType>
void UVElementFactory<IDType>::_read(typename Read::StreamT& r)
{
@ -1415,6 +1430,13 @@ AT_SUBSPECIALIZE_DNA_YAML(UVElementFactory<UniqueID64>)
template struct UVElementFactory<UniqueID32>;
template struct UVElementFactory<UniqueID64>;
template <>
const char* SpawnSystemKeyframeData<UniqueID32>::SpawnSystemKeyframeInfo::DNAType()
{ return "SpawnSystemKeyframeData<UniqueID32>::SpawnSystemKeyframeInfo"; }
template <>
const char* SpawnSystemKeyframeData<UniqueID64>::SpawnSystemKeyframeInfo::DNAType()
{ return "SpawnSystemKeyframeData<UniqueID64>::SpawnSystemKeyframeInfo"; }
template <class IDType>
template <class Op>
void SpawnSystemKeyframeData<IDType>::SpawnSystemKeyframeInfo::Enumerate(typename Op::StreamT& s)
@ -1425,6 +1447,11 @@ void SpawnSystemKeyframeData<IDType>::SpawnSystemKeyframeInfo::Enumerate(typenam
Do<Op>({"c"}, c, s);
}
template <>
const char* SpawnSystemKeyframeData<UniqueID32>::DNAType() { return "SpawnSystemKeyframeData<UniqueID32>"; }
template <>
const char* SpawnSystemKeyframeData<UniqueID64>::DNAType() { return "SpawnSystemKeyframeData<UniqueID64>"; }
template <class IDType>
void SpawnSystemKeyframeData<IDType>::_read(typename ReadYaml::StreamT& r)
{
@ -1559,6 +1586,11 @@ AT_SUBSPECIALIZE_DNA_YAML(SpawnSystemKeyframeData<UniqueID64>)
template struct SpawnSystemKeyframeData<UniqueID32>;
template struct SpawnSystemKeyframeData<UniqueID64>;
template <>
const char* ChildResourceFactory<UniqueID32>::DNAType() { return "ChildResourceFactory<UniqueID32>"; }
template <>
const char* ChildResourceFactory<UniqueID64>::DNAType() { return "ChildResourceFactory<UniqueID64>"; }
template <class IDType>
void ChildResourceFactory<IDType>::_read(typename ReadYaml::StreamT& r)
{

View File

@ -11,6 +11,7 @@
#include "hecl/ClientProcess.hpp"
#include "nod/nod.hpp"
#include "hecl/Blender/Connection.hpp"
#include "hecl/MultiProgressPrinter.hpp"
#include <png.h>
@ -103,7 +104,7 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector<ExtractReport
return checkFromTrilogyDisc(*m_disc, *regstr, info.extractArgs, reps);
}
void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress)
void SpecBase::doExtract(const ExtractPassInfo& info, const hecl::MultiProgressPrinter& progress)
{
DataSpec::g_curSpec.reset(this);
if (!Blender::BuildMasterShader(m_masterShader))
@ -117,13 +118,13 @@ void SpecBase::doExtract(const ExtractPassInfo& info, FProgress progress)
if (!m_standalone)
{
progress(_S("Trilogy Files"), _S(""), 1, 0.0);
progress.print(_S("Trilogy Files"), _S(""), 0.0);
nod::IPartition* data = m_disc->getDataPartition();
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<urde::SObjectTag>& listOut
void SpecBase::copyBuildListData(std::vector<std::tuple<size_t, size_t, bool>>& fileIndex,
const std::vector<urde::SObjectTag>& 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<std::tuple<size_t, size_t, bool>>&
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());

View File

@ -28,7 +28,7 @@ struct SpecBase : hecl::Database::IDataSpec
/* HECL Adaptors */
void setThreadProject();
bool canExtract(const ExtractPassInfo& info, std::vector<ExtractReport>& 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<hecl::SystemString>& args,
std::vector<ExtractReport>& 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<std::tuple<size_t, size_t, bool>>& fileIndex,
const std::vector<urde::SObjectTag>& 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<nod::DiscBase> m_disc;

View File

@ -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<const std::string, DNAMP1::PAKBridge*>& pair : m_orderedPaks)
{
#if 0
@ -414,16 +415,12 @@ struct SpecMP1 : SpecBase
auto name = pak.getName();
hecl::SystemStringConv sysName(name);
{
std::unique_lock<std::mutex> 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<std::mutex> 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);
});
});
}

View File

@ -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<const std::string, DNAMP2::PAKBridge*>& 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<std::mutex> 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<std::mutex> lk(msgLock);
progress(pakName.c_str(), substr, compIdx, factor);
progress.print(pakName.c_str(), substr, factor, threadIdx);
});
});
}

View File

@ -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<const std::string, DNAMP3::PAKBridge*>& 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<std::mutex> 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<std::mutex> 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<std::string, DNAMP3::PAKBridge*> 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<std::mutex> 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<std::mutex> lk(msgLock);
progress(pakName.c_str(), substr, compIdx, factor);
progress.print(pakName.c_str(), substr, factor);
});
});
}

View File

@ -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)
{

View File

@ -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;
}
}

View File

@ -10,7 +10,7 @@
namespace urde
{
class CQuadDecal;
struct CQuadDecal;
class CDecalShaders
{

View File

@ -183,22 +183,18 @@ TShader<CDecalShaders>::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<boo::GLDataFactory>()
}
#if BOO_HAS_VULKAN
struct VulkanDecalDataBindingFactory : TShader<CElementGenShaders>::IDataBindingFactory
struct VulkanDecalDataBindingFactory : TShader<CDecalShaders>::IDataBindingFactory
{
boo::ObjToken<boo::IShaderDataBinding>
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<boo::ITexture> textures[3];
boo::ObjToken<boo::ITexture> 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<boo::IGraphicsBuffer> uniforms[] = {gen.m_uniformBuf.get()};
boo::ObjToken<boo::IGraphicsBuffer> 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<boo::IGraphicsBuffer> 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<CElementGenShaders>::IDataBindingFactory* CElementGenShaders::Initialize(boo::VulkanDataFactory::Context& ctx)
TShader<CDecalShaders>::IDataBindingFactory* CDecalShaders::Initialize(boo::VulkanDataFactory::Context& ctx)
{
static const boo::VertexElementDescriptor TexFmtTex[] =
{
@ -313,116 +278,32 @@ TShader<CElementGenShaders>::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<boo::VulkanDataFactory>()
void CDecalShaders::Shutdown<boo::VulkanDataFactory>()
{
m_vtxFormatTex.reset();
m_vtxFormatNoTex.reset();

View File

@ -104,80 +104,46 @@ static const char* FS_HLSL_NOTEX =
" return vtf.color;\n"
"}\n";
struct D3DElementDataBindingFactory : TShader<CElementGenShaders>::IDataBindingFactory
struct D3DDecalDataBindingFactory : TShader<CDecalShaders>::IDataBindingFactory
{
boo::ObjToken<boo::IShaderDataBinding>
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<boo::ITexture> textures[3];
boo::ObjToken<boo::ITexture> 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<boo::IGraphicsBuffer> uniforms[] = {gen.m_uniformBuf.get()};
boo::ObjToken<boo::IGraphicsBuffer> 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<boo::IGraphicsBuffer> 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<CElementGenShaders>::IDataBindingFactory* CElementGenShaders::Initialize(boo::ID3DDataFactory::Context& ctx)
TShader<CDecalShaders>::IDataBindingFactory* CDecalShaders::Initialize(boo::ID3DDataFactory::Context& ctx)
{
static const boo::VertexElementDescriptor TexFmtTex[] =
{
@ -193,21 +159,6 @@ TShader<CElementGenShaders>::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<CElementGenShaders>::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<boo::ID3DDataFactory>()
void CDecalShaders::Shutdown<boo::ID3DDataFactory>()
{
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();
}
}

2
amuse

@ -1 +1 @@
Subproject commit f5a0a46453b32aac586d69c0c51870746ef0f9c0
Subproject commit 912eb7950cc93d984d2c29149c29775de3a0e234

2
hecl

@ -1 +1 @@
Subproject commit 81d489a710893bee49e75447e92dd962b2849a0f
Subproject commit 1c7c56bc4405db1398a2246e010966e6fe7bde34

@ -1 +1 @@
Subproject commit 354e9d5cca416bfc0cbc3431945ce4d32049894c
Subproject commit 450914810a148082ad8ee4dbf6b289b3b8042ff0