0:7 Function Parameters:
0:7 'pos' ( in uint)
0:? Sequence
-0:8 move second child to first child ( temp void)
+0:8 move second child to first child ( temp 4-component vector of float)
0:8 indirect index (layout( row_major std430) buffer 4-component vector of float)
0:8 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
0:7 Function Parameters:
0:7 'pos' ( in uint)
0:? Sequence
-0:8 move second child to first child ( temp void)
+0:8 move second child to first child ( temp 4-component vector of float)
0:8 indirect index (layout( row_major std430) buffer 4-component vector of float)
0:8 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of 4-component vector of float)
0:8 'sbuf_a' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of 4-component vector of float @data})
int TProgram::getUniformBlockSize(int index) const { return reflection->getUniformBlock(index).size; }
int TProgram::getUniformIndex(const char* name) const { return reflection->getIndex(name); }
int TProgram::getUniformBlockIndex(int index) const { return reflection->getUniform(index).index; }
+int TProgram::getUniformBlockCounterIndex(int index) const { return reflection->getUniformBlock(index).counterIndex; }
int TProgram::getUniformType(int index) const { return reflection->getUniform(index).glDefineType; }
int TProgram::getUniformBufferOffset(int index) const { return reflection->getUniform(index).offset; }
int TProgram::getUniformArraySize(int index) const { return reflection->getUniform(index).size; }
}
}
+// build counter block index associations for buffers
+void TReflection::buildCounterIndices()
+{
+ // search for ones that have counters
+ for (int i = 0; i < int(indexToUniformBlock.size()); ++i) {
+ const TString counterName(indexToUniformBlock[i].name + "@count");
+ const int index = getIndex(counterName);
+
+ if (index >= 0)
+ indexToUniformBlock[i].counterIndex = index;
+ }
+}
+
// Merge live symbols from 'intermediate' into the existing reflection database.
//
// Returns false if the input is too malformed to do this.
function->traverse(&it);
}
+ buildCounterIndices();
+
return true;
}
public:
TObjectReflection(const TString& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex) :
name(pName), offset(pOffset),
- glDefineType(pGLDefineType), size(pSize), index(pIndex), type(pType.clone()) { }
+ glDefineType(pGLDefineType), size(pSize), index(pIndex), counterIndex(-1), type(pType.clone()) { }
void dump() const {
- printf("%s: offset %d, type %x, size %d, index %d, binding %d\n",
+ printf("%s: offset %d, type %x, size %d, index %d, binding %d",
name.c_str(), offset, glDefineType, size, index, getBinding() );
+
+ if (counterIndex != -1)
+ printf(", counter %d", counterIndex);
+
+ printf("\n");
}
const TType* const getType() const { return type; }
int glDefineType;
int size; // data size in bytes for a block, array size for a (non-block) object that's an array
int index;
+ int counterIndex;
static TObjectReflection badReflection() { return TObjectReflection(); }
return it->second;
}
+ // see getIndex(const char*)
+ int getIndex(const TString& name) const { return getIndex(name.c_str()); }
+
// Thread local size
unsigned getLocalSize(int dim) const { return dim <= 2 ? localSize[dim] : 0; }
protected:
friend class glslang::TReflectionTraverser;
+ void buildCounterIndices();
void buildAttributeReflection(EShLanguage, const TIntermediate&);
// Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex;
int getUniformBlockSize(int blockIndex) const; // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE)
int getUniformIndex(const char* name) const; // can be used for glGetUniformIndices()
int getUniformBlockIndex(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX)
+ int getUniformBlockCounterIndex(int index) const; // returns block index of associated counter.
int getUniformType(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE)
int getUniformBufferOffset(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET)
int getUniformArraySize(int index) const; // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE)
const TType derefType(argArray->getType(), 0);
lValue->setType(derefType);
- node = intermediate.addAssign(EOpAssign, lValue, rValue, loc);
- node->setType(TType(EbtVoid)); // Append is a void return type
+ node = intermediate.addAssign(EOpAssign, lValue, rValue, loc);
break;
}