mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 03:53:52 +02:00
Rename the nb parameters with num
This commit is contained in:
parent
8735aa8003
commit
acfb5a32bc
2 changed files with 21 additions and 35 deletions
|
@ -59,53 +59,53 @@ void Batch::clear() {
|
|||
|
||||
uint32 Batch::cacheData(uint32 size, const void* data) {
|
||||
uint32 offset = _data.size();
|
||||
uint32 nbBytes = size;
|
||||
_data.resize(offset + nbBytes);
|
||||
uint32 numBytes = size;
|
||||
_data.resize(offset + numBytes);
|
||||
memcpy(_data.data() + offset, data, size);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
void Batch::draw(Primitive primitiveType, uint32 nbVertices, uint32 startVertex) {
|
||||
void Batch::draw(Primitive primitiveType, uint32 numVertices, uint32 startVertex) {
|
||||
ADD_COMMAND(draw);
|
||||
|
||||
_params.push_back(startVertex);
|
||||
_params.push_back(nbVertices);
|
||||
_params.push_back(numVertices);
|
||||
_params.push_back(primitiveType);
|
||||
}
|
||||
|
||||
void Batch::drawIndexed(Primitive primitiveType, uint32 nbIndices, uint32 startIndex) {
|
||||
void Batch::drawIndexed(Primitive primitiveType, uint32 numIndices, uint32 startIndex) {
|
||||
ADD_COMMAND(drawIndexed);
|
||||
|
||||
_params.push_back(startIndex);
|
||||
_params.push_back(nbIndices);
|
||||
_params.push_back(numIndices);
|
||||
_params.push_back(primitiveType);
|
||||
}
|
||||
|
||||
void Batch::drawInstanced(uint32 nbInstances, Primitive primitiveType, uint32 nbVertices, uint32 startVertex, uint32 startInstance) {
|
||||
void Batch::drawInstanced(uint32 numInstances, Primitive primitiveType, uint32 numVertices, uint32 startVertex, uint32 startInstance) {
|
||||
ADD_COMMAND(drawInstanced);
|
||||
|
||||
_params.push_back(startInstance);
|
||||
_params.push_back(startVertex);
|
||||
_params.push_back(nbVertices);
|
||||
_params.push_back(numVertices);
|
||||
_params.push_back(primitiveType);
|
||||
_params.push_back(nbInstances);
|
||||
_params.push_back(numInstances);
|
||||
}
|
||||
|
||||
void Batch::drawIndexedInstanced(uint32 nbInstances, Primitive primitiveType, uint32 nbIndices, uint32 startIndex, uint32 startInstance) {
|
||||
void Batch::drawIndexedInstanced(uint32 numInstances, Primitive primitiveType, uint32 numIndices, uint32 startIndex, uint32 startInstance) {
|
||||
ADD_COMMAND(drawIndexedInstanced);
|
||||
|
||||
_params.push_back(startInstance);
|
||||
_params.push_back(startIndex);
|
||||
_params.push_back(nbIndices);
|
||||
_params.push_back(numIndices);
|
||||
_params.push_back(primitiveType);
|
||||
_params.push_back(nbInstances);
|
||||
_params.push_back(numInstances);
|
||||
}
|
||||
|
||||
|
||||
void Batch::multiDrawIndirect(uint32 nbCommands, Primitive primitiveType) {
|
||||
void Batch::multiDrawIndirect(uint32 numCommands, Primitive primitiveType) {
|
||||
ADD_COMMAND(multiDrawIndirect);
|
||||
_params.push_back(nbCommands);
|
||||
_params.push_back(numCommands);
|
||||
_params.push_back(primitiveType);
|
||||
}
|
||||
|
||||
|
|
|
@ -93,11 +93,11 @@ public:
|
|||
|
||||
// Drawcalls
|
||||
void draw(Primitive primitiveType, uint32 numVertices, uint32 startVertex = 0);
|
||||
void drawIndexed(Primitive primitiveType, uint32 nbIndices, uint32 startIndex = 0);
|
||||
void drawInstanced(uint32 nbInstances, Primitive primitiveType, uint32 nbVertices, uint32 startVertex = 0, uint32 startInstance = 0);
|
||||
void drawIndexedInstanced(uint32 nbInstances, Primitive primitiveType, uint32 nbIndices, uint32 startIndex = 0, uint32 startInstance = 0);
|
||||
void multiDrawIndirect(uint32 nbCommands, Primitive primitiveType);
|
||||
void multiDrawIndexedIndirect(uint32 nbCommands, Primitive primitiveType);
|
||||
void drawIndexed(Primitive primitiveType, uint32 numIndices, uint32 startIndex = 0);
|
||||
void drawInstanced(uint32 numInstances, Primitive primitiveType, uint32 numVertices, uint32 startVertex = 0, uint32 startInstance = 0);
|
||||
void drawIndexedInstanced(uint32 numInstances, Primitive primitiveType, uint32 numIndices, uint32 startIndex = 0, uint32 startInstance = 0);
|
||||
void multiDrawIndirect(uint32 numCommands, Primitive primitiveType);
|
||||
void multiDrawIndexedIndirect(uint32 numCommands, Primitive primitiveType);
|
||||
|
||||
|
||||
void setupNamedCalls(const std::string& instanceName, size_t count, NamedBatchData::Function function);
|
||||
|
@ -174,8 +174,6 @@ public:
|
|||
// Reset the stage caches and states
|
||||
void resetStages();
|
||||
|
||||
void runLambda(std::function<void()> f);
|
||||
|
||||
// TODO: As long as we have gl calls explicitely issued from interface
|
||||
// code, we need to be able to record and batch these calls. THe long
|
||||
// term strategy is to get rid of any GL calls in favor of the HIFI GPU API
|
||||
|
@ -348,22 +346,10 @@ public:
|
|||
bool _enableSkybox{ false };
|
||||
|
||||
protected:
|
||||
// Maybe useful but shoudln't be public. Please convince me otherwise
|
||||
void runLambda(std::function<void()> f);
|
||||
};
|
||||
|
||||
template <typename V>
|
||||
void popVectorParam(Batch::Params& params, uint32& paramOffset, V& v) {
|
||||
for (size_t i = 0; i < v.length(); ++i) {
|
||||
v[i] = params[paramOffset++]._float;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename V>
|
||||
void pushVectorParam(Batch::Params& params, const V& v) {
|
||||
for (size_t i = 0; i < v.length(); ++i) {
|
||||
params.push_back(v[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue