Commit 75efa7bb by Chris Forbes

Remove unused parts of Stream interface

Bug: b/125909515 Change-Id: Ifc6c04959e1741d470b133b6bbe05670a7151a0f Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34848Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 0c1adcca
......@@ -85,12 +85,6 @@ namespace sw
void Context::init()
{
// Set vertex streams to null stream
for(int i = 0; i < MAX_INTERFACE_COMPONENTS/4; i++)
{
input[i].defaults();
}
for(int i = 0; i < RENDERTARGETS; ++i)
{
renderTarget[i] = nullptr;
......
......@@ -36,67 +36,16 @@ namespace sw
STREAMTYPE_LAST = STREAMTYPE_2_10_10_10_UINT
};
struct StreamResource
struct Stream
{
const void *buffer;
unsigned int vertexStride;
unsigned int instanceStride;
};
struct Stream : public StreamResource
{
Stream(const void *buffer = nullptr, unsigned int vertexStride = 0)
{
this->buffer = buffer;
this->vertexStride = vertexStride;
this->instanceStride = 0;
}
Stream &define(StreamType type, unsigned char count, bool normalized = false)
{
this->type = type;
this->count = count;
this->normalized = normalized;
return *this;
}
Stream &define(const void *buffer, StreamType type, unsigned char count, bool normalized = false)
{
this->buffer = buffer;
this->type = type;
this->count = count;
this->normalized = normalized;
return *this;
}
Stream &defaults()
{
static const float4 null = {0, 0, 0, 1};
buffer = &null;
vertexStride = 0;
instanceStride = 0;
type = STREAMTYPE_FLOAT;
count = 0;
normalized = false;
offset = 0;
binding = 0;
return *this;
}
operator bool() const // Returns true if stream contains data
{
return count != 0;
}
StreamType type;
unsigned char count;
bool normalized;
unsigned int offset;
unsigned int binding;
const void *buffer = nullptr;
unsigned int vertexStride = 0;
unsigned int instanceStride = 0;
StreamType type = STREAMTYPE_FLOAT;
unsigned char count = 0;
bool normalized = false;
unsigned int offset = 0;
unsigned int binding = 0;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment