Fixing more stuff so i can import the car as well
This commit is contained in:
@@ -47,7 +47,7 @@ void taskMain(
|
|||||||
{
|
{
|
||||||
uint m = mesh.meshletOffset + i;
|
uint m = mesh.meshletOffset + i;
|
||||||
MeshletDescription meshlet = pScene.meshletInfos[m];
|
MeshletDescription meshlet = pScene.meshletInfos[m];
|
||||||
//if(meshlet.bounding.insideFrustum(localToView, viewFrustum))
|
if(meshlet.bounding.insideFrustum(localToView, viewFrustum))
|
||||||
{
|
{
|
||||||
uint index;
|
uint index;
|
||||||
InterlockedAdd(head, 1, index);
|
InterlockedAdd(head, 1, index);
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ void MeshLoader::loadMaterials(const aiScene* scene, const Map<std::string, PTex
|
|||||||
std::string materialName = fmt::format("M{0}{1}{2}", baseName, material->GetName().C_Str(), i);
|
std::string materialName = fmt::format("M{0}{1}{2}", baseName, material->GetName().C_Str(), i);
|
||||||
materialName.erase(std::remove(materialName.begin(), materialName.end(), '.'), materialName.end()); // dots break adding the .asset extension later
|
materialName.erase(std::remove(materialName.begin(), materialName.end(), '.'), materialName.end()); // dots break adding the .asset extension later
|
||||||
materialName.erase(std::remove(materialName.begin(), materialName.end(), '-'), materialName.end()); // dots break adding the .asset extension later
|
materialName.erase(std::remove(materialName.begin(), materialName.end(), '-'), materialName.end()); // dots break adding the .asset extension later
|
||||||
|
materialName.erase(std::remove(materialName.begin(), materialName.end(), ' '), materialName.end()); // dots break adding the .asset extension later
|
||||||
|
materialName.erase(std::remove(materialName.begin(), materialName.end(), '('), materialName.end()); // dots break adding the .asset extension later
|
||||||
|
materialName.erase(std::remove(materialName.begin(), materialName.end(), ')'), materialName.end()); // dots break adding the .asset extension later
|
||||||
Gfx::ODescriptorLayout materialLayout = graphics->createDescriptorLayout("pMaterial");
|
Gfx::ODescriptorLayout materialLayout = graphics->createDescriptorLayout("pMaterial");
|
||||||
Array<OShaderExpression> expressions;
|
Array<OShaderExpression> expressions;
|
||||||
Array<std::string> parameters;
|
Array<std::string> parameters;
|
||||||
@@ -161,6 +164,14 @@ void MeshLoader::loadMaterials(const aiScene* scene, const Map<std::string, PTex
|
|||||||
});
|
});
|
||||||
texture = AssetRegistry::findTexture(importPath, texFilename.stem().string());
|
texture = AssetRegistry::findTexture(importPath, texFilename.stem().string());
|
||||||
}
|
}
|
||||||
|
else if (std::filesystem::exists(meshDirectory / texFilename))
|
||||||
|
{
|
||||||
|
AssetImporter::importTexture(TextureImportArgs{
|
||||||
|
.filePath = meshDirectory / texFilename,
|
||||||
|
.importPath = importPath,
|
||||||
|
});
|
||||||
|
texture = AssetRegistry::findTexture(importPath, texFilename.stem().string());
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "couldnt find " << texPath.C_Str() << std::endl;
|
std::cout << "couldnt find " << texPath.C_Str() << std::endl;
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ int main() {
|
|||||||
.filePath = sourcePath / "import/models/after-the-rain-vr-sound/source/Whitechapel.fbx",
|
.filePath = sourcePath / "import/models/after-the-rain-vr-sound/source/Whitechapel.fbx",
|
||||||
.importPath = "Whitechapel"
|
.importPath = "Whitechapel"
|
||||||
});
|
});
|
||||||
|
AssetImporter::importMesh(MeshImportArgs{
|
||||||
|
.filePath = sourcePath / "import/models/Volvo S90/Volvo S90.fbx",
|
||||||
|
.importPath = "Volvo",
|
||||||
|
});
|
||||||
WindowCreateInfo mainWindowInfo;
|
WindowCreateInfo mainWindowInfo;
|
||||||
mainWindowInfo.title = "SeeleEngine";
|
mainWindowInfo.title = "SeeleEngine";
|
||||||
mainWindowInfo.width = 1920;
|
mainWindowInfo.width = 1920;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ static Map<Vulkan::Buffer*, PendingBuffer> pendingBuffers;
|
|||||||
|
|
||||||
Buffer::Buffer(PGraphics graphics, uint64 size, VkBufferUsageFlags usage, Gfx::QueueType& queueType, bool dynamic,
|
Buffer::Buffer(PGraphics graphics, uint64 size, VkBufferUsageFlags usage, Gfx::QueueType& queueType, bool dynamic,
|
||||||
std::string name)
|
std::string name)
|
||||||
: graphics(graphics), currentBuffer(0), size(size), owner(queueType), usage(usage), name(name) {
|
: graphics(graphics), currentBuffer(0), size(size), owner(queueType), usage(usage | VK_BUFFER_USAGE_TRANSFER_DST_BIT), name(name) {
|
||||||
createBuffer();
|
createBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ PipelineLayout::PipelineLayout(PGraphics graphics, const std::string& name, Gfx:
|
|||||||
|
|
||||||
PipelineLayout::~PipelineLayout() {}
|
PipelineLayout::~PipelineLayout() {}
|
||||||
|
|
||||||
|
std::mutex layoutLock;
|
||||||
Map<uint32, VkPipelineLayout> cachedLayouts;
|
Map<uint32, VkPipelineLayout> cachedLayouts;
|
||||||
|
|
||||||
void PipelineLayout::create() {
|
void PipelineLayout::create() {
|
||||||
@@ -357,6 +358,7 @@ void PipelineLayout::create() {
|
|||||||
layoutHash = CRC::Calculate(createInfo.pSetLayouts, sizeof(VkDescriptorSetLayout) * createInfo.setLayoutCount,
|
layoutHash = CRC::Calculate(createInfo.pSetLayouts, sizeof(VkDescriptorSetLayout) * createInfo.setLayoutCount,
|
||||||
CRC::CRC_32(), layoutHash);
|
CRC::CRC_32(), layoutHash);
|
||||||
|
|
||||||
|
std::unique_lock l(layoutLock);
|
||||||
if (cachedLayouts.contains(layoutHash)) {
|
if (cachedLayouts.contains(layoutHash)) {
|
||||||
layoutHandle = cachedLayouts[layoutHash];
|
layoutHandle = cachedLayouts[layoutHash];
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user