Path: blob/21.2-virgl/src/gallium/targets/d3d10sw/d3d10_gdi.c
4565 views
/**************************************************************************1*2* Copyright 2012-2021 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions: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 NON-INFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,17* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR18* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE19* USE OR OTHER DEALINGS IN THE SOFTWARE.20*21* The above copyright notice and this permission notice (including the22* next paragraph) shall be included in all copies or substantial portions23* of the Software.24*25*26**************************************************************************/272829#include "util/u_debug.h"30#include "target-helpers/inline_debug_helper.h"31#include "llvmpipe/lp_public.h"32#include "softpipe/sp_public.h"33#include "sw/gdi/gdi_sw_winsys.h"343536extern struct pipe_screen *37d3d10_create_screen(void);383940struct pipe_screen *41d3d10_create_screen(void)42{43const char *default_driver;44const char *driver;45struct pipe_screen *screen = NULL;46struct sw_winsys *winsys;4748winsys = gdi_create_sw_winsys();49if(!winsys)50goto no_winsys;5152#ifdef GALLIUM_LLVMPIPE53default_driver = "llvmpipe";54#else55default_driver = "softpipe";56#endif5758driver = debug_get_option("GALLIUM_DRIVER", default_driver);5960#ifdef GALLIUM_LLVMPIPE61if (strcmp(driver, "llvmpipe") == 0) {62screen = llvmpipe_create_screen( winsys );63}64#else65(void)driver;66#endif6768if (screen == NULL) {69screen = softpipe_create_screen( winsys );70}7172if (screen == NULL)73goto no_screen;7475return debug_screen_wrap( screen );7677no_screen:78winsys->destroy(winsys);79no_winsys:80return NULL;81}828384