Fixed some function signatures
Fixed a few types in function signatures so that base and
derived classes signatures match.
Change-Id: Ide9b9c78ff05be785b512451a36c836f35bd1f3d
Reviewed-on: https://swiftshader-review.googlesource.com/5463
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/libGLESv2/Device.cpp b/src/OpenGL/libGLESv2/Device.cpp
index 53c794c..a4ba15a 100644
--- a/src/OpenGL/libGLESv2/Device.cpp
+++ b/src/OpenGL/libGLESv2/Device.cpp
@@ -338,7 +338,7 @@
draw(type, 0, primitiveCount);
}
- void Device::setPixelShader(PixelShader *pixelShader)
+ void Device::setPixelShader(const PixelShader *pixelShader)
{
this->pixelShader = pixelShader;
pixelShaderDirty = true;
@@ -429,7 +429,7 @@
scissorRect = rect;
}
- void Device::setVertexShader(VertexShader *vertexShader)
+ void Device::setVertexShader(const VertexShader *vertexShader)
{
this->vertexShader = vertexShader;
vertexShaderDirty = true;
diff --git a/src/OpenGL/libGLESv2/Device.hpp b/src/OpenGL/libGLESv2/Device.hpp
index 13a10de..17c7925 100644
--- a/src/OpenGL/libGLESv2/Device.hpp
+++ b/src/OpenGL/libGLESv2/Device.hpp
@@ -62,14 +62,14 @@
egl::Image *createRenderTarget(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool lockable);
void drawIndexedPrimitive(sw::DrawType type, unsigned int indexOffset, unsigned int primitiveCount);
void drawPrimitive(sw::DrawType type, unsigned int primiveCount);
- void setPixelShader(sw::PixelShader *shader);
+ void setPixelShader(const sw::PixelShader *shader);
void setPixelShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count);
void setScissorEnable(bool enable);
void setRenderTarget(int index, egl::Image *renderTarget);
void setDepthBuffer(egl::Image *depthBuffer);
void setStencilBuffer(egl::Image *stencilBuffer);
void setScissorRect(const sw::Rect &rect);
- void setVertexShader(sw::VertexShader *shader);
+ void setVertexShader(const sw::VertexShader *shader);
void setVertexShaderConstantF(unsigned int startRegister, const float *constantData, unsigned int count);
void setViewport(const Viewport &viewport);
@@ -92,8 +92,8 @@
sw::Rect scissorRect;
bool scissorEnable;
- sw::PixelShader *pixelShader;
- sw::VertexShader *vertexShader;
+ const sw::PixelShader *pixelShader;
+ const sw::VertexShader *vertexShader;
bool pixelShaderDirty;
unsigned int pixelShaderConstantsFDirty;
diff --git a/src/Renderer/Renderer.cpp b/src/Renderer/Renderer.cpp
index 252d744..32e2027 100644
--- a/src/Renderer/Renderer.cpp
+++ b/src/Renderer/Renderer.cpp
@@ -2474,9 +2474,9 @@
loadConstants(shader);
}
- void Renderer::setPixelShaderConstantF(int index, const float value[4], int count)
+ void Renderer::setPixelShaderConstantF(unsigned int index, const float value[4], unsigned int count)
{
- for(int i = 0; i < DRAW_COUNT; i++)
+ for(unsigned int i = 0; i < DRAW_COUNT; i++)
{
if(drawCall[i]->psDirtyConstF < index + count)
{
@@ -2484,16 +2484,16 @@
}
}
- for(int i = 0; i < count; i++)
+ for(unsigned int i = 0; i < count; i++)
{
PixelProcessor::setFloatConstant(index + i, value);
value += 4;
}
}
- void Renderer::setPixelShaderConstantI(int index, const int value[4], int count)
+ void Renderer::setPixelShaderConstantI(unsigned int index, const int value[4], unsigned int count)
{
- for(int i = 0; i < DRAW_COUNT; i++)
+ for(unsigned int i = 0; i < DRAW_COUNT; i++)
{
if(drawCall[i]->psDirtyConstI < index + count)
{
@@ -2501,16 +2501,16 @@
}
}
- for(int i = 0; i < count; i++)
+ for(unsigned int i = 0; i < count; i++)
{
PixelProcessor::setIntegerConstant(index + i, value);
value += 4;
}
}
- void Renderer::setPixelShaderConstantB(int index, const int *boolean, int count)
+ void Renderer::setPixelShaderConstantB(unsigned int index, const int *boolean, unsigned int count)
{
- for(int i = 0; i < DRAW_COUNT; i++)
+ for(unsigned int i = 0; i < DRAW_COUNT; i++)
{
if(drawCall[i]->psDirtyConstB < index + count)
{
@@ -2518,16 +2518,16 @@
}
}
- for(int i = 0; i < count; i++)
+ for(unsigned int i = 0; i < count; i++)
{
PixelProcessor::setBooleanConstant(index + i, *boolean);
boolean++;
}
}
- void Renderer::setVertexShaderConstantF(int index, const float value[4], int count)
+ void Renderer::setVertexShaderConstantF(unsigned int index, const float value[4], unsigned int count)
{
- for(int i = 0; i < DRAW_COUNT; i++)
+ for(unsigned int i = 0; i < DRAW_COUNT; i++)
{
if(drawCall[i]->vsDirtyConstF < index + count)
{
@@ -2535,16 +2535,16 @@
}
}
- for(int i = 0; i < count; i++)
+ for(unsigned int i = 0; i < count; i++)
{
VertexProcessor::setFloatConstant(index + i, value);
value += 4;
}
}
- void Renderer::setVertexShaderConstantI(int index, const int value[4], int count)
+ void Renderer::setVertexShaderConstantI(unsigned int index, const int value[4], unsigned int count)
{
- for(int i = 0; i < DRAW_COUNT; i++)
+ for(unsigned int i = 0; i < DRAW_COUNT; i++)
{
if(drawCall[i]->vsDirtyConstI < index + count)
{
@@ -2552,16 +2552,16 @@
}
}
- for(int i = 0; i < count; i++)
+ for(unsigned int i = 0; i < count; i++)
{
VertexProcessor::setIntegerConstant(index + i, value);
value += 4;
}
}
- void Renderer::setVertexShaderConstantB(int index, const int *boolean, int count)
+ void Renderer::setVertexShaderConstantB(unsigned int index, const int *boolean, unsigned int count)
{
- for(int i = 0; i < DRAW_COUNT; i++)
+ for(unsigned int i = 0; i < DRAW_COUNT; i++)
{
if(drawCall[i]->vsDirtyConstB < index + count)
{
@@ -2569,7 +2569,7 @@
}
}
- for(int i = 0; i < count; i++)
+ for(unsigned int i = 0; i < count; i++)
{
VertexProcessor::setBooleanConstant(index + i, *boolean);
boolean++;
diff --git a/src/Renderer/Renderer.hpp b/src/Renderer/Renderer.hpp
index d796475..e33f828 100644
--- a/src/Renderer/Renderer.hpp
+++ b/src/Renderer/Renderer.hpp
@@ -237,13 +237,13 @@
Resource* vUniformBuffers[MAX_UNIFORM_BUFFER_BINDINGS];
Resource* transformFeedbackBuffers[MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS];
- int vsDirtyConstF;
- int vsDirtyConstI;
- int vsDirtyConstB;
+ unsigned int vsDirtyConstF;
+ unsigned int vsDirtyConstI;
+ unsigned int vsDirtyConstB;
- int psDirtyConstF;
- int psDirtyConstI;
- int psDirtyConstB;
+ unsigned int psDirtyConstF;
+ unsigned int psDirtyConstI;
+ unsigned int psDirtyConstB;
std::list<Query*> *queries;
@@ -371,13 +371,13 @@
void setPixelShader(const PixelShader *shader);
void setVertexShader(const VertexShader *shader);
- void setPixelShaderConstantF(int index, const float value[4], int count = 1);
- void setPixelShaderConstantI(int index, const int value[4], int count = 1);
- void setPixelShaderConstantB(int index, const int *boolean, int count = 1);
+ void setPixelShaderConstantF(unsigned int index, const float value[4], unsigned int count = 1);
+ void setPixelShaderConstantI(unsigned int index, const int value[4], unsigned int count = 1);
+ void setPixelShaderConstantB(unsigned int index, const int *boolean, unsigned int count = 1);
- void setVertexShaderConstantF(int index, const float value[4], int count = 1);
- void setVertexShaderConstantI(int index, const int value[4], int count = 1);
- void setVertexShaderConstantB(int index, const int *boolean, int count = 1);
+ void setVertexShaderConstantF(unsigned int index, const float value[4], unsigned int count = 1);
+ void setVertexShaderConstantI(unsigned int index, const int value[4], unsigned int count = 1);
+ void setVertexShaderConstantB(unsigned int index, const int *boolean, unsigned int count = 1);
// Viewport & Clipper
void setViewport(const Viewport &viewport);