There's no good reason to keep this code here; it's not like it saves us
a lot of logic, and it's unused apart from inside the glsl main.
This has the benefit of keeping struf a bit simpler; less mechanisms
needs to know about each other. Since I plan on adding more
functionality to strbuf, this will make things a lot easier.
Sadly, we don't have an easy way of doing unit-tests for the
vrend_shader internals. So for now I'm just dropping the tests here.
It's not ideal, I know, but yeah... Sorry? :P
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
This adds a string buffer implementation + unit tests with
the following features:
- growing reallocation on append
- variadic printf-like append function
- indenting
- error state tracking (stop appending on errors)
This will be used in the GLSL shader construction to clean up
the bad string length issues we have now.
The variadic append is based on one Erik Faye-Lund wrote.
v1.1: improve indenting
v1.2: fix includes + use memcpy
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>