Trying to fix invalid descriptorlayout

This commit is contained in:
Dynamitos
2020-10-03 11:00:10 +02:00
parent 79388bf41a
commit ceee96b462
69 changed files with 1087 additions and 393 deletions
+27 -3
View File
@@ -81,7 +81,7 @@ struct VertexStreamComponent
class VertexInputType
{
public:
static List<VertexInputType*> getTypeList();
static List<VertexInputType*>& getTypeList();
static VertexInputType* getVertexInputByName(const std::string& name);
VertexInputType(
@@ -117,6 +117,7 @@ class VertexShaderInput
public:
VertexShaderInput(std::string name);
virtual ~VertexShaderInput();
virtual void init(Gfx::PGraphics graphics) {};
void getStreams(VertexInputStreamArray& outVertexStreams) const;
void getPositionOnlyStream(VertexInputStreamArray& outVertexStreams) const;
virtual bool supportsTesselation() { return false; }
@@ -125,11 +126,34 @@ public:
Gfx::PVertexDeclaration getPositionDeclaration() const {return positionDeclaration;}
std::string getName() const { return name; }
protected:
Gfx::VertexElement accessStreamComponent(const VertexStreamComponent& component, uint8 attributeIndex);
Gfx::VertexElement accessPositionStreamComponent(const VertexStreamComponent& component, uint8 attributeIndex);
void initDeclaration(Gfx::PGraphics graphics, Array<Gfx::VertexElement>& elements);
void initPositionDeclaration(Gfx::PGraphics graphics, const Array<Gfx::VertexElement>& elements);
static List<PVertexShaderInput> registeredInputs;
static std::mutex registeredInputsLock;
Array<Gfx::VertexAttribute> layout;
StaticArray<VertexInputStream, 16> streams;
StaticArray<VertexInputStream, 16> positionStreams;
// internal helper class, basically a VertexInputStream plus stride
struct VertexStream
{
Gfx::PVertexBuffer vertexBuffer = nullptr;
uint8 stride = 0;
uint8 offset = 0;
friend bool operator==(const VertexStream& a, const VertexStream& b)
{
return a.vertexBuffer == b.vertexBuffer &&
a.stride == b.stride &&
a.offset == b.offset;
}
VertexStream()
{
}
};
Array<VertexStream> streams;
Array<VertexStream> positionStreams;
Gfx::PVertexDeclaration declaration;
Gfx::PVertexDeclaration positionDeclaration;
std::string name;