/external/swiftshader/src/OpenGL/libGL/ |
H A D | Program.cpp | 317 else if(targetUniform->type == GL_BOOL) 601 else if(targetUniform->type == GL_BOOL) 807 case GL_BOOL: 855 case GL_BOOL: 916 case GL_BOOL: applyUniform1bv(location, size, b); break; 222 ASSERT(samplerIndex < sizeof(samplersPS) / sizeof(samplersPS[0])); if(samplersPS[samplerIndex].active) { logicalTextureUnit = samplersPS[samplerIndex].logicalTextureUnit; } break; case sw::SAMPLER_VERTEX: ASSERT(samplerIndex < sizeof(samplersVS) / sizeof(samplersVS[0])); if(samplersVS[samplerIndex].active) { logicalTextureUnit = samplersVS[samplerIndex].logicalTextureUnit; } break; default: UNREACHABLE(type); } if(logicalTextureUnit < MAX_COMBINED_TEXTURE_IMAGE_UNITS) { return logicalTextureUnit; } return -1; } TextureType Program::getSamplerTextureType(sw::SamplerType type, unsigned int samplerIndex) { switch(type) { case sw::SAMPLER_PIXEL: ASSERT(samplerIndex < sizeof(samplersPS)/sizeof(samplersPS[0])); ASSERT(samplersPS[samplerIndex].active); return samplersPS[samplerIndex].textureType; case sw::SAMPLER_VERTEX: ASSERT(samplerIndex < sizeof(samplersVS)/sizeof(samplersVS[0])); ASSERT(samplersVS[samplerIndex].active); return samplersVS[samplerIndex].textureType; default: UNREACHABLE(type); } return TEXTURE_2D; } GLint Program::getUniformLocation(std::string name) { int subscript = 0; size_t open = name.find_last_of(�); size_t close = name.find_last_of(�); if(open != std::string::npos && close == name.length() - 1) { subscript = atoi(name.substr(open + 1).c_str()); name.erase(open); } unsigned int numUniforms = uniformIndex.size(); for(unsigned int location = 0; location < numUniforms; location++) { if(uniformIndex[location].name == name && uniformIndex[location].element == subscript) { return location; } } return -1; } bool Program::setUniform1fv(GLint location, GLsizei count, const GLfloat* v) { if(location < 0 || location >= (int)uniformIndex.size()) { return false; } Uniform *targetUniform = uniforms[uniformIndex[location].index]; targetUniform->dirty = true; int size = targetUniform->size(); if(size == 1 && count > 1) { return false; } count = std::min(size - (int)uniformIndex[location].element, count); if(targetUniform->type == GL_FLOAT) { memcpy(targetUniform->data + uniformIndex[location].element * sizeof(GLfloat), v, sizeof(GLfloat) * count); } else if(targetUniform->type == GL_BOOL) argument
|
/external/swiftshader/src/OpenGL/libGLESv2/ |
H A D | Program.cpp | 526 static GLenum boolType[] = { GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4 }; 737 else if(targetUniform->type == GL_BOOL) 769 static GLenum boolType[] = { GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4 }; 855 else if(targetUniform->type == GL_BOOL) 887 static GLenum boolType[] = { GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4 }; 967 case GL_BOOL: 1025 case GL_BOOL: 1074 case GL_BOOL: 1137 case GL_BOOL: applyUniform1bv(device, location, size, b); break; 326 ASSERT(samplerIndex < sizeof(samplersPS) / sizeof(samplersPS[0])); if(samplersPS[samplerIndex].active) { logicalTextureUnit = samplersPS[samplerIndex].logicalTextureUnit; } break; case sw::SAMPLER_VERTEX: ASSERT(samplerIndex < sizeof(samplersVS) / sizeof(samplersVS[0])); if(samplersVS[samplerIndex].active) { logicalTextureUnit = samplersVS[samplerIndex].logicalTextureUnit; } break; default: UNREACHABLE(type); } if(logicalTextureUnit < MAX_COMBINED_TEXTURE_IMAGE_UNITS) { return logicalTextureUnit; } return -1; } TextureType Program::getSamplerTextureType(sw::SamplerType type, unsigned int samplerIndex) { switch(type) { case sw::SAMPLER_PIXEL: ASSERT(samplerIndex < sizeof(samplersPS)/sizeof(samplersPS[0])); ASSERT(samplersPS[samplerIndex].active); return samplersPS[samplerIndex].textureType; case sw::SAMPLER_VERTEX: ASSERT(samplerIndex < sizeof(samplersVS)/sizeof(samplersVS[0])); ASSERT(samplersVS[samplerIndex].active); return samplersVS[samplerIndex].textureType; default: UNREACHABLE(type); } return TEXTURE_2D; } bool Program::isUniformDefined(const std::string &name) const { unsigned int subscript = GL_INVALID_INDEX; std::string baseName = es2::ParseUniformName(name, &subscript); size_t numUniforms = uniformIndex.size(); for(size_t location = 0; location < numUniforms; location++) { const unsigned int index = uniformIndex[location].index; if((uniformIndex[location].name == baseName) && ((index == GL_INVALID_INDEX) || ((uniforms[index]->isArray() && uniformIndex[location].element == subscript) || (subscript == GL_INVALID_INDEX)))) { return true; } } return false; } GLint Program::getUniformLocation(const std::string &name) const { unsigned int subscript = GL_INVALID_INDEX; std::string baseName = es2::ParseUniformName(name, &subscript); size_t numUniforms = uniformIndex.size(); for(size_t location = 0; location < numUniforms; location++) { const unsigned int index = uniformIndex[location].index; if((index != GL_INVALID_INDEX) && (uniformIndex[location].name == baseName) && ((uniforms[index]->isArray() && uniformIndex[location].element == subscript) || (subscript == GL_INVALID_INDEX))) { return (GLint)location; } } return -1; } GLuint Program::getUniformIndex(const std::string &name) const { unsigned int subscript = GL_INVALID_INDEX; std::string baseName = es2::ParseUniformName(name, &subscript); if(subscript != 0 && subscript != GL_INVALID_INDEX) { return GL_INVALID_INDEX; } size_t numUniforms = uniforms.size(); for(GLuint index = 0; index < numUniforms; index++) { if(uniforms[index]->name == baseName) { if(uniforms[index]->isArray() || subscript == GL_INVALID_INDEX) { return index; } } } return GL_INVALID_INDEX; } void Program::getActiveUniformBlockiv(GLuint uniformBlockIndex, GLenum pname, GLint *params) const { ASSERT(uniformBlockIndex < getActiveUniformBlockCount()); const UniformBlock &uniformBlock = *uniformBlocks[uniformBlockIndex]; switch(pname) { case GL_UNIFORM_BLOCK_DATA_SIZE: *params = static_cast<GLint>(uniformBlock.dataSize); break; case GL_UNIFORM_BLOCK_NAME_LENGTH: *params = static_cast<GLint>(uniformBlock.name.size() + 1 + (uniformBlock.isArrayElement() ? 3 : 0)); break; case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS: *params = static_cast<GLint>(uniformBlock.memberUniformIndexes.size()); break; case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: { for(unsigned int blockMemberIndex = 0; blockMemberIndex < uniformBlock.memberUniformIndexes.size(); blockMemberIndex++) { params[blockMemberIndex] = static_cast<GLint>(uniformBlock.memberUniformIndexes[blockMemberIndex]); } } break; case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: *params = static_cast<GLint>(uniformBlock.isReferencedByVertexShader()); break; case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: *params = static_cast<GLint>(uniformBlock.isReferencedByFragmentShader()); break; default: UNREACHABLE(pname); } } GLuint Program::getUniformBlockIndex(const std::string &name) const { unsigned int subscript = GL_INVALID_INDEX; std::string baseName = es2::ParseUniformName(name, &subscript); size_t numUniformBlocks = getActiveUniformBlockCount(); for(GLuint blockIndex = 0; blockIndex < numUniformBlocks; blockIndex++) { const UniformBlock &uniformBlock = *uniformBlocks[blockIndex]; if(uniformBlock.name == baseName) { const bool arrayElementZero = (subscript == GL_INVALID_INDEX && uniformBlock.elementIndex == 0); if(subscript == uniformBlock.elementIndex || arrayElementZero) { return blockIndex; } } } return GL_INVALID_INDEX; } void Program::bindUniformBlock(GLuint uniformBlockIndex, GLuint uniformBlockBinding) { if(uniformBlockIndex >= getActiveUniformBlockCount()) { return error(GL_INVALID_VALUE); } uniformBlockBindings[uniformBlockIndex] = uniformBlockBinding; } GLuint Program::getUniformBlockBinding(GLuint uniformBlockIndex) const { if(uniformBlockIndex >= getActiveUniformBlockCount()) { return error(GL_INVALID_VALUE, GL_INVALID_INDEX); } return uniformBlockBindings[uniformBlockIndex]; } void Program::resetUniformBlockBindings() { for(unsigned int blockId = 0; blockId < MAX_UNIFORM_BUFFER_BINDINGS; blockId++) { uniformBlockBindings[blockId] = 0; } } bool Program::setUniformfv(GLint location, GLsizei count, const GLfloat *v, int numElements) { ASSERT(numElements >= 1 && numElements <= 4); static GLenum floatType[] = { GL_FLOAT, GL_FLOAT_VEC2, GL_FLOAT_VEC3, GL_FLOAT_VEC4 }; static GLenum boolType[] = { GL_BOOL, GL_BOOL_VEC2, GL_BOOL_VEC3, GL_BOOL_VEC4 }; if(location < 0 || location >= (int)uniformIndex.size() || (uniformIndex[location].index == GL_INVALID_INDEX)) { return false; } Uniform *targetUniform = uniforms[uniformIndex[location].index]; targetUniform->dirty = true; int size = targetUniform->size(); if(size == 1 && count > 1) { return false; } count = std::min(size - (int)uniformIndex[location].element, count); int index = numElements - 1; if(targetUniform->type == floatType[index]) { memcpy(targetUniform->data + uniformIndex[location].element * sizeof(GLfloat)* numElements, v, numElements * sizeof(GLfloat) * count); } else if(targetUniform->type == boolType[index]) argument
|
/external/swiftshader/third_party/PowerVR_SDK/Builds/Include/GLES2/ |
H A D | gl2.h | 385 #define GL_BOOL 0x8B56
macro
|
/external/mesa3d/include/GLES2/ |
H A D | gl2.h | 318 #define GL_BOOL 0x8B56 macro
|
/external/swiftshader/include/GLES2/ |
H A D | gl2.h | 320 #define GL_BOOL 0x8B56 macro
|
/external/swiftshader/third_party/PowerVR_SDK/Builds/Include/GLES3/ |
H A D | gl3.h | 409 #define GL_BOOL 0x8B56
macro
|
/external/mesa3d/include/GLES3/ |
H A D | gl3.h | 318 #define GL_BOOL 0x8B56 macro
|
H A D | gl31.h | 318 #define GL_BOOL 0x8B56 macro
|
H A D | gl32.h | 318 #define GL_BOOL 0x8B56 macro
|
/external/swiftshader/include/GLES3/ |
H A D | gl3.h | 320 #define GL_BOOL 0x8B56 macro
|
/external/mesa3d/include/GL/ |
H A D | glcorearb.h | 742 #define GL_BOOL 0x8B56 macro
|
H A D | glext.h | 612 #define GL_BOOL 0x8B56 macro
|
/external/swiftshader/include/GL/ |
H A D | glcorearb.h | 742 #define GL_BOOL 0x8B56 macro
|
H A D | glext.h | 612 #define GL_BOOL 0x8B56 macro
|
/external/robolectric/v1/lib/main/ |
H A D | android.jar | META-INF/ META-INF/MANIFEST.MF com/ com/android/ com/android/internal/ com/android/internal/util/ ... |
/external/robolectric/v3/runtime/ |
H A D | android-all-4.1.2_r1-robolectric-0.jar | META-INF/ META-INF/MANIFEST.MF android/ android/accessibilityservice/ android/accessibilityservice/AccessibilityService$1.class ... |
H A D | android-all-4.2.2_r1.2-robolectric-0.jar | META-INF/ META-INF/MANIFEST.MF android/ android/accessibilityservice/ android/accessibilityservice/AccessibilityService$1.class ... |
H A D | android-all-4.3_r2-robolectric-0.jar | META-INF/ META-INF/MANIFEST.MF android/ android/accessibilityservice/ android/accessibilityservice/AccessibilityService$1.class ... |
H A D | android-all-4.4_r1-robolectric-1.jar | META-INF/ META-INF/MANIFEST.MF com/ com/google/ com/google/android/ com/google/android/collect/ ... |
H A D | android-all-5.0.0_r2-robolectric-1.jar | META-INF/ META-INF/MANIFEST.MF com/ com/google/ com/google/android/ com/google/android/collect/ ... |
H A D | android-all-5.1.1_r9-robolectric-1.jar | META-INF/ META-INF/MANIFEST.MF com/ com/google/ com/google/android/ com/google/android/collect/ ... |