亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hal.c

?? nVidia開發的圖形語言 Cg
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************\
Copyright (c) 2002, NVIDIA Corporation.

NVIDIA Corporation("NVIDIA") supplies this software to you in
consideration of your agreement to the following terms, and your use,
installation, modification or redistribution of this NVIDIA software
constitutes acceptance of these terms.  If you do not agree with these
terms, please do not use, install, modify or redistribute this NVIDIA
software.

In consideration of your agreement to abide by the following terms, and
subject to these terms, NVIDIA grants you a personal, non-exclusive
license, under NVIDIA's copyrights in this original NVIDIA software (the
"NVIDIA Software"), to use, reproduce, modify and redistribute the
NVIDIA Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the NVIDIA Software, you must
retain the copyright notice of NVIDIA, this notice and the following
text and disclaimers in all such redistributions of the NVIDIA Software.
Neither the name, trademarks, service marks nor logos of NVIDIA
Corporation may be used to endorse or promote products derived from the
NVIDIA Software without specific prior written permission from NVIDIA.
Except as expressly stated in this notice, no other rights or licenses
express or implied, are granted by NVIDIA herein, including but not
limited to any patent rights that may be infringed by your derivative
works or by other works in which the NVIDIA Software may be
incorporated. No hardware is licensed hereunder. 

THE NVIDIA SOFTWARE IS BEING PROVIDED ON AN "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
ITS USE AND OPERATION EITHER ALONE OR IN COMBINATION WITH OTHER
PRODUCTS.

IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT,
INCIDENTAL, EXEMPLARY, CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, LOST PROFITS; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR ARISING IN ANY WAY
OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE
NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\****************************************************************************/

//
// hal.c
//

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include "slglobals.h"

static void InitHAL_HAL(slHAL *);
static int GetCapsBit_HAL(int bitNumber);
static int GetConnectorUses_HAL(int cid, int pid);
static int GetConnectorRegister_HAL(int cid, int ByIndex, int ratom, Binding *fBind);
static int GetFloatSuffixBase_HAL(SourceLoc *loc, int suffix);
static int GetSizeof_HAL(Type *fType);
static int GetAlignment_HAL(Type *fType);
static int CheckDeclarators_HAL(SourceLoc *loc, const dtype *fDtype);
static int CheckDefinition_HAL(SourceLoc *loc, int name, const Type *fType);
static int CheckStatement_HAL(SourceLoc *loc, stmt *fstmt);
static int CheckInternalFunction_HAL(Symbol *fSymb, int *group);
static int IsNumericBase_HAL(int fBase);
static int IsIntegralBase_HAL(int fBase);
static int IsTexobjBase_HAL(int fBase);
static int IsValidRuntimeBase_HAL(int fBase);
static int IsValidScalarCast_HAL(int toBase, int fromBase, int Explicit);
static int IsValidOperator_HAL(SourceLoc *loc, int name, int op, int suobp);
static int GetBinOpBase_HAL(int lop, int lbase, int rbase, int llen, int rlen);
static int ConvertConstant_HAL(const scalar_constant *fval, int fbase, int tbase,
                    expr **fexpr);
static int BindUniformUnbound_HAL(SourceLoc *loc, Symbol *fSymb, Binding *lBind);
static int BindUniformPragma_HAL(SourceLoc *loc, Symbol *fSymb, Binding *lBind,
                    const Binding *fBind);
static int BindVaryingSemantic_HAL(SourceLoc *loc, Symbol *fSymb, int semantic,
                    Binding *fBind, int IsOutVal);
static int BindVaryingPragma_HAL(SourceLoc *loc, Symbol *fSymb, Binding *lBind,
                    const Binding *fBind, int IsOutVal);
static int BindVaryingUnbound_HAL(SourceLoc *loc, Symbol *fSymb, int name, int connector,
                    Binding *fBind, int IsOutVal);
static int PrintCodeHeader_HAL(FILE *out);
static int GenerateCode_HAL(SourceLoc *loc, Scope *fScope, Symbol *program);

///////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// Profile Manager: //////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////

/*
 * RegisterProfile() - Add a profile to the list of available profiles.
 *
 */

slProfile *RegisterProfile(int (*InitHAL)(slHAL *), const char *name, int id)
{
    slProfile *lProfile;

    lProfile = (slProfile *) malloc(sizeof(slProfile));
    lProfile->next = Cg->allProfiles;
    lProfile->InitHAL = InitHAL;
    lProfile->name = AddAtom(atable, name);
    lProfile->id = id;
    Cg->allProfiles = lProfile;
    return lProfile;
} // RegisterProfile

/*
 * EnumerateProfiles()
 *
 */

slProfile *EnumerateProfiles(int index)
{
    slProfile *lProfile;
    
    lProfile = Cg->allProfiles;
    while (index-- > 0 && lProfile)
        lProfile = lProfile->next;
    return lProfile;
} // EnumerateProfiles

///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// Default Language HAL ////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////

/*
 * InitHAL()
 *
 */

int InitHAL(const char *profileName, const char *entryName)
{
    slProfile *lProfile;
    int result;

    Cg->theHAL = (slHAL *) malloc(sizeof(slHAL));
    InitHAL_HAL(Cg->theHAL);
    Cg->theHAL->profileName = AddAtom(atable, profileName);
    Cg->theHAL->entryName = AddAtom(atable, entryName);
    lProfile = Cg->allProfiles;
    while (lProfile) {
        if (Cg->theHAL->profileName == lProfile->name) {
            Cg->theHAL->InitHAL = lProfile->InitHAL;
            Cg->theHAL->pid = lProfile->id;
            result = Cg->theHAL->InitHAL(Cg->theHAL);
            return result;
        }
        lProfile = lProfile->next;
    }
    printf(OPENSL_TAG ": unknown profile \"%s\".\n", profileName);
    return 0;
} // InitHAL

/*
 * InitHAL_HAL();
 *
 */

static void InitHAL_HAL(slHAL *fHAL)
{
    // Initialize default function members:

    fHAL->InitHAL = NULL;
    fHAL->FreeHAL = NULL;
    fHAL->RegisterNames = NULL;
    fHAL->GetCapsBit = GetCapsBit_HAL;
    fHAL->GetConnectorID = NULL;
    fHAL->GetConnectorAtom = NULL;
    fHAL->GetConnectorUses = GetConnectorUses_HAL;
    fHAL->GetConnectorRegister = GetConnectorRegister_HAL;
    fHAL->GetFloatSuffixBase = GetFloatSuffixBase_HAL;
    fHAL->GetSizeof = GetSizeof_HAL;
    fHAL->GetAlignment = GetAlignment_HAL;
    fHAL->CheckDeclarators = CheckDeclarators_HAL;
    fHAL->CheckDefinition = CheckDefinition_HAL;
    fHAL->CheckStatement = CheckStatement_HAL;
    fHAL->CheckInternalFunction = CheckInternalFunction_HAL;
    fHAL->IsNumericBase = IsNumericBase_HAL;
    fHAL->IsTexobjBase = IsTexobjBase_HAL;
    fHAL->IsIntegralBase = IsIntegralBase_HAL;
    fHAL->IsValidRuntimeBase = IsValidRuntimeBase_HAL;
    fHAL->IsValidScalarCast = IsValidScalarCast_HAL;
    fHAL->IsValidOperator = IsValidOperator_HAL;
    fHAL->GetBinOpBase = GetBinOpBase_HAL;
    fHAL->ConvertConstant = ConvertConstant_HAL;
    fHAL->BindUniformUnbound = BindUniformUnbound_HAL;
    fHAL->BindUniformPragma = BindUniformPragma_HAL;
    fHAL->BindVaryingSemantic = BindVaryingSemantic_HAL;
    fHAL->BindVaryingPragma = BindVaryingPragma_HAL;
    fHAL->BindVaryingUnbound = BindVaryingUnbound_HAL;
    fHAL->PrintCodeHeader = PrintCodeHeader_HAL;
    fHAL->GenerateCode = GenerateCode_HAL;

    // Initialize default data members:

    // Defined when profile is registered:

    fHAL->vendor = "None";
    fHAL->version = "0.0";

    fHAL->profileName = 0;
    fHAL->pid = 0;
    fHAL->entryName = 0;

    fHAL->semantics = NULL;
    fHAL->numSemantics = 0;

    fHAL->incid = CID_NONE_ID;
    fHAL->inputCRegs = NULL;
    fHAL->numInputCRegs = 0;

    fHAL->nextUnboundVinReg = 0;
    fHAL->lastUnboundVinReg = -1;

    fHAL->outcid = CID_NONE_ID;
    fHAL->outputCRegs = NULL;
    fHAL->numOutputCRegs = 0;

    fHAL->nextUnboundVoutReg = 0;
    fHAL->lastUnboundVoutReg = -1;

    // Defined by compiler front end:

    fHAL->globalScope = NULL;
    fHAL->varyingIn = NULL;
    fHAL->varyingOut = NULL;
    fHAL->uniformParam = NULL;
    fHAL->uniformGlobal = NULL;
    fHAL->uniforms = NULL;

    fHAL->constantBindings = NULL;
    fHAL->defaultBindings = NULL;

    // Define default comment start string:

    fHAL->comment = "#";

    // Pointer to profile specific struct:

    fHAL->localData = NULL;

} // InitHAL_HAL

/*
 * AddConstantBinding() - Add a constant binding to the program.
 *
 */

void AddConstantBinding(Binding *fBind)
{
    BindingList *lBindList, *nBindList;

    nBindList = (BindingList *) malloc(sizeof(BindingList));
    nBindList->next = NULL;
    nBindList->binding = fBind;
    lBindList = Cg->theHAL->constantBindings;
    if (lBindList) {
        while (lBindList->next)
            lBindList = lBindList->next;
        lBindList->next = nBindList;
    } else {
        Cg->theHAL->constantBindings = nBindList;
    }
} // AddConstantBinding

/*
 * AddDefaultBinding() - Add a default binding to the program.
 *
 */

void AddDefaultBinding(Binding *fBind)
{
    BindingList *lBindList, *nBindList;

    nBindList = (BindingList *) malloc(sizeof(BindingList));
    nBindList->next = NULL;
    nBindList->binding = fBind;
    lBindList = Cg->theHAL->defaultBindings;
    if (lBindList) {
        while (lBindList->next)
            lBindList = lBindList->next;
        lBindList->next = nBindList;
    } else {
        Cg->theHAL->defaultBindings = nBindList;
    }
} // AddDefaultBinding

/*
 * LookupConnectorHAL() - Lookup a connector descriptor by cid.
 *
 */

ConnectorDescriptor *LookupConnectorHAL(ConnectorDescriptor *connectors, int cid, int num)
{
    int ii;

    for (ii = 0; ii < num; ii++) {
        if (cid == connectors[ii].cid)
            return &connectors[ii];
    }
    return NULL;
} // LookupConnectorHAL

/*
 * SetSymbolConnectorBindingHAL()
 *
 */

void SetSymbolConnectorBindingHAL(Binding *fBind, ConnectorRegisters *fConn)
{
    BindingConnector *tBind;

    tBind = &fBind->conn;
    tBind->properties = BIND_IS_BOUND;
    tBind->kind = BK_CONNECTOR;
    if (fConn->properties & REG_WRITE_REQUIRED)
        tBind->properties |= BIND_WRITE_REQUIRED;
    // tBind->gname set elsewhere
    // tBind->lname set elsewhere
    tBind->base = fConn->base;
    tBind->size = fConn->size;
    tBind->rname = fConn->name;
    tBind->regno = fConn->regno;
} // SetSymbolConnectorBindingHAL

/*
 * GetCapsBit_HAL() - Return an integer value representing the capabilities of this profile.
 *
 */

static int GetCapsBit_HAL(int bitNumber)
{
    return 0;
} // GetCapsBit_HAL

/*
 * GetConnectorUses_HAL() - Return a connectors capabilities for this profile.
 *
 */

static int GetConnectorUses_HAL(int cid, int pid)
{
    return CONNECTOR_IS_USELESS;
} // GetConnectorUses_HAL

/*
 * GetConnectorRegister_HAL() - Return the hw register number for "ratom" in connector "cid".
 *
 */

static int GetConnectorRegister_HAL(int cid, int ByIndex, int ratom, Binding *fBind)
{
    return 0;
} // GetConnectorRegister_HAL

/*
 * GetFloatSuffixBase_HAL() - Check for profile-specific limitations of floating point
 *         suffixes and return the base for this suffix.
 *
 */

static int GetFloatSuffixBase_HAL(SourceLoc *loc, int suffix)
{
    switch (suffix) {
    case ' ':
        return TYPE_BASE_CFLOAT;
    case 'f':
        return TYPE_BASE_FLOAT;
    default:
        SemanticError(loc, ERROR_C_UNSUPPORTED_FP_SUFFIX, suffix);
        return TYPE_BASE_UNDEFINED_TYPE;
    }
} // GetFloatSuffixBase_HAL

/*
 * GetSizeof_HAL() - Return a profile specific size for this scalar, vector, or matrix type.
 *         Used for defining struct member offsets for use by code generator.
 */

static int GetSizeof_HAL(Type *fType)
{
    int category, size, alignment, len, len2;

    if (fType) {
        category = GetCategory(fType);
        switch (category) {
        case TYPE_CATEGORY_SCALAR:
        case TYPE_CATEGORY_STRUCT:
        case TYPE_CATEGORY_CONNECTOR:
            size = fType->co.size;
            break;
        case TYPE_CATEGORY_ARRAY:
            if (IsVector(fType, &len)) {
                size = len;
            } else if (IsMatrix(fType, &len, &len2)) {
                if (len2 > len) {
                    size = len*4;
                } else {
                    size = len2*4;
                }
            } else {
                size = Cg->theHAL->GetSizeof(fType->arr.eltype);
                alignment = Cg->theHAL->GetAlignment(fType->arr.eltype);
                size = ((size + alignment - 1)/alignment)*alignment*fType->arr.numels;
            }
            break;
        case TYPE_CATEGORY_FUNCTION:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲第一狼人社区| 国产精品国产自产拍在线| 久久不见久久见免费视频7| 欧美国产日韩一二三区| 欧美色倩网站大全免费| 国产99一区视频免费| 亚洲mv在线观看| 中文av字幕一区| 精品国产一区二区亚洲人成毛片| 色综合久久99| 精品亚洲porn| 亚洲国产日韩一区二区| 国产精品女上位| 久久女同性恋中文字幕| 91麻豆精品久久久久蜜臀| 一本久久综合亚洲鲁鲁五月天 | 首页欧美精品中文字幕| 国产精品少妇自拍| ...av二区三区久久精品| 亚洲欧美韩国综合色| 久久久777精品电影网影网| 欧美日韩dvd在线观看| 色综合天天天天做夜夜夜夜做| 久久99精品久久久| 日本不卡123| 性做久久久久久免费观看| 亚洲免费观看高清完整版在线| 欧美激情在线观看视频免费| 欧美mv和日韩mv的网站| 欧美一区二区播放| 欧美精品一级二级三级| 欧美在线免费观看亚洲| 99久久99久久综合| av一区二区三区在线| 不卡视频一二三| 国产成人精品免费视频网站| 久久精品免费看| 免费不卡在线视频| 麻豆精品视频在线| 日韩电影在线观看一区| 日韩精品色哟哟| 天天综合色天天综合| 亚洲高清免费观看高清完整版在线观看| 亚洲欧美视频一区| 亚洲专区一二三| 午夜视频在线观看一区二区 | 欧美午夜电影在线播放| 在线视频一区二区三| 欧美日韩视频一区二区| 欧美精品丝袜中出| 91精品国产综合久久国产大片| 国产一区二区精品久久99| 国产精品资源在线看| 久久99久久久久| 韩国精品久久久| 国产在线视视频有精品| 国产一区二区三区高清播放| 国产精品99久久久久久久vr| 成人免费观看视频| 色av成人天堂桃色av| 欧美视频第二页| 日韩免费视频一区二区| 精品久久人人做人人爱| 中文在线一区二区| 一区二区三区在线不卡| 久久超碰97人人做人人爱| 国产一区二区电影| 91久久人澡人人添人人爽欧美| 裸体歌舞表演一区二区| 久久99精品久久久久久久久久久久| 国产乱码精品一区二区三| 成人av网站免费观看| 在线观看日韩电影| 精品久久久久一区| 国产精品久久久久久久久久久免费看| 一区二区在线免费| 久久精品国产亚洲5555| 成人av网址在线观看| 在线播放/欧美激情| 亚洲精品一区在线观看| 亚洲同性同志一二三专区| 视频一区二区不卡| 成人综合婷婷国产精品久久免费| 欧美亚洲日本国产| 久久综合色之久久综合| 一区二区三区在线观看视频| 激情五月激情综合网| 91久久精品一区二区三区| 精品国产乱码久久久久久夜甘婷婷| 国产精品毛片无遮挡高清| 日本视频在线一区| 日韩制服丝袜先锋影音| 国产欧美精品在线观看| 一区二区三区精品视频| 国产一区二区三区av电影| 一本久久综合亚洲鲁鲁五月天| 欧美一区二区在线免费播放| 国产精品久久久一本精品| 天堂资源在线中文精品| av高清不卡在线| 久久亚洲精精品中文字幕早川悠里| 一区二区欧美视频| 国产成人免费在线观看| 51午夜精品国产| 一区二区成人在线| 成人久久视频在线观看| 欧美xingq一区二区| 亚洲国产日韩一级| 99re热这里只有精品视频| 中文字幕不卡一区| 懂色一区二区三区免费观看 | 成人av免费在线| 91精品国产一区二区三区| 专区另类欧美日韩| 成人永久免费视频| 久久久久99精品一区| 日韩高清在线不卡| 欧美日韩高清一区二区三区| 18成人在线视频| 成人免费视频视频在线观看免费| 欧美大片一区二区| 香蕉久久一区二区不卡无毒影院| 91亚洲精品乱码久久久久久蜜桃| 国产日产精品一区| 国产精品99久久久久久久vr| 精品精品国产高清a毛片牛牛| 视频在线在亚洲| 欧美日韩国产成人在线免费| 亚洲精品国产成人久久av盗摄| 成人精品国产一区二区4080| 精品日韩欧美一区二区| 七七婷婷婷婷精品国产| 欧美一级xxx| 久久国产乱子精品免费女| 欧美一区在线视频| 美女www一区二区| 日韩欧美国产一区二区三区 | 久草精品在线观看| 欧美一区日韩一区| 蓝色福利精品导航| 精品成人在线观看| 国内精品久久久久影院一蜜桃| 精品剧情v国产在线观看在线| 日本欧洲一区二区| 日韩精品一区二区三区在线观看 | 欧美在线短视频| 一区二区三区四区乱视频| 欧美午夜精品一区二区三区| 亚洲va欧美va国产va天堂影院| 欧美日韩第一区日日骚| 青娱乐精品视频在线| ww亚洲ww在线观看国产| 久久国内精品自在自线400部| 精品成人a区在线观看| 国产精品一区二区在线观看网站| 日本一区二区三区久久久久久久久不| 成人av在线观| 亚洲一本大道在线| 日韩精品专区在线| 成人黄色片在线观看| 亚洲精品你懂的| 欧美一区二区三区免费视频| 国产一区二区三区高清播放| 国产精品国产自产拍高清av| 91成人免费电影| 美女www一区二区| 中文字幕高清不卡| 欧美日韩在线直播| 国产在线精品一区二区三区不卡| 国产精品免费看片| 欧美男生操女生| 国产成人精品三级麻豆| 亚洲激情男女视频| 国产麻豆9l精品三级站| 欧美美女黄视频| 国产成人亚洲综合a∨婷婷图片| 中文字幕一区视频| 91精品久久久久久蜜臀| 成人综合婷婷国产精品久久蜜臀 | 亚洲精品一二三四区| 91精品国产综合久久香蕉的特点 | 欧美美女黄视频| 国产一区二区网址| 一区二区视频在线| 欧美精品一区二区蜜臀亚洲| 91麻豆免费看| 久久91精品久久久久久秒播| 亚洲女人的天堂| 337p日本欧洲亚洲大胆色噜噜| 91美女精品福利| 激情偷乱视频一区二区三区| 亚洲综合在线电影| 国产午夜亚洲精品午夜鲁丝片 | 国产欧美日韩综合| 欧美日韩中文一区| 99久久久国产精品免费蜜臀| 美女mm1313爽爽久久久蜜臀| 一区2区3区在线看| 日本一区二区在线不卡| 日韩一级免费观看|