Some changes
This commit is contained in:
@@ -157,8 +157,7 @@ void BasePass::render() {
|
||||
vertexData->getInstanceDataSet()->updateBuffer(VertexData::CULLINGDATA_NAME, 0, cullingBuffer);
|
||||
vertexData->getInstanceDataSet()->writeChanges();
|
||||
permutation.setVertexData(vertexData->getTypeName());
|
||||
const auto& materials = vertexData->getMaterialData();
|
||||
for (const auto& materialData : materials) {
|
||||
for (const auto& materialData : vertexData->getMaterialData()) {
|
||||
// material not used for any active meshes, skip
|
||||
if (materialData.instances.size() == 0)
|
||||
continue;
|
||||
|
||||
@@ -139,11 +139,9 @@ void Seele::beginCompilation(const ShaderCompilationInfo& info, SlangCompileTarg
|
||||
|
||||
slang::ProgramLayout* signature = specializedComponent->getLayout(0, diagnostics.writeRef());
|
||||
CHECK_DIAGNOSTICS();
|
||||
//std::cout << info.name << std::endl;
|
||||
for (uint32 i = 0; i < signature->getParameterCount(); ++i) {
|
||||
auto param = signature->getParameterByIndex(i);
|
||||
layout->addMapping(param->getName(), param->getBindingIndex());
|
||||
//std::cout << param->getName() << ": " << param->getBindingIndex() << std::endl;
|
||||
}
|
||||
|
||||
// workaround
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "Math/Math.h"
|
||||
#include "MinimalEngine.h"
|
||||
|
||||
|
||||
namespace Seele {
|
||||
enum class ExpressionType {
|
||||
UNKNOWN,
|
||||
@@ -184,6 +183,9 @@ struct SwizzleExpression : public ShaderExpression {
|
||||
StaticArray<int32, 4> comp = {-1, -1, -1, -1};
|
||||
SwizzleExpression() {}
|
||||
SwizzleExpression(StaticArray<int32, 4> comp) : comp(std::move(comp)) {}
|
||||
SwizzleExpression(std::string key, std::string target, StaticArray<int32, 4> comp) : ShaderExpression(key) {
|
||||
inputs["target"].source = target;
|
||||
}
|
||||
virtual ~SwizzleExpression() {}
|
||||
virtual uint64 getIdentifier() const override { return IDENTIFIER; }
|
||||
virtual std::string evaluate(Map<std::string, std::string>& varState) const override;
|
||||
@@ -194,6 +196,11 @@ DEFINE_REF(SwizzleExpression)
|
||||
struct SampleExpression : public ShaderExpression {
|
||||
static constexpr uint64 IDENTIFIER = 0x16;
|
||||
SampleExpression() {}
|
||||
SampleExpression(std::string key, std::string texture, std::string sampler, std::string texCoords) : ShaderExpression(key) {
|
||||
inputs["texture"].source = texture;
|
||||
inputs["sampler"].source = sampler;
|
||||
inputs["texCoords"].source = texCoords;
|
||||
}
|
||||
virtual ~SampleExpression() {}
|
||||
virtual uint64 getIdentifier() const override { return IDENTIFIER; }
|
||||
virtual std::string evaluate(Map<std::string, std::string>& varState) const override;
|
||||
@@ -205,8 +212,6 @@ DEFINE_REF(SampleExpression)
|
||||
struct MaterialNode {
|
||||
std::string profile;
|
||||
Map<std::string, std::string> variables;
|
||||
MaterialNode() {}
|
||||
~MaterialNode() {}
|
||||
void save(ArchiveBuffer& buffer) const;
|
||||
void load(ArchiveBuffer& buffer);
|
||||
};
|
||||
|
||||
@@ -9,7 +9,8 @@ MeshUpdater::MeshUpdater(PScene scene) : ComponentSystem<Component::Transform, C
|
||||
|
||||
MeshUpdater::~MeshUpdater() {}
|
||||
|
||||
void MeshUpdater::update(entt::entity, Component::Transform& transform, Component::Mesh& comp) {
|
||||
void MeshUpdater::update(entt::entity id, Component::Transform& transform, Component::Mesh& comp) {
|
||||
scene->accessComponent<Component::Camera>(id);
|
||||
if (comp.meshletOffsets.empty()) {
|
||||
for (uint32 i = 0; i < comp.asset->meshes.size(); ++i) {
|
||||
comp.meshletOffsets.add(comp.asset->meshes[i]->vertexData->addCullingMapping(comp.asset->meshes[i]->id));
|
||||
|
||||
Reference in New Issue
Block a user