OSDN Git Service

Fixed some function signatures
authorAlexis Hetu <sugoi@google.com>
Thu, 2 Jun 2016 15:50:47 +0000 (11:50 -0400)
committerAlexis Hétu <sugoi@google.com>
Fri, 4 Aug 2017 17:00:32 +0000 (17:00 +0000)
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>
src/OpenGL/libGLESv2/Device.cpp
src/OpenGL/libGLESv2/Device.hpp
src/Renderer/Renderer.cpp
src/Renderer/Renderer.hpp

index 53c794c..a4ba15a 100644 (file)
@@ -338,7 +338,7 @@ namespace es2
                draw(type, 0, primitiveCount);
        }
 
-       void Device::setPixelShader(PixelShader *pixelShader)
+       void Device::setPixelShader(const PixelShader *pixelShader)
        {
                this->pixelShader = pixelShader;
                pixelShaderDirty = true;
@@ -429,7 +429,7 @@ namespace es2
                scissorRect = rect;
        }
 
-       void Device::setVertexShader(VertexShader *vertexShader)
+       void Device::setVertexShader(const VertexShader *vertexShader)
        {
                this->vertexShader = vertexShader;
                vertexShaderDirty = true;
index 13a10de..17c7925 100644 (file)
@@ -62,14 +62,14 @@ namespace es2
                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 @@ namespace es2
                sw::Rect scissorRect;
                bool scissorEnable;
 
-               sw::PixelShader *pixelShader;
-               sw::VertexShader *vertexShader;
+               const sw::PixelShader *pixelShader;
+               const sw::VertexShader *vertexShader;
 
                bool pixelShaderDirty;
                unsigned int pixelShaderConstantsFDirty;
index 252d744..32e2027 100644 (file)
@@ -2474,9 +2474,9 @@ namespace sw
                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 @@ namespace sw
                        }
                }
 
-               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 @@ namespace sw
                        }
                }
 
-               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 @@ namespace sw
                        }
                }
 
-               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 @@ namespace sw
                        }
                }
 
-               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 @@ namespace sw
                        }
                }
 
-               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 @@ namespace sw
                        }
                }
 
-               for(int i = 0; i < count; i++)
+               for(unsigned int i = 0; i < count; i++)
                {
                        VertexProcessor::setBooleanConstant(index + i, *boolean);
                        boolean++;
index d796475..e33f828 100644 (file)
@@ -237,13 +237,13 @@ namespace sw
                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 @@ namespace sw
                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);