Commit bffe803c by Alexis Hetu Committed by Alexis Hétu

Fixed libGLESv2 conversion warnings

There were only a handful of integer conversion warnings in libGLESv2, so I fixed them rather than silencing them. Change-Id: I94a7f2d4e4c34a48a8f128e6303778ef23ac45c9 Reviewed-on: https://swiftshader-review.googlesource.com/7132Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 45ce11aa
...@@ -1250,7 +1250,7 @@ void Context::bindIndexedUniformBuffer(GLuint buffer, GLuint index, GLintptr off ...@@ -1250,7 +1250,7 @@ void Context::bindIndexedUniformBuffer(GLuint buffer, GLuint index, GLintptr off
mResourceManager->checkBufferAllocation(buffer); mResourceManager->checkBufferAllocation(buffer);
Buffer* bufferObject = getBuffer(buffer); Buffer* bufferObject = getBuffer(buffer);
mState.uniformBuffers[index].set(bufferObject, offset, size); mState.uniformBuffers[index].set(bufferObject, static_cast<int>(offset), static_cast<int>(size));
} }
void Context::bindGenericTransformFeedbackBuffer(GLuint buffer) void Context::bindGenericTransformFeedbackBuffer(GLuint buffer)
...@@ -2289,7 +2289,7 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const ...@@ -2289,7 +2289,7 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const
case GL_UNIFORM_BUFFER_START: // indexed[n] 64-bit integer, initially 0 case GL_UNIFORM_BUFFER_START: // indexed[n] 64-bit integer, initially 0
if(clientVersion >= 3) if(clientVersion >= 3)
{ {
*params = mState.genericUniformBuffer->offset(); *params = static_cast<T>(mState.genericUniformBuffer->offset());
} }
else else
{ {
......
...@@ -121,7 +121,7 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLuint start, GLuint end, ...@@ -121,7 +121,7 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLuint start, GLuint end,
computeRange(type, indices, count, &translated->minIndex, &translated->maxIndex); computeRange(type, indices, count, &translated->minIndex, &translated->maxIndex);
translated->indexBuffer = staticBuffer; translated->indexBuffer = staticBuffer;
translated->indexOffset = offset; translated->indexOffset = static_cast<unsigned int>(offset);
} }
else else
{ {
......
...@@ -120,7 +120,7 @@ void TransformFeedback::setBuffer(GLuint index, Buffer* buffer) ...@@ -120,7 +120,7 @@ void TransformFeedback::setBuffer(GLuint index, Buffer* buffer)
void TransformFeedback::setBuffer(GLuint index, Buffer* buffer, GLintptr offset, GLsizeiptr size) void TransformFeedback::setBuffer(GLuint index, Buffer* buffer, GLintptr offset, GLsizeiptr size)
{ {
mBuffer[index].set(buffer, offset, size); mBuffer[index].set(buffer, static_cast<int>(offset), static_cast<int>(size));
} }
void TransformFeedback::detachBuffer(GLuint buffer) void TransformFeedback::detachBuffer(GLuint buffer)
......
...@@ -165,7 +165,7 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat ...@@ -165,7 +165,7 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
if(staticBuffer) if(staticBuffer)
{ {
translated[i].vertexBuffer = staticBuffer; translated[i].vertexBuffer = staticBuffer;
translated[i].offset = firstVertexIndex * attrib.stride() + attrib.mOffset; translated[i].offset = firstVertexIndex * attrib.stride() + static_cast<int>(attrib.mOffset);
translated[i].stride = isInstanced ? 0 : attrib.stride(); translated[i].stride = isInstanced ? 0 : attrib.stride();
} }
else else
......
...@@ -164,7 +164,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr ...@@ -164,7 +164,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<BrowseInformation>true</BrowseInformation> <BrowseInformation>true</BrowseInformation>
<TreatWarningAsError>true</TreatWarningAsError> <TreatWarningAsError>true</TreatWarningAsError>
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>dxguid.lib;WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>dxguid.lib;WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
...@@ -237,7 +237,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr ...@@ -237,7 +237,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<IntrinsicFunctions>false</IntrinsicFunctions> <IntrinsicFunctions>false</IntrinsicFunctions>
<TreatWarningAsError>true</TreatWarningAsError> <TreatWarningAsError>true</TreatWarningAsError>
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>dxguid.lib;WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>dxguid.lib;WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
...@@ -311,7 +311,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr ...@@ -311,7 +311,7 @@ copy "$(OutDir)libGLESv2.dll" "$(SolutionDir)lib\$(Configuration)_$(Platform)\tr
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<IntrinsicFunctions>false</IntrinsicFunctions> <IntrinsicFunctions>false</IntrinsicFunctions>
<TreatWarningAsError>true</TreatWarningAsError> <TreatWarningAsError>true</TreatWarningAsError>
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>dxguid.lib;WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>dxguid.lib;WS2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment