Path: blob/21.2-virgl/src/gallium/drivers/swr/rasterizer/jitter/streamout_jit.h
4574 views
/****************************************************************************1* Copyright (C) 2014-2015 Intel Corporation. All Rights Reserved.2*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 (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*22* @file streamout_jit.h23*24* @brief Definition of the streamout jitter25*26* Notes:27*28******************************************************************************/29#pragma once3031#include "common/formats.h"32#include "core/state.h"3334//////////////////////////////////////////////////////////////////////////35/// STREAMOUT_DECL - Stream decl36//////////////////////////////////////////////////////////////////////////37struct STREAMOUT_DECL38{39// Buffer that stream maps to.40DWORD bufferIndex;4142// attribute to stream43uint32_t attribSlot;4445// attribute component mask46uint32_t componentMask;4748// indicates this decl is a hole49bool hole;50};5152//////////////////////////////////////////////////////////////////////////53/// STREAMOUT_STREAM - Stream decls54//////////////////////////////////////////////////////////////////////////55struct STREAMOUT_STREAM56{57// number of decls for this stream58uint32_t numDecls;5960// array of numDecls decls61STREAMOUT_DECL decl[128];62};6364//////////////////////////////////////////////////////////////////////////65/// State required for streamout jit66//////////////////////////////////////////////////////////////////////////67struct STREAMOUT_COMPILE_STATE68{69// number of verts per primitive70uint32_t numVertsPerPrim;71uint32_t72offsetAttribs; ///< attrib offset to subtract from all STREAMOUT_DECL::attribSlot values.7374uint64_t streamMask;7576// stream decls77STREAMOUT_STREAM stream;7879bool operator==(const STREAMOUT_COMPILE_STATE& other) const80{81if (numVertsPerPrim != other.numVertsPerPrim)82return false;83if (stream.numDecls != other.stream.numDecls)84return false;8586for (uint32_t i = 0; i < stream.numDecls; ++i)87{88if (stream.decl[i].bufferIndex != other.stream.decl[i].bufferIndex)89return false;90if (stream.decl[i].attribSlot != other.stream.decl[i].attribSlot)91return false;92if (stream.decl[i].componentMask != other.stream.decl[i].componentMask)93return false;94if (stream.decl[i].hole != other.stream.decl[i].hole)95return false;96}9798return true;99}100};101102103