Path: blob/21.2-virgl/src/gallium/drivers/llvmpipe/lp_screen.h
4570 views
/**************************************************************************1*2* Copyright 2009 VMware, Inc.3* Copyright 2007 VMware, Inc.4* All Rights Reserved.5*6* Permission is hereby granted, free of charge, to any person obtaining a7* copy of this software and associated documentation files (the8* "Software"), to deal in the Software without restriction, including9* without limitation the rights to use, copy, modify, merge, publish,10* distribute, sub license, and/or sell copies of the Software, and to11* permit persons to whom the Software is furnished to do so, subject to12* the following conditions:13*14* The above copyright notice and this permission notice (including the15* next paragraph) shall be included in all copies or substantial portions16* of the Software.17*18* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS19* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF20* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.21* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR22* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,23* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE24* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.25*26**************************************************************************/2728/**29* @author Jose Fonseca <[email protected]>30* @author Keith Whitwell <[email protected]>31*/3233#ifndef LP_SCREEN_H34#define LP_SCREEN_H3536#include "pipe/p_screen.h"37#include "pipe/p_defines.h"38#include "os/os_thread.h"39#include "gallivm/lp_bld.h"40#include "gallivm/lp_bld_misc.h"4142struct sw_winsys;43struct lp_cs_tpool;4445struct llvmpipe_screen46{47struct pipe_screen base;4849struct sw_winsys *winsys;5051unsigned num_threads;5253/* Increments whenever textures are modified. Contexts can track this.54*/55unsigned timestamp;5657struct lp_rasterizer *rast;58mtx_t rast_mutex;5960struct lp_cs_tpool *cs_tpool;61mtx_t cs_mutex;6263bool use_tgsi;64bool allow_cl;6566mtx_t late_mutex;67bool late_init_done;6869struct disk_cache *disk_shader_cache;70unsigned num_disk_shader_cache_hits;71unsigned num_disk_shader_cache_misses;72};7374void lp_disk_cache_find_shader(struct llvmpipe_screen *screen,75struct lp_cached_code *cache,76unsigned char ir_sha1_cache_key[20]);77void lp_disk_cache_insert_shader(struct llvmpipe_screen *screen,78struct lp_cached_code *cache,79unsigned char ir_sha1_cache_key[20]);8081bool llvmpipe_screen_late_init(struct llvmpipe_screen *screen);8283static inline struct llvmpipe_screen *84llvmpipe_screen( struct pipe_screen *pipe )85{86return (struct llvmpipe_screen *)pipe;87}8889static inline unsigned lp_get_constant_buffer_stride(struct pipe_screen *_screen)90{91struct llvmpipe_screen *screen = llvmpipe_screen(_screen);92return screen->use_tgsi ? (sizeof(float) * 4) : sizeof(float);93}9495#endif /* LP_SCREEN_H */969798