3700 FPS here we go
This commit is contained in:
@@ -111,6 +111,7 @@ void Material::compile()
|
||||
{
|
||||
p->data = AssetRegistry::findTexture(""); // this will return placeholder texture
|
||||
}
|
||||
assert(p->data != nullptr);
|
||||
parameters.add(p);
|
||||
}
|
||||
else if(type.compare("SamplerState") == 0)
|
||||
@@ -137,8 +138,6 @@ void Material::compile()
|
||||
uniformBuffer = WindowManager::getGraphics()->createUniformBuffer(uniformInitializer);
|
||||
}
|
||||
layout->create();
|
||||
descriptorSet = layout->allocatedDescriptorSet();
|
||||
updateDescriptorData();
|
||||
BRDF* brdf = BRDF::getBRDFByName(profile);
|
||||
brdf->generateMaterialCode(codeStream, j["code"]);
|
||||
codeStream << "};";
|
||||
|
||||
@@ -27,7 +27,6 @@ private:
|
||||
static std::mutex shaderMapLock;
|
||||
|
||||
std::string materialName;
|
||||
Gfx::PDescriptorLayout layout;
|
||||
friend class MaterialLoader;
|
||||
friend class MaterialInstance;
|
||||
};
|
||||
|
||||
@@ -31,6 +31,8 @@ void MaterialAsset::endFrame()
|
||||
|
||||
void MaterialAsset::updateDescriptorData()
|
||||
{
|
||||
layout->reset();
|
||||
descriptorSet = layout->allocatedDescriptorSet();
|
||||
BulkResourceData uniformUpdate;
|
||||
uniformUpdate.size = uniformDataSize;
|
||||
uniformUpdate.data = uniformData;
|
||||
|
||||
@@ -24,11 +24,14 @@ public:
|
||||
|
||||
// This needs to be called while the descriptorset is unused
|
||||
void updateDescriptorData();
|
||||
void resetDescriptorSet();
|
||||
const Gfx::PDescriptorSet getDescriptor() const;
|
||||
|
||||
protected:
|
||||
//For now its simply the collection of parameters, since there is no point for expressions
|
||||
Array<PShaderParameter> parameters;
|
||||
Gfx::PDescriptorSet descriptorSet;
|
||||
Gfx::PDescriptorLayout layout;
|
||||
Gfx::PUniformBuffer uniformBuffer;
|
||||
uint32 uniformDataSize;
|
||||
uint8* uniformData;
|
||||
|
||||
@@ -34,7 +34,6 @@ void MaterialInstance::load()
|
||||
uniformInitializer.resourceData.size = baseMaterial->uniformDataSize;
|
||||
uniformInitializer.resourceData.data = nullptr;
|
||||
uniformBuffer = WindowManager::getGraphics()->createUniformBuffer(uniformInitializer);
|
||||
descriptorSet = baseMaterial->layout->allocatedDescriptorSet();
|
||||
}
|
||||
|
||||
const Material* MaterialInstance::getRenderMaterial() const
|
||||
|
||||
Reference in New Issue
Block a user