Reflow for better readability

This commit is contained in:
baldurk 2019-02-08 10:48:48 +00:00
parent a972e73ad7
commit 4513df9175
2 changed files with 49 additions and 85 deletions

View File

@ -1529,12 +1529,15 @@ void usage()
" --invert-y | --iy invert position.Y output in vertex shader\n" " --invert-y | --iy invert position.Y output in vertex shader\n"
" --keep-uncalled | --ku don't eliminate uncalled functions\n" " --keep-uncalled | --ku don't eliminate uncalled functions\n"
" --no-storage-format | --nsf use Unknown image format\n" " --no-storage-format | --nsf use Unknown image format\n"
" --reflect-strict-array-suffix use strict array suffix rules when reflecting\n" " --reflect-strict-array-suffix use strict array suffix rules when\n"
" reflecting\n"
" --reflect-basic-array-suffix arrays of basic types will have trailing [0]\n" " --reflect-basic-array-suffix arrays of basic types will have trailing [0]\n"
" --reflect-intermediate-io reflection includes inputs/outputs of linked shaders\n" " --reflect-intermediate-io reflection includes inputs/outputs of linked\n"
" rather than just vertex/fragment\n" " shaders rather than just vertex/fragment\n"
" --reflect-separate-buffers reflect buffer variables and blocks separately to uniforms\n" " --reflect-separate-buffers reflect buffer variables and blocks\n"
" --reflect-all-block-variables reflect all variables in blocks, whether inactive or active\n" " separately to uniforms\n"
" --reflect-all-block-variables reflect all variables in blocks, whether\n"
" inactive or active\n"
" --resource-set-binding [stage] name set binding\n" " --resource-set-binding [stage] name set binding\n"
" set descriptor set and binding for\n" " set descriptor set and binding for\n"
" individual resources\n" " individual resources\n"

View File

@ -758,105 +758,66 @@ public:
const TObjectReflection& getAtomicCounter(int index) const; const TObjectReflection& getAtomicCounter(int index) const;
// Legacy Reflection Interface - expressed in terms of above interface // Legacy Reflection Interface - expressed in terms of above interface
int getNumLiveUniformVariables() const // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS)
{
return getNumUniformVariables();
}
int getNumLiveUniformBlocks() const // can be used for glGetProgramiv(GL_ACTIVE_UNIFORM_BLOCKS) // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS)
{ int getNumLiveUniformVariables() const { return getNumUniformVariables(); }
return getNumUniformBlocks();
}
int getNumLiveAttributes() const // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES) // can be used for glGetProgramiv(GL_ACTIVE_UNIFORM_BLOCKS)
{ int getNumLiveUniformBlocks() const { return getNumUniformBlocks(); }
return getNumPipeInputs();
}
int getUniformIndex(const char* name) const // can be used for glGetUniformIndices() // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES)
{ int getNumLiveAttributes() const { return getNumPipeInputs(); }
return getReflectionIndex(name);
}
const char* getUniformName(int index) const // can be used for "name" part of glGetActiveUniform() // can be used for glGetUniformIndices()
{ int getUniformIndex(const char *name) const { return getReflectionIndex(name); }
return getUniform(index).name.c_str();
}
int getUniformBinding(int index) const // returns the binding number // can be used for "name" part of glGetActiveUniform()
{ const char *getUniformName(int index) const { return getUniform(index).name.c_str(); }
return getUniform(index).getBinding();
}
EShLanguageMask getUniformStages(int index) const // returns Shaders Stages where a Uniform is present // returns the binding number
{ int getUniformBinding(int index) const { return getUniform(index).getBinding(); }
return getUniform(index).stages;
}
int getUniformBlockIndex(int index) const // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX) // returns Shaders Stages where a Uniform is present
{ EShLanguageMask getUniformStages(int index) const { return getUniform(index).stages; }
return getUniform(index).index;
}
int getUniformType(int index) const // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) // can be used for glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX)
{ int getUniformBlockIndex(int index) const { return getUniform(index).index; }
return getUniform(index).glDefineType;
}
int getUniformBufferOffset(int index) const // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET) // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE)
{ int getUniformType(int index) const { return getUniform(index).glDefineType; }
return getUniform(index).offset;
}
int getUniformArraySize(int index) const // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE) // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET)
{ int getUniformBufferOffset(int index) const { return getUniform(index).offset; }
return getUniform(index).size;
}
const TType* getUniformTType(int index) const // returns a TType* // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE)
{ int getUniformArraySize(int index) const { return getUniform(index).size; }
return getUniform(index).getType();
}
const char* getUniformBlockName(int index) const // can be used for glGetActiveUniformBlockName() // returns a TType*
{ const TType *getUniformTType(int index) const { return getUniform(index).getType(); }
return getUniformBlock(index).name.c_str();
}
int getUniformBlockSize(int index) const // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE) // can be used for glGetActiveUniformBlockName()
{ const char *getUniformBlockName(int index) const { return getUniformBlock(index).name.c_str(); }
return getUniformBlock(index).size;
}
int getUniformBlockBinding(int index) const // returns the block binding number // can be used for glGetActiveUniformBlockiv(UNIFORM_BLOCK_DATA_SIZE)
{ int getUniformBlockSize(int index) const { return getUniformBlock(index).size; }
return getUniformBlock(index).getBinding();
}
int getUniformBlockCounterIndex(int index) const // returns block index of associated counter. // returns the block binding number
{ int getUniformBlockBinding(int index) const { return getUniformBlock(index).getBinding(); }
return getUniformBlock(index).counterIndex;
}
const TType* getUniformBlockTType(int index) const // returns a TType* // returns block index of associated counter.
{ int getUniformBlockCounterIndex(int index) const { return getUniformBlock(index).counterIndex; }
return getUniformBlock(index).getType();
}
const char* getAttributeName(int index) const // can be used for glGetActiveAttrib() // returns a TType*
{ const TType *getUniformBlockTType(int index) const { return getUniformBlock(index).getType(); }
return getPipeInput(index).name.c_str();
}
int getAttributeType(int index) const // can be used for glGetActiveAttrib() // can be used for glGetActiveAttrib()
{ const char *getAttributeName(int index) const { return getPipeInput(index).name.c_str(); }
return getPipeInput(index).glDefineType;
}
const TType* getAttributeTType(int index) const // returns a TType* // can be used for glGetActiveAttrib()
{ int getAttributeType(int index) const { return getPipeInput(index).glDefineType; }
return getPipeInput(index).getType();
} // returns a TType*
const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); }
void dumpReflection(); void dumpReflection();