Path: blob/21.2-virgl/src/gallium/winsys/svga/drm/vmw_shader.h
4573 views
/**********************************************************1* Copyright 2009-2015 VMware, Inc. All rights reserved.2*3* Permission is hereby granted, free of charge, to any person4* obtaining a copy of this software and associated documentation5* files (the "Software"), to deal in the Software without6* restriction, including without limitation the rights to use, copy,7* modify, merge, publish, distribute, sublicense, and/or sell copies8* of the Software, and to permit persons to whom the Software is9* furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice shall be12* included in all copies or substantial portions of the Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,15* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF16* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND17* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS18* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN19* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN20* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE21* SOFTWARE.22*23**********************************************************/2425/**26* @file27* Shaders for VMware SVGA winsys.28*29* @author Jose Fonseca <[email protected]>30* @author Thomas Hellstrom <[email protected]>31*/3233#ifndef VMW_SHADER_H_34#define VMW_SHADER_H_3536#include "pipe/p_compiler.h"37#include "util/u_atomic.h"38#include "util/u_inlines.h"3940struct vmw_svga_winsys_shader41{42int32_t validated;43struct pipe_reference refcnt;4445struct vmw_winsys_screen *screen;46struct svga_winsys_buffer *buf;47uint32_t shid;48};4950static inline struct svga_winsys_gb_shader *51svga_winsys_shader(struct vmw_svga_winsys_shader *shader)52{53assert(!shader || shader->shid != SVGA3D_INVALID_ID);54return (struct svga_winsys_gb_shader *)shader;55}5657static inline struct vmw_svga_winsys_shader *58vmw_svga_winsys_shader(struct svga_winsys_gb_shader *shader)59{60return (struct vmw_svga_winsys_shader *)shader;61}6263void64vmw_svga_winsys_shader_reference(struct vmw_svga_winsys_shader **pdst,65struct vmw_svga_winsys_shader *src);6667struct vmw_svga_winsys_shader *68vmw_svga_shader_create(struct svga_winsys_screen *sws,69SVGA3dShaderType type,70const uint32 *bytecode,71uint32 bytecodeLen,72const SVGA3dDXShaderSignatureHeader *sgnInfo,73uint32 sgnLen);7475#endif /* VMW_SHADER_H_ */767778