Commit f00f7ffe by Jamie Madill Committed by Commit Bot

Add a Uniform type info table.

Currently most uniform type info is determined by switching on the uniform type. Some values are computed from other values, which can result in three or more switch statements plus some multiplies or other math. This patch attempts to improve the speed by pre computing necessary values into constant static tables. Improves performance by about 7% in a uniform stress test. BUG=angleproject:1390 Change-Id: I29bef259a17f6d6536171ade4950e2d712bfd39c Reviewed-on: https://chromium-review.googlesource.com/643791Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent bb6e6643
...@@ -248,7 +248,6 @@ std::string ToString(const T &value) ...@@ -248,7 +248,6 @@ std::string ToString(const T &value)
#define GL_BGRA4_ANGLEX 0x6ABC #define GL_BGRA4_ANGLEX 0x6ABC
#define GL_BGR5_A1_ANGLEX 0x6ABD #define GL_BGR5_A1_ANGLEX 0x6ABD
#define GL_INT_64_ANGLEX 0x6ABE #define GL_INT_64_ANGLEX 0x6ABE
#define GL_STRUCT_ANGLEX 0x6ABF
// Hidden enum for the NULL D3D device type. // Hidden enum for the NULL D3D device type.
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x6AC0 #define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x6AC0
......
#!/usr/bin/python
# Copyright 2017 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# gen_uniform_type_table.py:
# Code generation for OpenGL uniform type info tables.
from datetime import date
import sys
all_uniform_types = [
"GL_NONE",
"GL_BOOL",
"GL_BOOL_VEC2",
"GL_BOOL_VEC3",
"GL_BOOL_VEC4",
"GL_FLOAT",
"GL_FLOAT_MAT2",
"GL_FLOAT_MAT2x3",
"GL_FLOAT_MAT2x4",
"GL_FLOAT_MAT3",
"GL_FLOAT_MAT3x2",
"GL_FLOAT_MAT3x4",
"GL_FLOAT_MAT4",
"GL_FLOAT_MAT4x2",
"GL_FLOAT_MAT4x3",
"GL_FLOAT_VEC2",
"GL_FLOAT_VEC3",
"GL_FLOAT_VEC4",
"GL_IMAGE_2D",
"GL_IMAGE_2D_ARRAY",
"GL_IMAGE_3D",
"GL_IMAGE_CUBE",
"GL_INT",
"GL_INT_IMAGE_2D",
"GL_INT_IMAGE_2D_ARRAY",
"GL_INT_IMAGE_3D",
"GL_INT_IMAGE_CUBE",
"GL_INT_SAMPLER_2D",
"GL_INT_SAMPLER_2D_ARRAY",
"GL_INT_SAMPLER_2D_MULTISAMPLE",
"GL_INT_SAMPLER_3D",
"GL_INT_SAMPLER_CUBE",
"GL_INT_VEC2",
"GL_INT_VEC3",
"GL_INT_VEC4",
"GL_SAMPLER_2D",
"GL_SAMPLER_2D_ARRAY",
"GL_SAMPLER_2D_ARRAY_SHADOW",
"GL_SAMPLER_2D_MULTISAMPLE",
"GL_SAMPLER_2D_RECT_ANGLE",
"GL_SAMPLER_2D_SHADOW",
"GL_SAMPLER_3D",
"GL_SAMPLER_CUBE",
"GL_SAMPLER_CUBE_SHADOW",
"GL_SAMPLER_EXTERNAL_OES",
"GL_UNSIGNED_INT",
"GL_UNSIGNED_INT_ATOMIC_COUNTER",
"GL_UNSIGNED_INT_IMAGE_2D",
"GL_UNSIGNED_INT_IMAGE_2D_ARRAY",
"GL_UNSIGNED_INT_IMAGE_3D",
"GL_UNSIGNED_INT_IMAGE_CUBE",
"GL_UNSIGNED_INT_SAMPLER_2D",
"GL_UNSIGNED_INT_SAMPLER_2D_ARRAY",
"GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE",
"GL_UNSIGNED_INT_SAMPLER_3D",
"GL_UNSIGNED_INT_SAMPLER_CUBE",
"GL_UNSIGNED_INT_VEC2",
"GL_UNSIGNED_INT_VEC3",
"GL_UNSIGNED_INT_VEC4"
]
# Uniform texture types.
texture_types = {"2D":"2D", "CUBE": "CUBE_MAP", "2D_ARRAY": "2D_ARRAY", "3D": "3D", "MULTISAMPLE": "MULTISAMPLE", "RECT": "RECTANGLE"}
template_cpp = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name}.
//
// Copyright {copyright_year} The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Uniform type info table:
// Metadata about a particular uniform format, indexed by GL type.
#include <array>
#include "common/utilities.h"
using namespace angle;
namespace gl
{{
namespace
{{
constexpr std::array<UniformTypeInfo, {total_count}> kInfoTable =
{{{{
{uniform_type_info_data}
}}}};
size_t GetTypeInfoIndex(GLenum uniformType)
{{
switch (uniformType)
{{
{uniform_type_index_cases}
default:
UNREACHABLE();
return 0;
}}
}}
}} // anonymous namespace
const UniformTypeInfo &GetUniformTypeInfo(GLenum uniformType)
{{
ASSERT(kInfoTable[GetTypeInfoIndex(uniformType)].type == uniformType);
return kInfoTable[GetTypeInfoIndex(uniformType)];
}}
}} // namespace gl
"""
type_info_data_template = """{{{type}, {component_type}, {texture_type}, {transposed_type}, {bool_type}, {rows}, {columns}, {components}, {component_size}, {internal_size}, {external_size}, {is_sampler}, {is_matrix}, {is_image} }}"""
type_index_case_template = """case {enum_value}: return {index_value};"""
def cpp_bool(value):
return "true" if value else "false"
def get_component_type(uniform_type):
if uniform_type.find("GL_BOOL") == 0:
return "GL_BOOL"
elif uniform_type.find("GL_FLOAT") == 0:
return "GL_FLOAT"
elif uniform_type.find("GL_INT") == 0:
return "GL_INT"
elif uniform_type.find("GL_UNSIGNED_INT") == 0:
return "GL_UNSIGNED_INT"
elif uniform_type == "GL_NONE":
return "GL_NONE"
else:
return "GL_INT"
def get_texture_type(uniform_type):
for sampler_type, tex_type in texture_types.items():
if sampler_type in uniform_type:
return "GL_TEXTURE_" + tex_type
return "GL_NONE"
def get_transposed_type(uniform_type):
if "_MAT" in uniform_type:
if "x" in uniform_type:
return "GL_FLOAT_MAT" + uniform_type[-1] + "x" + uniform_type[uniform_type.find("_MAT")+4]
else:
return uniform_type
else:
return "GL_NONE"
def get_bool_type(uniform_type):
if uniform_type == "GL_INT" or uniform_type == "GL_UNSIGNED_INT" or uniform_type == "GL_FLOAT":
return "GL_BOOL"
elif "_VEC" in uniform_type:
return "GL_BOOL_VEC" + uniform_type[-1]
else:
return "GL_NONE"
def get_rows(uniform_type):
if uniform_type == "GL_NONE":
return "0"
elif "_MAT" in uniform_type:
return uniform_type[-1]
else:
return "1"
def get_columns(uniform_type):
if uniform_type == "GL_NONE":
return "0"
elif "_VEC" in uniform_type:
return uniform_type[-1]
elif "_MAT" in uniform_type:
return uniform_type[uniform_type.find("_MAT") + 4]
else:
return "1"
def get_components(uniform_type):
return str(int(get_rows(uniform_type)) * int(get_columns(uniform_type)))
def get_component_size(uniform_type):
component_type = get_component_type(uniform_type)
if (component_type) == "GL_BOOL":
return "sizeof(GLint)"
elif (component_type) == "GL_FLOAT":
return "sizeof(GLfloat)"
elif (component_type) == "GL_INT":
return "sizeof(GLint)"
elif (component_type) == "GL_UNSIGNED_INT":
return "sizeof(GLuint)"
elif (component_type) == "GL_NONE":
return "0"
else:
raise "Invalid component type: " + component_type
def get_internal_size(uniform_type):
return get_component_size(uniform_type) + " * " + str(int(get_rows(uniform_type)) * 4)
def get_external_size(uniform_type):
return get_component_size(uniform_type) + " * " + get_components(uniform_type)
def get_is_sampler(uniform_type):
return cpp_bool("_SAMPLER_" in uniform_type)
def get_is_matrix(uniform_type):
return cpp_bool("_MAT" in uniform_type)
def get_is_image(uniform_type):
return cpp_bool("_IMAGE_" in uniform_type)
def gen_type_info(uniform_type):
return type_info_data_template.format(
type = uniform_type,
component_type = get_component_type(uniform_type),
texture_type = get_texture_type(uniform_type),
transposed_type = get_transposed_type(uniform_type),
bool_type = get_bool_type(uniform_type),
rows = get_rows(uniform_type),
columns = get_columns(uniform_type),
components = get_components(uniform_type),
component_size = get_component_size(uniform_type),
internal_size = get_internal_size(uniform_type),
external_size = get_external_size(uniform_type),
is_sampler = get_is_sampler(uniform_type),
is_matrix = get_is_matrix(uniform_type),
is_image = get_is_image(uniform_type))
def gen_type_index_case(index, uniform_type):
return "case " + uniform_type + ": return " + str(index) + ";"
uniform_type_info_data = ",\n".join([gen_type_info(uniform_type) for uniform_type in all_uniform_types])
uniform_type_index_cases = "\n".join([gen_type_index_case(index, uniform_type) for index, uniform_type in enumerate(all_uniform_types)])
with open('uniform_type_info_autogen.cpp', 'wt') as out_file:
output_cpp = template_cpp.format(
script_name = sys.argv[0],
copyright_year = date.today().year,
total_count = len(all_uniform_types),
uniform_type_info_data = uniform_type_info_data,
uniform_type_index_cases = uniform_type_index_cases)
out_file.write(output_cpp)
out_file.close()
...@@ -229,7 +229,6 @@ int VariableRowCount(GLenum type) ...@@ -229,7 +229,6 @@ int VariableRowCount(GLenum type)
switch (type) switch (type)
{ {
case GL_NONE: case GL_NONE:
case GL_STRUCT_ANGLEX:
return 0; return 0;
case GL_BOOL: case GL_BOOL:
case GL_FLOAT: case GL_FLOAT:
...@@ -305,7 +304,6 @@ int VariableColumnCount(GLenum type) ...@@ -305,7 +304,6 @@ int VariableColumnCount(GLenum type)
switch (type) switch (type)
{ {
case GL_NONE: case GL_NONE:
case GL_STRUCT_ANGLEX:
return 0; return 0;
case GL_BOOL: case GL_BOOL:
case GL_FLOAT: case GL_FLOAT:
......
...@@ -23,11 +23,9 @@ namespace gl ...@@ -23,11 +23,9 @@ namespace gl
int VariableComponentCount(GLenum type); int VariableComponentCount(GLenum type);
GLenum VariableComponentType(GLenum type); GLenum VariableComponentType(GLenum type);
bool IsVariableComponentTypeBool(GLenum type);
size_t VariableComponentSize(GLenum type); size_t VariableComponentSize(GLenum type);
size_t VariableInternalSize(GLenum type); size_t VariableInternalSize(GLenum type);
size_t VariableExternalSize(GLenum type); size_t VariableExternalSize(GLenum type);
GLenum VariableBoolVectorType(GLenum type);
int VariableRowCount(GLenum type); int VariableRowCount(GLenum type);
int VariableColumnCount(GLenum type); int VariableColumnCount(GLenum type);
bool IsSamplerType(GLenum type); bool IsSamplerType(GLenum type);
...@@ -41,17 +39,7 @@ int VariableRegisterCount(GLenum type); ...@@ -41,17 +39,7 @@ int VariableRegisterCount(GLenum type);
int MatrixRegisterCount(GLenum type, bool isRowMajorMatrix); int MatrixRegisterCount(GLenum type, bool isRowMajorMatrix);
int MatrixComponentCount(GLenum type, bool isRowMajorMatrix); int MatrixComponentCount(GLenum type, bool isRowMajorMatrix);
int VariableSortOrder(GLenum type); int VariableSortOrder(GLenum type);
GLenum VariableBoolVectorType(GLenum type);
// Inlined for speed
ANGLE_INLINE bool IsVariableComponentTypeBool(GLenum type)
{
static_assert((GL_BOOL_VEC2 == GL_BOOL + 1) && (GL_BOOL_VEC3 == GL_BOOL + 2) &&
(GL_BOOL_VEC4 == GL_BOOL + 3),
"GL_BOOL and GL_BOOL_VEC2-4 are contiguous");
ASSERT((static_cast<uint32_t>(type - GL_BOOL) <= 3) ==
(VariableComponentType(type) == GL_BOOL));
return (static_cast<uint32_t>(type - GL_BOOL) <= 3);
}
int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize); int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize);
...@@ -157,6 +145,57 @@ ParamType ConvertFromGLint64(GLint64 param) ...@@ -157,6 +145,57 @@ ParamType ConvertFromGLint64(GLint64 param)
unsigned int ParseAndStripArrayIndex(std::string *name); unsigned int ParseAndStripArrayIndex(std::string *name);
struct UniformTypeInfo final : angle::NonCopyable
{
constexpr UniformTypeInfo(GLenum type,
GLenum componentType,
GLenum samplerTextureType,
GLenum transposedMatrixType,
GLenum boolVectorType,
int rowCount,
int columnCount,
int componentCount,
size_t componentSize,
size_t internalSize,
size_t externalSize,
bool isSampler,
bool isMatrixType,
bool isImageType)
: type(type),
componentType(componentType),
samplerTextureType(samplerTextureType),
transposedMatrixType(transposedMatrixType),
boolVectorType(boolVectorType),
rowCount(rowCount),
columnCount(columnCount),
componentCount(componentCount),
componentSize(componentSize),
internalSize(internalSize),
externalSize(externalSize),
isSampler(isSampler),
isMatrixType(isMatrixType),
isImageType(isImageType)
{
}
GLenum type;
GLenum componentType;
GLenum samplerTextureType;
GLenum transposedMatrixType;
GLenum boolVectorType;
int rowCount;
int columnCount;
int componentCount;
size_t componentSize;
size_t internalSize;
size_t externalSize;
bool isSampler;
bool isMatrixType;
bool isImageType;
};
const UniformTypeInfo &GetUniformTypeInfo(GLenum uniformType);
} // namespace gl } // namespace gl
namespace egl namespace egl
......
...@@ -352,7 +352,7 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol) ...@@ -352,7 +352,7 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
const char kName[] = "gl_DepthRange"; const char kName[] = "gl_DepthRange";
info.name = kName; info.name = kName;
info.mappedName = kName; info.mappedName = kName;
info.type = GL_STRUCT_ANGLEX; info.type = GL_NONE;
info.arraySize = 0; info.arraySize = 0;
info.precision = GL_NONE; info.precision = GL_NONE;
info.staticUse = true; info.staticUse = true;
...@@ -556,8 +556,8 @@ void CollectVariablesTraverser::setCommonVariableProperties(const TType &type, ...@@ -556,8 +556,8 @@ void CollectVariablesTraverser::setCommonVariableProperties(const TType &type,
} }
else else
{ {
// Note: this enum value is not exposed outside ANGLE // Structures use a NONE type that isn't exposed outside ANGLE.
variableOut->type = GL_STRUCT_ANGLEX; variableOut->type = GL_NONE;
variableOut->structName = structure->name().c_str(); variableOut->structName = structure->name().c_str();
const TFieldList &fields = structure->fields(); const TFieldList &fields = structure->fields();
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <GLSLANG/ShaderVars.h> #include <GLSLANG/ShaderVars.h>
#include <anglebase/sha1.h> #include <anglebase/sha1.h>
#include "common/utilities.h"
#include "common/version.h" #include "common/version.h"
#include "libANGLE/BinaryStream.h" #include "libANGLE/BinaryStream.h"
#include "libANGLE/Context.h" #include "libANGLE/Context.h"
...@@ -206,6 +207,8 @@ LinkResult MemoryProgramCache::Deserialize(const Context *context, ...@@ -206,6 +207,8 @@ LinkResult MemoryProgramCache::Deserialize(const Context *context,
uniform.blockInfo.matrixStride = stream.readInt<int>(); uniform.blockInfo.matrixStride = stream.readInt<int>();
uniform.blockInfo.isRowMajorMatrix = stream.readBool(); uniform.blockInfo.isRowMajorMatrix = stream.readBool();
uniform.typeInfo = &GetUniformTypeInfo(uniform.type);
state->mUniforms.push_back(uniform); state->mUniforms.push_back(uniform);
} }
......
...@@ -61,12 +61,12 @@ bool CompareShaderVar(const sh::ShaderVariable &x, const sh::ShaderVariable &y) ...@@ -61,12 +61,12 @@ bool CompareShaderVar(const sh::ShaderVariable &x, const sh::ShaderVariable &y)
} }
// Special case for handling structs: we sort these to the end of the list // Special case for handling structs: we sort these to the end of the list
if (x.type == GL_STRUCT_ANGLEX) if (x.type == GL_NONE)
{ {
return false; return false;
} }
if (y.type == GL_STRUCT_ANGLEX) if (y.type == GL_NONE)
{ {
return true; return true;
} }
......
...@@ -14,7 +14,7 @@ namespace gl ...@@ -14,7 +14,7 @@ namespace gl
{ {
LinkedUniform::LinkedUniform() LinkedUniform::LinkedUniform()
: bufferIndex(-1), blockInfo(sh::BlockMemberInfo::getDefaultBlockInfo()) : typeInfo(nullptr), bufferIndex(-1), blockInfo(sh::BlockMemberInfo::getDefaultBlockInfo())
{ {
} }
...@@ -27,7 +27,7 @@ LinkedUniform::LinkedUniform(GLenum typeIn, ...@@ -27,7 +27,7 @@ LinkedUniform::LinkedUniform(GLenum typeIn,
const int locationIn, const int locationIn,
const int bufferIndexIn, const int bufferIndexIn,
const sh::BlockMemberInfo &blockInfoIn) const sh::BlockMemberInfo &blockInfoIn)
: bufferIndex(bufferIndexIn), blockInfo(blockInfoIn) : typeInfo(&GetUniformTypeInfo(typeIn)), bufferIndex(bufferIndexIn), blockInfo(blockInfoIn)
{ {
type = typeIn; type = typeIn;
precision = precisionIn; precision = precisionIn;
...@@ -39,18 +39,25 @@ LinkedUniform::LinkedUniform(GLenum typeIn, ...@@ -39,18 +39,25 @@ LinkedUniform::LinkedUniform(GLenum typeIn,
} }
LinkedUniform::LinkedUniform(const sh::Uniform &uniform) LinkedUniform::LinkedUniform(const sh::Uniform &uniform)
: sh::Uniform(uniform), bufferIndex(-1), blockInfo(sh::BlockMemberInfo::getDefaultBlockInfo()) : sh::Uniform(uniform),
typeInfo(&GetUniformTypeInfo(type)),
bufferIndex(-1),
blockInfo(sh::BlockMemberInfo::getDefaultBlockInfo())
{ {
} }
LinkedUniform::LinkedUniform(const LinkedUniform &uniform) LinkedUniform::LinkedUniform(const LinkedUniform &uniform)
: sh::Uniform(uniform), bufferIndex(uniform.bufferIndex), blockInfo(uniform.blockInfo) : sh::Uniform(uniform),
typeInfo(uniform.typeInfo),
bufferIndex(uniform.bufferIndex),
blockInfo(uniform.blockInfo)
{ {
} }
LinkedUniform &LinkedUniform::operator=(const LinkedUniform &uniform) LinkedUniform &LinkedUniform::operator=(const LinkedUniform &uniform)
{ {
sh::Uniform::operator=(uniform); sh::Uniform::operator=(uniform);
typeInfo = uniform.typeInfo;
bufferIndex = uniform.bufferIndex; bufferIndex = uniform.bufferIndex;
blockInfo = uniform.blockInfo; blockInfo = uniform.blockInfo;
...@@ -68,12 +75,12 @@ bool LinkedUniform::isInDefaultBlock() const ...@@ -68,12 +75,12 @@ bool LinkedUniform::isInDefaultBlock() const
bool LinkedUniform::isSampler() const bool LinkedUniform::isSampler() const
{ {
return IsSamplerType(type); return typeInfo->isSampler;
} }
bool LinkedUniform::isImage() const bool LinkedUniform::isImage() const
{ {
return IsImageType(type); return typeInfo->isImageType;
} }
bool LinkedUniform::isAtomicCounter() const bool LinkedUniform::isAtomicCounter() const
...@@ -88,12 +95,12 @@ bool LinkedUniform::isField() const ...@@ -88,12 +95,12 @@ bool LinkedUniform::isField() const
size_t LinkedUniform::getElementSize() const size_t LinkedUniform::getElementSize() const
{ {
return VariableExternalSize(type); return typeInfo->externalSize;
} }
size_t LinkedUniform::getElementComponents() const size_t LinkedUniform::getElementComponents() const
{ {
return VariableComponentCount(type); return typeInfo->componentCount;
} }
ShaderVariableBuffer::ShaderVariableBuffer() ShaderVariableBuffer::ShaderVariableBuffer()
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
namespace gl namespace gl
{ {
struct UniformTypeInfo;
// Helper struct representing a single shader uniform // Helper struct representing a single shader uniform
struct LinkedUniform : public sh::Uniform struct LinkedUniform : public sh::Uniform
...@@ -45,6 +46,8 @@ struct LinkedUniform : public sh::Uniform ...@@ -45,6 +46,8 @@ struct LinkedUniform : public sh::Uniform
size_t getElementSize() const; size_t getElementSize() const;
size_t getElementComponents() const; size_t getElementComponents() const;
const UniformTypeInfo *typeInfo;
// Identifies the containing buffer backed resource -- interface block or atomic counter buffer. // Identifies the containing buffer backed resource -- interface block or atomic counter buffer.
int bufferIndex; int bufferIndex;
sh::BlockMemberInfo blockInfo; sh::BlockMemberInfo blockInfo;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
'common/third_party/murmurhash/MurmurHash3.h', 'common/third_party/murmurhash/MurmurHash3.h',
'common/tls.cpp', 'common/tls.cpp',
'common/tls.h', 'common/tls.h',
'common/uniform_type_info_autogen.cpp',
'common/utilities.cpp', 'common/utilities.cpp',
'common/utilities.h', 'common/utilities.h',
'common/vector_utils.h', 'common/vector_utils.h',
......
...@@ -218,13 +218,13 @@ TEST(VariablePacking, Struct) ...@@ -218,13 +218,13 @@ TEST(VariablePacking, Struct)
// Test example from GLSL ES 3.0 spec chapter 11, but with structs // Test example from GLSL ES 3.0 spec chapter 11, but with structs
std::vector<sh::ShaderVariable> vars; std::vector<sh::ShaderVariable> vars;
vars.push_back(sh::ShaderVariable(GL_STRUCT_ANGLEX, 0)); vars.push_back(sh::ShaderVariable(GL_NONE, 0));
sh::ShaderVariable &parentStruct = vars[0]; sh::ShaderVariable &parentStruct = vars[0];
parentStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_VEC4, 0)); parentStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_VEC4, 0));
parentStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_MAT3, 0)); parentStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_MAT3, 0));
parentStruct.fields.push_back(sh::ShaderVariable(GL_STRUCT_ANGLEX, 0)); parentStruct.fields.push_back(sh::ShaderVariable(GL_NONE, 0));
sh::ShaderVariable &innerStruct = parentStruct.fields.back(); sh::ShaderVariable &innerStruct = parentStruct.fields.back();
innerStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_MAT3, 0)); innerStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_MAT3, 0));
innerStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_VEC2, 6)); innerStruct.fields.push_back(sh::ShaderVariable(GL_FLOAT_VEC2, 6));
......
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