Commit 829e89ef by Jamie Madill

Add a default constructor to sh::ShaderVariable.

This cleans up a few repeated lines of code in shadervars.h. BUG=angle:466 Change-Id: Ie77130e8420d28df790bf9bc036d52fd053b3ce9 Reviewed-on: https://chromium-review.googlesource.com/206827Reviewed-by: 's avatarNicolas Capens <capn@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org>
parent d5512cd4
......@@ -37,6 +37,13 @@ enum BlockLayoutType
// Base class for all variables defined in shaders, including Varyings, Uniforms, etc
struct ShaderVariable
{
ShaderVariable()
: type(0),
precision(0),
arraySize(0),
staticUse(false)
{}
ShaderVariable(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn)
: type(typeIn),
precision(precisionIn),
......@@ -60,8 +67,7 @@ struct ShaderVariable
struct Uniform : public ShaderVariable
{
Uniform()
: ShaderVariable(0, 0, "", 0),
registerIndex(-1),
: registerIndex(-1),
elementIndex(-1)
{}
......@@ -84,8 +90,7 @@ struct Uniform : public ShaderVariable
struct Attribute : public ShaderVariable
{
Attribute()
: ShaderVariable(0, 0, "", 0),
location(-1)
: location(-1)
{}
Attribute(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn, int locationIn)
......@@ -99,8 +104,7 @@ struct Attribute : public ShaderVariable
struct InterfaceBlockField : public ShaderVariable
{
InterfaceBlockField()
: ShaderVariable(0, 0, "", 0),
isRowMajorMatrix(false)
: isRowMajorMatrix(false)
{}
InterfaceBlockField(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn, bool isRowMajorMatrix)
......@@ -117,8 +121,7 @@ struct InterfaceBlockField : public ShaderVariable
struct Varying : public ShaderVariable
{
Varying()
: ShaderVariable(0, 0, "", 0),
interpolation(INTERPOLATION_SMOOTH)
: interpolation(INTERPOLATION_SMOOTH)
{}
Varying(GLenum typeIn, GLenum precisionIn, const char *nameIn, unsigned int arraySizeIn, InterpolationType interpolationIn)
......
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