Path: blob/21.2-virgl/src/gallium/drivers/svga/svga_screen.h
4570 views
/**********************************************************1* Copyright 2008-2009 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#ifndef SVGA_SCREEN_H26#define SVGA_SCREEN_H272829#include "pipe/p_screen.h"30#include "os/os_thread.h"3132#include "svga_screen_cache.h"333435struct svga_winsys_screen;36struct svga_winsys_context;37struct SVGACmdMemory;3839/**40* Subclass of pipe_screen41*/42struct svga_screen43{44struct pipe_screen screen;45struct svga_winsys_screen *sws;4647SVGA3dHardwareVersion hw_version;4849/** Device caps */50boolean haveProvokingVertex;51boolean haveLineStipple, haveLineSmooth;52boolean haveBlendLogicops;53float maxLineWidth, maxLineWidthAA;54float maxPointSize;55float pointSmoothThreshold; /** Disable point AA for sizes less than this */56unsigned max_color_buffers;57unsigned max_const_buffers;58unsigned max_viewports;59unsigned ms_samples;6061struct {62boolean force_level_surface_view;63boolean force_surface_view;64boolean no_surface_view;65boolean force_sampler_view;66boolean no_sampler_view;67boolean no_cache_index_buffers;68} debug;6970unsigned texture_timestamp;71mtx_t tex_mutex;7273mtx_t swc_mutex; /* Used for buffer uploads */7475/* which formats to translate depth formats into */76struct {77enum SVGA3dSurfaceFormat z16;7879/* note gallium order */80enum SVGA3dSurfaceFormat x8z24;81enum SVGA3dSurfaceFormat s8z24;82} depth;8384struct svga_host_surface_cache cache;8586/** HUD counters */87struct {88/** Memory used by all resources (buffers and surfaces) */89uint64_t total_resource_bytes;90uint64_t num_resources;91uint64_t num_failed_allocations;92} hud;93};9495#ifndef DEBUG96/** cast wrapper */97static inline struct svga_screen *98svga_screen(struct pipe_screen *pscreen)99{100return (struct svga_screen *) pscreen;101}102#else103struct svga_screen *104svga_screen(struct pipe_screen *screen);105#endif106107#endif /* SVGA_SCREEN_H */108109110