mState.stencilTestEnabled = false;
mState.stencilFunc = GL_ALWAYS;
mState.stencilRef = 0;
- mState.stencilMask = -1;
- mState.stencilWritemask = -1;
+ mState.stencilMask = 0xFFFFFFFFu;
+ mState.stencilWritemask = 0xFFFFFFFFu;
mState.stencilBackFunc = GL_ALWAYS;
mState.stencilBackRef = 0;
- mState.stencilBackMask = - 1;
- mState.stencilBackWritemask = -1;
+ mState.stencilBackMask = 0xFFFFFFFFu;
+ mState.stencilBackWritemask = 0xFFFFFFFFu;
mState.stencilFail = GL_KEEP;
mState.stencilPassDepthFail = GL_KEEP;
mState.stencilPassDepthPass = GL_KEEP;
qType = QUERY_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN;
break;
default:
- ASSERT(false);
+ UNREACHABLE(target);
+ return error(GL_INVALID_ENUM);
}
Query *queryObject = createQuery(query, target);
case GL_UNIFORM_BUFFER_SIZE: // indexed[n] 64-bit integer, initially 0
if(clientVersion >= 3)
{
- *params = mState.genericUniformBuffer->size();
+ *params = static_cast<T>(mState.genericUniformBuffer->size());
}
else
{
}
}
- GLuint Program::getAttributeLocation(const char *name)
+ GLint Program::getAttributeLocation(const char *name)
{
if(name)
{
// Returns the index of the texture image unit (0-19) corresponding to a sampler index (0-15 for the pixel shader and 0-3 for the vertex shader)
GLint Program::getSamplerMapping(sw::SamplerType type, unsigned int samplerIndex)
{
- GLuint logicalTextureUnit = -1;
+ GLint logicalTextureUnit = -1;
switch(type)
{
GLint Program::getUniformLocation(const std::string &name) const
{
- size_t subscript = GL_INVALID_INDEX;
+ int subscript = GL_INVALID_INDEX;
std::string baseName = es2::ParseUniformName(name, &subscript);
size_t numUniforms = uniformIndex.size();
GLuint Program::getUniformIndex(const std::string &name) const
{
- size_t subscript = GL_INVALID_INDEX;
+ int subscript = GL_INVALID_INDEX;
std::string baseName = es2::ParseUniformName(name, &subscript);
// The app is not allowed to specify array indices other than 0 for arrays of basic types
GLuint Program::getUniformBlockIndex(const std::string &name) const
{
- size_t subscript = GL_INVALID_INDEX;
+ int subscript = GL_INVALID_INDEX;
std::string baseName = es2::ParseUniformName(name, &subscript);
size_t numUniformBlocks = getActiveUniformBlockCount();
// Applies all the uniforms set for this program object to the device
void Program::applyUniforms()
{
- GLint numUniforms = uniformIndex.size();
+ GLint numUniforms = static_cast<GLint>(uniformIndex.size());
for(GLint location = 0; location < numUniforms; location++)
{
if(uniformIndex[location].element != 0)
return;
}
- unsigned int maxVaryings = transformFeedbackLinkedVaryings.size();
+ unsigned int maxVaryings = static_cast<unsigned int>(transformFeedbackLinkedVaryings.size());
switch(transformFeedbackBufferMode)
{
case GL_SEPARATE_ATTRIBS:
// written by a vertex shader are written, interleaved, into the buffer object
// bound to the first transform feedback binding point (index = 0).
sw::Resource* resource = transformFeedbackBuffers[0].get()->getResource();
- int componentStride = totalLinkedVaryingsComponents;
+ int componentStride = static_cast<int>(totalLinkedVaryingsComponents);
int baseOffset = transformFeedbackBuffers[0].getOffset() + (transformFeedback->vertexOffset() * componentStride * sizeof(float));
maxVaryings = sw::min(maxVaryings, (unsigned int)sw::MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS);
- size_t totalComponents = 0;
+ int totalComponents = 0;
for(unsigned int index = 0; index < maxVaryings; ++index)
{
int size = transformFeedbackLinkedVaryings[index].size;
for(const std::string &indexedTfVaryingName : transformFeedbackVaryings)
{
- size_t subscript = GL_INVALID_INDEX;
+ int subscript = GL_INVALID_INDEX;
std::string tfVaryingName = es2::ParseUniformName(indexedTfVaryingName, &subscript);
bool hasSubscript = (subscript != GL_INVALID_INDEX);
return false;
}
- size_t size = hasSubscript ? 1 : varying.size();
+ int size = hasSubscript ? 1 : varying.size();
- size_t rowCount = VariableRowCount(varying.type);
- size_t colCount = VariableColumnCount(varying.type);
- size_t componentCount = rowCount * colCount * size;
+ int rowCount = VariableRowCount(varying.type);
+ int colCount = VariableColumnCount(varying.type);
+ int componentCount = rowCount * colCount * size;
if(transformFeedbackBufferMode == GL_SEPARATE_ATTRIBS &&
componentCount > sw::MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS)
{
if(location == -1) // Not previously defined
{
uniforms.push_back(uniform);
- size_t index = uniforms.size() - 1;
+ unsigned int index = static_cast<unsigned int>(uniforms.size() - 1);
for(int i = 0; i < uniform->size(); i++)
{
if(length)
{
- *length = strlen(name);
+ *length = static_cast<GLsizei>(strlen(name));
}
}
if(length)
{
- *length = strlen(name);
+ *length = static_cast<GLsizei>(strlen(name));
}
}
if(length)
{
- *length = strlen(name);
+ *length = static_cast<GLsizei>(strlen(name));
}
}
}
GLint Program::getActiveUniformBlockMaxLength() const
{
- size_t maxLength = 0;
+ GLint maxLength = 0;
if(isLinked())
{
const UniformBlock &uniformBlock = *uniformBlocks[uniformBlockIndex];
if(!uniformBlock.name.empty())
{
- size_t length = uniformBlock.name.length() + 1;
+ GLint length = static_cast<GLint>(uniformBlock.name.length() + 1);
// Counting in "[0]".
- const int arrayLength = (uniformBlock.isArrayElement() ? 3 : 0);
+ const GLint arrayLength = (uniformBlock.isArrayElement() ? 3 : 0);
maxLength = std::max(length + arrayLength, maxLength);
}
scale = vector(0xFFFFFF, 0.0f, 0.0f, 0.0f);
break;
case FORMAT_D32:
- scale = vector(0xFFFFFFFF, 0.0f, 0.0f, 0.0f);
+ scale = vector(static_cast<float>(0xFFFFFFFF), 0.0f, 0.0f, 0.0f);
break;
case FORMAT_D32F:
case FORMAT_D32F_COMPLEMENTARY:
switch(state.sourceFormat)
{
case FORMAT_A32B32G32R32I:
- unscale = vector(0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF, 0x7FFFFFFF);
+ unscale = replicate(static_cast<float>(0x7FFFFFFF));
break;
case FORMAT_A32B32G32R32UI:
- unscale = vector(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
+ unscale = replicate(static_cast<float>(0xFFFFFFFF));
break;
default:
return false;