1 /**************************************************************************
2  *
3  * Copyright 2010 Luca Barbieri
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial
15  * portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20  * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  **************************************************************************/
26 
27 #ifndef D3D1X_PRIVATE_H_
28 #define D3D1X_PRIVATE_H_
29 
30 #include <algorithm>
31 #include <vector>
32 #include <string>
33 #include <float.h>
34 
35 #include "dxbc.h"
36 #include "sm4.h"
37 #include "sm4_to_tgsi.h"
38 
39 #include "d3d1xstutil.h"
40 
41 #include <d3d11.h>
42 #include <d3d11shader.h>
43 
44 extern "C"
45 {
46 #include "pipe/p_defines.h"
47 #include "pipe/p_screen.h"
48 #include "pipe/p_context.h"
49 #include "util/u_inlines.h"
50 #include "util/u_format.h"
51 #include "util/u_caps.h"
52 #include "util/u_debug.h"
53 #include "os/os_thread.h"
54 }
55 
56 #include "galliumdxgi.h"
57 #include "galliumd3d10_1.h"
58 #include "galliumd3d11.h"
59 
60 #ifdef CHECK
61 #define invalid(x) unlikely(x)
62 #else
63 #define invalid(x) (0)
64 #endif
65 
66 #define D3D10_STAGE_VS 0
67 #define D3D10_STAGE_PS 1
68 #define D3D10_STAGE_GS 2
69 #define D3D10_STAGES 3
70 
71 #define D3D11_STAGE_VS 0
72 #define D3D11_STAGE_PS 1
73 #define D3D11_STAGE_GS 2
74 #define D3D11_STAGE_HS 3
75 #define D3D11_STAGE_DS 4
76 #define D3D11_STAGE_CS 5
77 #define D3D11_STAGES 6
78 
79 #define D3D10_BLEND_COUNT 20
80 #define D3D11_BLEND_COUNT 20
81 extern unsigned d3d11_to_pipe_blend[D3D11_BLEND_COUNT];
82 
83 #define D3D11_USAGE_COUNT 4
84 extern unsigned d3d11_to_pipe_usage[D3D11_USAGE_COUNT];
85 
86 #define D3D10_STENCIL_OP_COUNT 9
87 #define D3D11_STENCIL_OP_COUNT 9
88 extern unsigned d3d11_to_pipe_stencil_op[D3D11_STENCIL_OP_COUNT];
89 
90 #define D3D11_TEXTURE_ADDRESS_COUNT 6
91 extern unsigned d3d11_to_pipe_wrap[D3D11_TEXTURE_ADDRESS_COUNT];
92 
93 #define D3D11_QUERY_COUNT 16
94 extern unsigned d3d11_to_pipe_query[D3D11_QUERY_COUNT];
95 extern unsigned d3d11_query_size[D3D11_QUERY_COUNT];
96 
97 #endif /* D3D1X_H_ */
98