17ec681f3Smrg/* 27ec681f3Smrg * Copyright 2011 Joakim Sindholt <opensource@zhasha.com> 37ec681f3Smrg * 47ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a 57ec681f3Smrg * copy of this software and associated documentation files (the "Software"), 67ec681f3Smrg * to deal in the Software without restriction, including without limitation 77ec681f3Smrg * on the rights to use, copy, modify, merge, publish, distribute, sub 87ec681f3Smrg * license, and/or sell copies of the Software, and to permit persons to whom 97ec681f3Smrg * the Software is furnished to do so, subject to the following conditions: 107ec681f3Smrg * 117ec681f3Smrg * The above copyright notice and this permission notice (including the next 127ec681f3Smrg * paragraph) shall be included in all copies or substantial portions of the 137ec681f3Smrg * Software. 147ec681f3Smrg * 157ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 167ec681f3Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 177ec681f3Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 187ec681f3Smrg * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 197ec681f3Smrg * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 207ec681f3Smrg * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 217ec681f3Smrg * USE OR OTHER DEALINGS IN THE SOFTWARE. */ 227ec681f3Smrg 237ec681f3Smrg#ifndef _NINE_ADAPTER9_H_ 247ec681f3Smrg#define _NINE_ADAPTER9_H_ 257ec681f3Smrg 267ec681f3Smrg#include "iunknown.h" 277ec681f3Smrg 287ec681f3Smrg#include "d3dadapter/d3dadapter9.h" 297ec681f3Smrg 307ec681f3Smrgstruct pipe_screen; 317ec681f3Smrgstruct pipe_resource; 327ec681f3Smrg 337ec681f3Smrgstruct d3dadapter9_context 347ec681f3Smrg{ 357ec681f3Smrg struct pipe_screen *hal, *ref; 367ec681f3Smrg D3DADAPTER_IDENTIFIER9 identifier; 377ec681f3Smrg BOOL linear_framebuffer; 387ec681f3Smrg BOOL throttling; 397ec681f3Smrg int throttling_value; 407ec681f3Smrg int vblank_mode; 417ec681f3Smrg BOOL thread_submit; 427ec681f3Smrg BOOL discard_delayed_release; 437ec681f3Smrg BOOL tearfree_discard; 447ec681f3Smrg int csmt_force; 457ec681f3Smrg BOOL dynamic_texture_workaround; 467ec681f3Smrg BOOL shader_inline_constants; 477ec681f3Smrg int memfd_virtualsizelimit; 487ec681f3Smrg int override_vram_size; 497ec681f3Smrg 507ec681f3Smrg void (*destroy)( struct d3dadapter9_context *ctx ); 517ec681f3Smrg}; 527ec681f3Smrg 537ec681f3Smrgstruct NineAdapter9 547ec681f3Smrg{ 557ec681f3Smrg struct NineUnknown base; 567ec681f3Smrg 577ec681f3Smrg struct d3dadapter9_context *ctx; 587ec681f3Smrg}; 597ec681f3Smrgstatic inline struct NineAdapter9 * 607ec681f3SmrgNineAdapter9( void *data ) 617ec681f3Smrg{ 627ec681f3Smrg return (struct NineAdapter9 *)data; 637ec681f3Smrg} 647ec681f3Smrg 657ec681f3SmrgHRESULT 667ec681f3SmrgNineAdapter9_new( struct d3dadapter9_context *pCTX, 677ec681f3Smrg struct NineAdapter9 **ppOut ); 687ec681f3Smrg 697ec681f3SmrgHRESULT 707ec681f3SmrgNineAdapter9_ctor( struct NineAdapter9 *This, 717ec681f3Smrg struct NineUnknownParams *pParams, 727ec681f3Smrg struct d3dadapter9_context *pCTX ); 737ec681f3Smrg 747ec681f3Smrgvoid 757ec681f3SmrgNineAdapter9_dtor( struct NineAdapter9 *This ); 767ec681f3Smrg 777ec681f3SmrgHRESULT NINE_WINAPI 787ec681f3SmrgNineAdapter9_GetAdapterIdentifier( struct NineAdapter9 *This, 797ec681f3Smrg DWORD Flags, 807ec681f3Smrg D3DADAPTER_IDENTIFIER9 *pIdentifier ); 817ec681f3Smrg 827ec681f3SmrgHRESULT NINE_WINAPI 837ec681f3SmrgNineAdapter9_CheckDeviceType( struct NineAdapter9 *This, 847ec681f3Smrg D3DDEVTYPE DevType, 857ec681f3Smrg D3DFORMAT AdapterFormat, 867ec681f3Smrg D3DFORMAT BackBufferFormat, 877ec681f3Smrg BOOL bWindowed ); 887ec681f3Smrg 897ec681f3SmrgHRESULT NINE_WINAPI 907ec681f3SmrgNineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This, 917ec681f3Smrg D3DDEVTYPE DeviceType, 927ec681f3Smrg D3DFORMAT AdapterFormat, 937ec681f3Smrg DWORD Usage, 947ec681f3Smrg D3DRESOURCETYPE RType, 957ec681f3Smrg D3DFORMAT CheckFormat ); 967ec681f3Smrg 977ec681f3SmrgHRESULT NINE_WINAPI 987ec681f3SmrgNineAdapter9_CheckDeviceMultiSampleType( struct NineAdapter9 *This, 997ec681f3Smrg D3DDEVTYPE DeviceType, 1007ec681f3Smrg D3DFORMAT SurfaceFormat, 1017ec681f3Smrg BOOL Windowed, 1027ec681f3Smrg D3DMULTISAMPLE_TYPE MultiSampleType, 1037ec681f3Smrg DWORD *pQualityLevels ); 1047ec681f3Smrg 1057ec681f3SmrgHRESULT NINE_WINAPI 1067ec681f3SmrgNineAdapter9_CheckDepthStencilMatch( struct NineAdapter9 *This, 1077ec681f3Smrg D3DDEVTYPE DeviceType, 1087ec681f3Smrg D3DFORMAT AdapterFormat, 1097ec681f3Smrg D3DFORMAT RenderTargetFormat, 1107ec681f3Smrg D3DFORMAT DepthStencilFormat ); 1117ec681f3Smrg 1127ec681f3SmrgHRESULT NINE_WINAPI 1137ec681f3SmrgNineAdapter9_CheckDeviceFormatConversion( struct NineAdapter9 *This, 1147ec681f3Smrg D3DDEVTYPE DeviceType, 1157ec681f3Smrg D3DFORMAT SourceFormat, 1167ec681f3Smrg D3DFORMAT TargetFormat ); 1177ec681f3Smrg 1187ec681f3SmrgHRESULT NINE_WINAPI 1197ec681f3SmrgNineAdapter9_GetDeviceCaps( struct NineAdapter9 *This, 1207ec681f3Smrg D3DDEVTYPE DeviceType, 1217ec681f3Smrg D3DCAPS9 *pCaps ); 1227ec681f3Smrg 1237ec681f3SmrgHRESULT NINE_WINAPI 1247ec681f3SmrgNineAdapter9_CreateDevice( struct NineAdapter9 *This, 1257ec681f3Smrg UINT RealAdapter, 1267ec681f3Smrg D3DDEVTYPE DeviceType, 1277ec681f3Smrg HWND hFocusWindow, 1287ec681f3Smrg DWORD BehaviorFlags, 1297ec681f3Smrg D3DPRESENT_PARAMETERS *pPresentationParameters, 1307ec681f3Smrg IDirect3D9 *pD3D9, 1317ec681f3Smrg ID3DPresentGroup *pPresentationGroup, 1327ec681f3Smrg IDirect3DDevice9 **ppReturnedDeviceInterface ); 1337ec681f3Smrg 1347ec681f3SmrgHRESULT NINE_WINAPI 1357ec681f3SmrgNineAdapter9_CreateDeviceEx( struct NineAdapter9 *This, 1367ec681f3Smrg UINT RealAdapter, 1377ec681f3Smrg D3DDEVTYPE DeviceType, 1387ec681f3Smrg HWND hFocusWindow, 1397ec681f3Smrg DWORD BehaviorFlags, 1407ec681f3Smrg D3DPRESENT_PARAMETERS *pPresentationParameters, 1417ec681f3Smrg D3DDISPLAYMODEEX *pFullscreenDisplayMode, 1427ec681f3Smrg IDirect3D9Ex *pD3D9Ex, 1437ec681f3Smrg ID3DPresentGroup *pPresentationGroup, 1447ec681f3Smrg IDirect3DDevice9Ex **ppReturnedDeviceInterface ); 1457ec681f3Smrg 1467ec681f3Smrg#endif /* _NINE_ADAPTER9_H_ */ 147