Path: blob/21.2-virgl/src/gallium/drivers/nouveau/codegen/nv50_ir_from_common.h
4574 views
/*1* Copyright 2011 Christoph Bumiller2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*/2122#include "codegen/nv50_ir.h"23#include "codegen/nv50_ir_build_util.h"2425namespace nv50_ir {2627class ConverterCommon : public BuildUtil28{29public:30ConverterCommon(Program *, nv50_ir_prog_info *, nv50_ir_prog_info_out *);31protected:32struct Subroutine33{34Subroutine(Function *f) : f(f) { }35Function *f;36ValueMap values;37};3839Subroutine *getSubroutine(unsigned ip);40Subroutine *getSubroutine(Function *);4142uint8_t translateInterpMode(const struct nv50_ir_varying *var, operation& op);4344void handleUserClipPlanes();4546struct {47std::map<unsigned, Subroutine> map;48Subroutine *cur;49} sub;5051struct nv50_ir_prog_info *info;52struct nv50_ir_prog_info_out *info_out;53Value *fragCoord[4];54Value *clipVtx[4];55Value *outBase; // base address of vertex out patch (for TCP)56};5758} // namespace nv50_ir596061