Lines Matching refs:glu
49 static glw::GLenum getProgramDefaultBlockInterfaceFromStorage (glu::Storage storage)
53 case glu::STORAGE_IN:
54 case glu::STORAGE_PATCH_IN:
57 case glu::STORAGE_OUT:
58 case glu::STORAGE_PATCH_OUT:
61 case glu::STORAGE_UNIFORM:
70 static bool isBufferBackedInterfaceBlockStorage (glu::Storage storage)
72 return storage == glu::STORAGE_BUFFER || storage == glu::STORAGE_UNIFORM;
75 const char* getRequiredExtensionForStage (glu::ShaderType stage)
79 case glu::SHADERTYPE_COMPUTE:
80 case glu::SHADERTYPE_VERTEX:
81 case glu::SHADERTYPE_FRAGMENT:
84 case glu::SHADERTYPE_GEOMETRY:
87 case glu::SHADERTYPE_TESSELLATION_CONTROL:
88 case glu::SHADERTYPE_TESSELLATION_EVALUATION:
97 static int getTypeSize (glu::DataType type)
99 if (type == glu::TYPE_FLOAT)
101 else if (type == glu::TYPE_INT || type == glu::TYPE_UINT)
103 else if (type == glu::TYPE_BOOL)
110 static int getVarTypeSize (const glu::VarType& type)
115 return glu::getDataTypeScalarSize(type.getBasicType()) * getTypeSize(glu::getDataTypeScalarType(type.getBasicType()));
127 if (type.getArraySize() == glu::VarType::UNSIZED_ARRAY)
139 static glu::MatrixOrder getMatrixOrderFromPath (const std::vector<VariablePathComponent>& path)
141 glu::MatrixOrder order = glu::MATRIXORDER_LAST;
146 glu::MatrixOrder matOrder;
153 matOrder = glu::MATRIXORDER_LAST;
157 return glu::MATRIXORDER_LAST;
160 if (matOrder != glu::MATRIXORDER_LAST)
182 const glu::RenderContext& m_renderContext;
185 const glu::ContextInfo& m_contextInfo;
206 if(glu::contextSupports(m_renderContext.getType(), glu::ApiType::es(3, 2)) ||
207 glu::contextSupports(m_renderContext.getType(), glu::ApiType::core(4, 5)))
251 const glu::VarType* variable = (path.back().isVariableType()) ? (path.back().getVariableType()) : (DE_NULL);
290 virtual void validateSingleBlock (const glu::InterfaceBlock& block, const std::vector<int>& instanceIndex, const std::string& resource, glw::GLint propValue, const std::string& implementationName) const = 0;
306 glu::VarTokenizer tokenizer (resource.c_str());
313 while (tokenizer.getToken() == glu::VarTokenizer::TOKEN_LEFT_BRACKET)
316 DE_ASSERT(tokenizer.getToken() == glu::VarTokenizer::TOKEN_NUMBER);
321 DE_ASSERT(tokenizer.getToken() == glu::VarTokenizer::TOKEN_RIGHT_BRACKET);
327 DE_ASSERT(tokenizer.getToken() == glu::VarTokenizer::TOKEN_END);
337 const glu::InterfaceBlock& block = shader->getDefaultBlock().interfaceBlocks[blockNdx];
372 return de::toString(glu::getShaderVarTypeStr(propVal));
377 const glu::VarType* variable = path.back().getVariableType();
382 m_testCtx.getLog() << tcu::TestLog::Message << "Verifying type, expecting " << glu::getDataTypeName(variable->getBasicType()) << tcu::TestLog::EndMessage;
384 if (variable->getBasicType() != glu::getDataTypeFromGLType(propValue))
386 m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeName(glu::getDataTypeFromGLType(propValue)) << tcu::TestLog::EndMessage;
398 glu::DataType type;
401 { "gl_Position", glu::TYPE_FLOAT_VEC4 },
402 { "gl_FragCoord", glu::TYPE_FLOAT_VEC4 },
403 { "gl_PerVertex.gl_Position", glu::TYPE_FLOAT_VEC4 },
404 { "gl_VertexID", glu::TYPE_INT },
405 { "gl_InvocationID", glu::TYPE_INT },
406 { "gl_NumWorkGroups", glu::TYPE_UINT_VEC3 },
407 { "gl_FragDepth", glu::TYPE_FLOAT },
408 { "gl_TessLevelOuter[0]", glu::TYPE_FLOAT },
409 { "gl_TessLevelInner[0]", glu::TYPE_FLOAT },
416 m_testCtx.getLog() << tcu::TestLog::Message << "Verifying type, expecting " << glu::getDataTypeName(builtins[ndx].type) << tcu::TestLog::EndMessage;
418 if (glu::getDataTypeFromGLType(propValue) != builtins[ndx].type)
420 m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeName(glu::getDataTypeFromGLType(propValue)) << tcu::TestLog::EndMessage;
454 const bool inUnsizedArray = isArray && (enclosingcomponent.getVariableType()->getArraySize() == glu::VarType::UNSIZED_ARRAY);
531 const bool isAtomicCounter = glu::isDataTypeAtomicCounter(component.getVariableType()->getBasicType()); // atomic counters are buffer backed with a stride of 4 basic machine units
539 const int elementSize = glu::getDataTypeScalarSize(component.getVariableType()->getBasicType()) * getTypeSize(glu::getDataTypeScalarType(component.getVariableType()->getBasicType()));
605 const glw::GLenum interface = (firstComponent.getInterfaceBlock()->storage == glu::STORAGE_UNIFORM) ? (GL_UNIFORM_BLOCK) :
606 (firstComponent.getInterfaceBlock()->storage == glu::STORAGE_BUFFER) ? (GL_SHADER_STORAGE_BLOCK) :
651 return de::toString(glu::getBooleanStr(propVal));
660 const bool isMatrix = glu::isDataTypeMatrix(component.getVariableType()->getBasicType());
661 const int expected = (isBufferBlock && isMatrix && getMatrixOrderFromPath(path) == glu::MATRIXORDER_ROW_MAJOR) ? (1) : (0);
694 const bool isMatrix = glu::isDataTypeMatrix(component.getVariableType()->getBasicType());
702 const bool columnMajor = getMatrixOrderFromPath(path) != glu::MATRIXORDER_ROW_MAJOR;
703 const int numMajorElements = (columnMajor) ? (glu::getDataTypeMatrixNumRows(component.getVariableType()->getBasicType())) : (glu::getDataTypeMatrixNumColumns(component.getVariableType()->getBasicType()));
704 const int majorSize = numMajorElements * getTypeSize(glu::getDataTypeScalarType(component.getVariableType()->getBasicType()));
716 const int matrixStride = (!isBufferBlock && !glu::isDataTypeAtomicCounter(component.getVariableType()->getBasicType())) ? (-1) : (0);
746 if (!glu::isDataTypeAtomicCounter(path.back().getVariableType()->getBasicType()))
796 static int getVariableLocationLength (const glu::VarType& type)
800 if (glu::isDataTypeMatrix(type.getBasicType()))
801 return glu::getDataTypeMatrixNumColumns(type.getBasicType());
854 const glu::InterfaceBlock* block = path.front().getInterfaceBlock();
877 const glu::VariableDeclaration* varDecl = (path[0].isInterfaceBlock()) ? (path[1].getDeclaration()) : (path[0].getDeclaration());
879 if (path.front().isInterfaceBlock() && path.front().getInterfaceBlock()->storage == glu::STORAGE_UNIFORM)
884 else if (path.front().isInterfaceBlock() && (path.front().getInterfaceBlock()->storage == glu::STORAGE_IN ||
885 path.front().getInterfaceBlock()->storage == glu::STORAGE_OUT ||
886 path.front().getInterfaceBlock()->storage == glu::STORAGE_PATCH_IN ||
887 path.front().getInterfaceBlock()->storage == glu::STORAGE_PATCH_OUT))
892 else if (varDecl->storage == glu::STORAGE_UNIFORM)
897 else if (varDecl->storage == glu::STORAGE_IN ||
898 varDecl->storage == glu::STORAGE_OUT ||
899 varDecl->storage == glu::STORAGE_PATCH_IN ||
900 varDecl->storage == glu::STORAGE_PATCH_OUT)
914 const bool isAtomicCounterUniform = glu::isDataTypeAtomicCounter(path.back().getVariableType()->getBasicType());
915 const bool isUniformBlockVariable = path.front().isInterfaceBlock() && path.front().getInterfaceBlock()->storage == glu::STORAGE_UNIFORM;
916 const bool isVertexShader = m_filter.getShaderTypeBits() == (1u << glu::SHADERTYPE_VERTEX);
917 const bool isFragmentShader = m_filter.getShaderTypeBits() == (1u << glu::SHADERTYPE_FRAGMENT);
918 const glu::Storage storage = (path.front().isInterfaceBlock()) ? (path.front().getInterfaceBlock()->storage) : (path.front().getDeclaration()->storage);
919 const bool isInputVariable = (storage == glu::STORAGE_IN || storage == glu::STORAGE_PATCH_IN);
920 const bool isOutputVariable = (storage == glu::STORAGE_OUT || storage == glu::STORAGE_PATCH_OUT);
1103 const bool isAtomicCounterUniform = glu::isDataTypeAtomicCounter(path.back().getVariableType()->getBasicType());
1136 VariableReferencedByShaderValidator (Context& context, glu::ShaderType shaderType, const VariableSearchFilter& searchFilter);
1143 const glu::ShaderType m_shaderType;
1146 VariableReferencedByShaderValidator::VariableReferencedByShaderValidator (Context& context, glu::ShaderType shaderType, const VariableSearchFilter& searchFilter)
1151 DE_ASSERT(m_shaderType < glu::SHADERTYPE_LAST);
1156 return de::toString(glu::getBooleanStr(propVal));
1168 << "Verifying referenced by " << glu::getShaderTypeName(m_shaderType) << " shader, expecting "
1174 m_testCtx.getLog() << tcu::TestLog::Message << "\tError, invalid referenced_by_" << glu::getShaderTypeName(m_shaderType) << ", got " << propValue << tcu::TestLog::EndMessage;
1175 setError("referenced_by_" + std::string(glu::getShaderTypeName(m_shaderType)) + " invalid");
1184 void validateSingleBlock (const glu::InterfaceBlock& block, const std::vector<int>& instanceIndex, const std::string& resource, glw::GLint propValue, const std::string& implementationName) const;
1192 void BlockNameLengthValidator::validateSingleBlock (const glu::InterfaceBlock& block, const std::vector<int>& instanceIndex, const std::string& resource, glw::GLint propValue, const std::string& implementationName) const
1213 void validateSingleBlock (const glu::InterfaceBlock& block, const std::vector<int>& instanceIndex, const std::string& resource, glw::GLint propValue, const std::string& implementationName) const;
1221 void BufferBindingValidator::validateSingleBlock (const glu::InterfaceBlock& block, const std::vector<int>& instanceIndex, const std::string& resource, glw::GLint propValue, const std::string& implementationName) const
1261 BlockReferencedByShaderValidator (Context& context, glu::ShaderType shaderType, const VariableSearchFilter& searchFilter);
1268 const glu::ShaderType m_shaderType;
1271 BlockReferencedByShaderValidator::BlockReferencedByShaderValidator (Context& context, glu::ShaderType shaderType, const VariableSearchFilter& searchFilter)
1276 DE_ASSERT(m_shaderType < glu::SHADERTYPE_LAST);
1281 return de::toString(glu::getBooleanStr(propVal));
1286 const std::string blockName = glu::parseVariableName(resource.c_str());
1299 const glu::InterfaceBlock& block = shader->getDefaultBlock().interfaceBlocks[blockNdx];
1308 << "Verifying referenced by " << glu::getShaderTypeName(m_shaderType) << " shader, expecting "
1314 m_testCtx.getLog() << tcu::TestLog::Message << "\tError, invalid referenced_by_" << glu::getShaderTypeName(m_shaderType) << ", got " << propValue << tcu::TestLog::EndMessage;
1315 setError("referenced_by_" + std::string(glu::getShaderTypeName(m_shaderType)) + " invalid");
1337 DE_ASSERT(path.front().isInterfaceBlock() && path.front().getInterfaceBlock()->storage == glu::STORAGE_BUFFER);
1351 else if (path[1].getDeclaration()->varType.getArraySize() == glu::VarType::UNSIZED_ARRAY)
1386 DE_ASSERT(path.front().isInterfaceBlock() && path.front().getInterfaceBlock()->storage == glu::STORAGE_BUFFER);
1461 if (!findProgramVariablePathByPathName(path, program, varyingName, VariableSearchFilter::createShaderTypeStorageFilter(getProgramTransformFeedbackStage(program), glu::STORAGE_OUT)))
1486 if (!findProgramVariablePathByPathName(path, program, resource, VariableSearchFilter::createShaderTypeStorageFilter(getProgramTransformFeedbackStage(program), glu::STORAGE_OUT)))
1601 glu::DataType varType = glu::TYPE_INVALID;
1604 varType = glu::TYPE_FLOAT_VEC4;
1608 m_testCtx.getLog() << tcu::TestLog::Message << "Verifying type, expecting " << glu::getDataTypeName(varType) << tcu::TestLog::EndMessage;
1609 if (glu::getDataTypeFromGLType(propValue) != varType)
1611 m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeName(glu::getDataTypeFromGLType(propValue)) << tcu::TestLog::EndMessage;
1624 const glu::VarType& variable = *path.back().getVariableType();
1625 const glu::VarType& elementType = (variable.isArrayType()) ? (variable.getElementType()) : (variable);
1629 m_testCtx.getLog() << tcu::TestLog::Message << "Verifying type, expecting " << glu::getDataTypeName(elementType.getBasicType()) << tcu::TestLog::EndMessage;
1630 if (elementType.getBasicType() != glu::getDataTypeFromGLType(propValue))
1632 m_testCtx.getLog() << tcu::TestLog::Message << "\tError, got " << glu::getDataTypeName(glu::getDataTypeFromGLType(propValue)) << tcu::TestLog::EndMessage;
1654 return de::toString(glu::getBooleanStr(propVal));
1659 const glu::Storage storage = (path.front().isInterfaceBlock()) ? (path.front().getInterfaceBlock()->storage) : (path.front().getDeclaration()->storage);
1660 const int expected = (storage == glu::STORAGE_PATCH_IN || storage == glu::STORAGE_PATCH_OUT) ? (1) : (0);
1768 DE_STATIC_ASSERT(glu::STORAGE_LAST < 32);
1769 DE_STATIC_ASSERT(glu::SHADERTYPE_LAST < 32);
1779 validStorageBits = (1u << glu::STORAGE_IN) | (1u << glu::STORAGE_PATCH_IN);
1784 validStorageBits = (1u << glu::STORAGE_OUT) | (1u << glu::STORAGE_PATCH_OUT);
1789 validStorageBits = (1u << glu::STORAGE_OUT);
1794 validStorageBits = (1u << glu::STORAGE_UNIFORM);
1799 validStorageBits = (1u << glu::STORAGE_BUFFER);
1816 const glu::InterfaceBlock& block = shader->getDefaultBlock().interfaceBlocks[blockNdx];
1833 DE_STATIC_ASSERT(glu::STORAGE_LAST < 32);
1834 DE_STATIC_ASSERT(glu::SHADERTYPE_LAST < 32);
1844 validStorageBits = (1u << glu::STORAGE_IN) | (1u << glu::STORAGE_PATCH_IN);
1849 validStorageBits = (1u << glu::STORAGE_OUT) | (1u << glu::STORAGE_PATCH_OUT);
1854 validStorageBits = (1u << glu::STORAGE_OUT);
1859 validStorageBits = (1u << glu::STORAGE_UNIFORM);
1864 validStorageBits = (1u << glu::STORAGE_BUFFER);
1881 const glu::InterfaceBlock& block = shader->getDefaultBlock().interfaceBlocks[blockNdx];
2074 message << "\t" << glu::getProgramResourcePropertyName(props[propNdx]) << ":\t" << validators[propNdx]->getHumanReadablePropertyString(propValues[propNdx]) << "\n";
2091 if (glu::contextSupports(type, glu::ApiType::es(3, 2)) ||
2092 glu::contextSupports(type, glu::ApiType::core(4, 5)))
2097 if (programDefinition->hasStage(glu::SHADERTYPE_TESSELLATION_CONTROL) ||
2098 programDefinition->hasStage(glu::SHADERTYPE_TESSELLATION_EVALUATION))
2112 if (programDefinition->hasStage(glu::SHADERTYPE_GEOMETRY))
2147 glu::ShaderProgram program (m_context.getRenderContext(), generateProgramInterfaceProgramSources(programDefinition));
2186 const VariableSearchFilter uniformFilter = VariableSearchFilter::createStorageFilter(glu::STORAGE_UNIFORM);
2198 const VariableReferencedByShaderValidator referencedByVertexVerifier (m_context, glu::SHADERTYPE_VERTEX, uniformFilter);
2199 const VariableReferencedByShaderValidator referencedByFragmentVerifier (m_context, glu::SHADERTYPE_FRAGMENT, uniformFilter);
2200 const VariableReferencedByShaderValidator referencedByComputeVerifier (m_context, glu::SHADERTYPE_COMPUTE, uniformFilter);
2201 const VariableReferencedByShaderValidator referencedByGeometryVerifier (m_context, glu::SHADERTYPE_GEOMETRY, uniformFilter);
2202 const VariableReferencedByShaderValidator referencedByTessControlVerifier (m_context, glu::SHADERTYPE_TESSELLATION_CONTROL, uniformFilter);
2203 const VariableReferencedByShaderValidator referencedByTessEvaluationVerifier (m_context, glu::SHADERTYPE_TESSELLATION_EVALUATION, uniformFilter);
2253 const glu::Storage storage = (m_queryTarget.interface == PROGRAMINTERFACE_UNIFORM_BLOCK) ? (glu::STORAGE_UNIFORM) : (glu::STORAGE_BUFFER);
2257 const BlockReferencedByShaderValidator referencedByVertexVerifier (m_context, glu::SHADERTYPE_VERTEX, blockFilter);
2258 const BlockReferencedByShaderValidator referencedByFragmentVerifier (m_context, glu::SHADERTYPE_FRAGMENT, blockFilter);
2259 const BlockReferencedByShaderValidator referencedByComputeVerifier (m_context, glu::SHADERTYPE_COMPUTE, blockFilter);
2260 const BlockReferencedByShaderValidator referencedByGeometryVerifier (m_context, glu::SHADERTYPE_GEOMETRY, blockFilter);
2261 const BlockReferencedByShaderValidator referencedByTessControlVerifier (m_context, glu::SHADERTYPE_TESSELLATION_CONTROL, blockFilter);
2262 const BlockReferencedByShaderValidator referencedByTessEvaluationVerifier (m_context, glu::SHADERTYPE_TESSELLATION_EVALUATION, blockFilter);
2306 const glu::Storage varyingStorage = (isInputCase) ? (glu::STORAGE_IN) : (glu::STORAGE_OUT);
2307 const glu::Storage patchStorage = (isInputCase) ? (glu::STORAGE_PATCH_IN) : (glu::STORAGE_PATCH_OUT);
2308 const glu::ShaderType shaderType = (isInputCase) ? (programDefinition->getFirstStage()) : (programDefinition->getLastStage());
2309 const int unsizedArraySize = (isInputCase && shaderType == glu::SHADERTYPE_GEOMETRY) ? (1) // input points
2310 : (isInputCase && shaderType == glu::SHADERTYPE_TESSELLATION_CONTROL) ? (getMaxPatchVertices()) // input batch size
2311 : (!isInputCase && shaderType == glu::SHADERTYPE_TESSELLATION_CONTROL) ? (programDefinition->getTessellationNumOutputPatchVertices()) // output batch size
2312 : (isInputCase && shaderType == glu::SHADERTYPE_TESSELLATION_EVALUATION) ? (getMaxPatchVertices()) // input batch size
2322 const VariableReferencedByShaderValidator referencedByVertexVerifier (m_context, glu::SHADERTYPE_VERTEX, variableFilter);
2323 const VariableReferencedByShaderValidator referencedByFragmentVerifier (m_context, glu::SHADERTYPE_FRAGMENT, variableFilter);
2324 const VariableReferencedByShaderValidator referencedByComputeVerifier (m_context, glu::SHADERTYPE_COMPUTE, variableFilter);
2325 const VariableReferencedByShaderValidator referencedByGeometryVerifier (m_context, glu::SHADERTYPE_GEOMETRY, variableFilter);
2326 const VariableReferencedByShaderValidator referencedByTessControlVerifier (m_context, glu::SHADERTYPE_TESSELLATION_CONTROL, variableFilter);
2327 const VariableReferencedByShaderValidator referencedByTessEvaluationVerifier (m_context, glu::SHADERTYPE_TESSELLATION_EVALUATION, variableFilter);
2373 const VariableSearchFilter variableFilter = VariableSearchFilter::createStorageFilter(glu::STORAGE_BUFFER);
2383 const VariableReferencedByShaderValidator referencedByVertexVerifier (m_context, glu::SHADERTYPE_VERTEX, variableFilter);
2384 const VariableReferencedByShaderValidator referencedByFragmentVerifier (m_context, glu::SHADERTYPE_FRAGMENT, variableFilter);
2385 const VariableReferencedByShaderValidator referencedByComputeVerifier (m_context, glu::SHADERTYPE_COMPUTE, variableFilter);
2386 const VariableReferencedByShaderValidator referencedByGeometryVerifier (m_context, glu::SHADERTYPE_GEOMETRY, variableFilter);
2387 const VariableReferencedByShaderValidator referencedByTessControlVerifier (m_context, glu::SHADERTYPE_TESSELLATION_CONTROL, variableFilter);
2388 const VariableReferencedByShaderValidator referencedByTessEvaluationVerifier (m_context, glu::SHADERTYPE_TESSELLATION_EVALUATION, variableFilter);
2490 log << tcu::TestLog::Message << "\t" << glu::getGettableStateStr(pname) << " = " << limit << ", test requires " << usage << tcu::TestLog::EndMessage;
2508 case glu::SHADERTYPE_VERTEX:
2538 case glu::SHADERTYPE_FRAGMENT:
2567 case glu::SHADERTYPE_COMPUTE:
2594 case glu::SHADERTYPE_GEOMETRY:
2625 case glu::SHADERTYPE_TESSELLATION_CONTROL:
2657 case glu::SHADERTYPE_TESSELLATION_EVALUATION: