本文整理汇总了C++中TShHandleBase::getAsLinker方法的典型用法代码示例。如果您正苦于以下问题:C++ TShHandleBase::getAsLinker方法的具体用法?C++ TShHandleBase::getAsLinker怎么用?C++ TShHandleBase::getAsLinker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TShHandleBase
的用法示例。
在下文中一共展示了TShHandleBase::getAsLinker方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShLinkExt
//
// This link method will be eventually used once the ICD supports the new linker interface
//
int ShLinkExt(
const ShHandle linkHandle,
const ShHandle compHandles[],
const int numHandles)
{
if (linkHandle == 0 || numHandles == 0)
return 0;
THandleList cObjects;
{// support MSVC++6.0
for (int i = 0; i < numHandles; ++i) {
if (compHandles[i] == 0)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(compHandles[i]);
if (base->getAsLinker()) {
cObjects.push_back(base->getAsLinker());
}
if (base->getAsCompiler())
cObjects.push_back(base->getAsCompiler());
if (cObjects[i] == 0)
return 0;
}
}
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(linkHandle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
return 0;
linker->infoSink.info.erase();
{// support MSVC++6.0
for (int i = 0; i < numHandles; ++i) {
if (cObjects[i]->getAsCompiler()) {
if (! cObjects[i]->getAsCompiler()->linkable()) {
linker->infoSink.info.message(EPrefixError, "Not all shaders have valid object code.");
return 0;
}
}
}
}
bool ret = linker->link(cObjects);
return ret ? 1 : 0;
}
示例2: ShDestruct
void ShDestruct(ShHandle handle)
{
if (handle == 0)
return;
TShHandleBase* base = static_cast<TShHandleBase*>(handle);
if (base->getAsCompiler())
DeleteCompiler(base->getAsCompiler());
else if (base->getAsLinker())
DeleteLinker(base->getAsLinker());
else if (base->getAsUniformMap())
DeleteUniformMap(base->getAsUniformMap());
}
示例3: ShLink
//
// Do an actual link on the given compile objects.
//
// Return: The return value of is really boolean, indicating
// success or failure.
//
int ShLink(
const ShHandle linkHandle,
const ShHandle compHandles[],
const int numHandles,
ShHandle uniformMapHandle,
short int** uniformsAccessed,
int* numUniformsAccessed)
{
if (!InitThread())
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(linkHandle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
return 0;
int returnValue;
GlobalPoolAllocator.push();
returnValue = ShLinkExt(linkHandle, compHandles, numHandles);
GlobalPoolAllocator.pop();
if (returnValue)
return 1;
return 0;
}
示例4: ShGetInfoLog
//
// Return any compiler/linker/uniformmap log of messages for the application.
//
const char* ShGetInfoLog(const ShHandle handle)
{
if (!InitThread())
return 0;
if (handle == 0)
return 0;
TShHandleBase* base = static_cast<TShHandleBase*>(handle);
TInfoSink* infoSink;
if (base->getAsCompiler())
infoSink = &(base->getAsCompiler()->getInfoSink());
else if (base->getAsLinker())
infoSink = &(base->getAsLinker()->getInfoSink());
infoSink->info << infoSink->debug.c_str();
return infoSink->info.c_str();
}
示例5: ShGetExecutable
//
// Return the resulting binary code from the link process. Structure
// is machine dependent.
//
const void* ShGetExecutable(const ShHandle handle)
{
if (!InitThread())
return 0;
if (handle == 0)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
return 0;
return linker->getObjectCode();
}
示例6: ShExcludeAttributes
//
// Some attribute locations are off-limits to the linker...
//
int ShExcludeAttributes(const ShHandle handle, int *attributes, int count)
{
if (!InitThread())
return 0;
if (handle == 0)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
return 0;
linker->setExcludedAttributes(attributes, count);
return 1;
}
示例7: ShSetFixedAttributeBindings
//
// Let the linker know where the predefined attributes have to live.
//
int ShSetFixedAttributeBindings(const ShHandle handle, const ShBindingTable* table)
{
if (!InitThread())
return 0;
if (handle == 0)
return 0;
TShHandleBase* base = reinterpret_cast<TShHandleBase*>(handle);
TLinker* linker = static_cast<TLinker*>(base->getAsLinker());
if (linker == 0)
return 0;
linker->setFixedAttributeBindings(table);
return 1;
}