RetroArch
d3dcsx.h
Go to the documentation of this file.
1 
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // File: D3DX11GPGPU.h
7 // Content: D3DX11 General Purpose GPU computing algorithms
8 //
10 
11 /*#include <winapifamily.h>*/
12 
13 /*#pragma region Desktop Family*/
14 /*#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)*/
15 
16 #include "d3d11.h"
17 
18 #ifndef __D3DX11GPGPU_H__
19 #define __D3DX11GPGPU_H__
20 
21 // Current name of the DLL shipped in the same SDK as this header.
22 
23 
24 #define D3DCSX_DLL_W L"d3dcsx_47.dll"
25 #define D3DCSX_DLL_A "d3dcsx_47.dll"
26 
27 #ifdef UNICODE
28  #define D3DCSX_DLL D3DCSX_DLL_W
29 #else
30  #define D3DCSX_DLL D3DCSX_DLL_A
31 #endif
32 
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif //__cplusplus
37 
38 
39 
40 
41 
42 
44 
46 {
51 
52 typedef enum D3DX11_SCAN_OPCODE
53 {
62 
64 {
68 
69 
71 // ID3DX11Scan:
73 
74 // {5089b68f-e71d-4d38-be8e-f363b95a9405}
75 DEFINE_GUID(IID_ID3DX11Scan, 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05);
76 
77 #undef INTERFACE
78 #define INTERFACE ID3DX11Scan
79 
80 DECLARE_INTERFACE_(ID3DX11Scan, IUnknown)
81 {
82  // IUnknown
83  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
84  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
85  STDMETHOD_(ULONG, Release)(THIS) PURE;
86 
87  // ID3DX11Scan
88 
89  STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
90 
91  //=============================================================================
92  // Performs an unsegmented scan of a sequence in-place or out-of-place
93  // ElementType element type
94  // OpCode binary operation
95  // Direction scan direction
96  // ElementScanSize size of scan, in elements
97  // pSrc input sequence on the device. pSrc==pDst for in-place scans
98  // pDst output sequence on the device
99  //=============================================================================
100  STDMETHOD(Scan)( THIS_
101  D3DX11_SCAN_DATA_TYPE ElementType,
103  UINT ElementScanSize,
104  _In_ ID3D11UnorderedAccessView* pSrc,
105  _In_ ID3D11UnorderedAccessView* pDst
106  ) PURE;
107 
108  //=============================================================================
109  // Performs a multiscan of a sequence in-place or out-of-place
110  // ElementType element type
111  // OpCode binary operation
112  // Direction scan direction
113  // ElementScanSize size of scan, in elements
114  // ElementScanPitch pitch of the next scan, in elements
115  // ScanCount number of scans in a multiscan
116  // pSrc input sequence on the device. pSrc==pDst for in-place scans
117  // pDst output sequence on the device
118  //=============================================================================
119  STDMETHOD(Multiscan)( THIS_
120  D3DX11_SCAN_DATA_TYPE ElementType,
122  UINT ElementScanSize,
123  UINT ElementScanPitch,
124  UINT ScanCount,
125  _In_ ID3D11UnorderedAccessView* pSrc,
126  _In_ ID3D11UnorderedAccessView* pDst
127  ) PURE;
128 };
129 
130 
131 //=============================================================================
132 // Creates a scan context
133 // pDevice the device context
134 // MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
135 // MaxScanCount maximum number of scans in multiscan
136 // ppScanContext new scan context
137 //=============================================================================
139  _In_ ID3D11DeviceContext* pDeviceContext,
140  UINT MaxElementScanSize,
141  UINT MaxScanCount,
142  _Out_ ID3DX11Scan** ppScan );
143 
144 
145 
147 // ID3DX11SegmentedScan:
149 
150 // {a915128c-d954-4c79-bfe1-64db923194d6}
151 DEFINE_GUID(IID_ID3DX11SegmentedScan, 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6);
152 
153 #undef INTERFACE
154 #define INTERFACE ID3DX11SegmentedScan
155 
156 DECLARE_INTERFACE_(ID3DX11SegmentedScan, IUnknown)
157 {
158  // IUnknown
159  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
160  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
161  STDMETHOD_(ULONG, Release)(THIS) PURE;
162 
163  // ID3DX11SegmentedScan
164 
165  STDMETHOD(SetScanDirection)(THIS_ D3DX11_SCAN_DIRECTION Direction) PURE;
166 
167  //=============================================================================
168  // Performs a segscan of a sequence in-place or out-of-place
169  // ElementType element type
170  // OpCode binary operation
171  // Direction scan direction
172  // pSrcElementFlags compact array of bits, one per element of pSrc. A set value
173  // indicates the start of a new segment.
174  // ElementScanSize size of scan, in elements
175  // pSrc input sequence on the device. pSrc==pDst for in-place scans
176  // pDst output sequence on the device
177  //=============================================================================
178  STDMETHOD(SegScan)( THIS_
179  D3DX11_SCAN_DATA_TYPE ElementType,
181  UINT ElementScanSize,
182  _In_opt_ ID3D11UnorderedAccessView* pSrc,
183  _In_ ID3D11UnorderedAccessView* pSrcElementFlags,
184  _In_ ID3D11UnorderedAccessView* pDst
185  ) PURE;
186 };
187 
188 
189 //=============================================================================
190 // Creates a segmented scan context
191 // pDevice the device context
192 // MaxElementScanSize maximum single scan size, in elements (FLOAT, UINT, or INT)
193 // ppScanContext new scan context
194 //=============================================================================
196  _In_ ID3D11DeviceContext* pDeviceContext,
197  UINT MaxElementScanSize,
198  _Out_ ID3DX11SegmentedScan** ppScan );
199 
200 
201 
203 
204 #define D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS 4
205 #define D3DX11_FFT_MAX_TEMP_BUFFERS 4
206 #define D3DX11_FFT_MAX_DIMENSIONS 32
207 
208 
209 
211 // ID3DX11FFT:
213 
214 // {b3f7a938-4c93-4310-a675-b30d6de50553}
215 DEFINE_GUID(IID_ID3DX11FFT, 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53);
216 
217 #undef INTERFACE
218 #define INTERFACE ID3DX11FFT
219 
220 DECLARE_INTERFACE_(ID3DX11FFT, IUnknown)
221 {
222  // IUnknown
223  STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE;
224  STDMETHOD_(ULONG, AddRef)(THIS) PURE;
225  STDMETHOD_(ULONG, Release)(THIS) PURE;
226 
227  // ID3DX11FFT
228 
229  // scale for forward transform (defaults to 1 if set to 0)
230  STDMETHOD(SetForwardScale)(THIS_ FLOAT ForwardScale) PURE;
231  STDMETHOD_(FLOAT, GetForwardScale)(THIS) PURE;
232 
233  // scale for inverse transform (defaults to 1/N if set to 0, where N is
234  // the product of the transformed dimension lengths
235  STDMETHOD(SetInverseScale)(THIS_ FLOAT InverseScale) PURE;
236  STDMETHOD_(FLOAT, GetInverseScale)(THIS) PURE;
237 
238  //------------------------------------------------------------------------------
239  // Attaches buffers to the context and performs any required precomputation.
240  // The buffers must be no smaller than the corresponding buffer sizes returned
241  // by D3DX11CreateFFT*(). Temp buffers may beshared between multiple contexts,
242  // though care should be taken to concurrently execute multiple FFTs which share
243  // temp buffers.
244  //
245  // NumTempBuffers number of buffers in ppTempBuffers
246  // ppTempBuffers temp buffers to attach
247  // NumPrecomputeBuffers number of buffers in ppPrecomputeBufferSizes
248  // ppPrecomputeBufferSizes buffers to hold precomputed data
249  STDMETHOD(AttachBuffersAndPrecompute)( THIS_
250  _In_range_(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBuffers,
251  _In_reads_(NumTempBuffers) ID3D11UnorderedAccessView* const* ppTempBuffers,
252  _In_range_(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBuffers,
253  _In_reads_(NumPrecomputeBuffers) ID3D11UnorderedAccessView* const* ppPrecomputeBufferSizes ) PURE;
254 
255  //------------------------------------------------------------------------------
256  // Call after buffers have been attached to the context, pInput and *ppOuput can
257  // be one of the temp buffers. If *ppOutput == NULL, then the computation will ping-pong
258  // between temp buffers and the last buffer written to is stored at *ppOutput.
259  // Otherwise, *ppOutput is used as the output buffer (which may incur an extra copy).
260  //
261  // The format of complex data is interleaved components, e.g. (Real0, Imag0),
262  // (Real1, Imag1) ... etc. Data is stored in row major order
263  //
264  // pInputBuffer view onto input buffer
265  // ppOutpuBuffert pointer to view of output buffer
266  STDMETHOD(ForwardTransform)( THIS_
267  _In_ const ID3D11UnorderedAccessView* pInputBuffer,
268  _Inout_ ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
269 
270  STDMETHOD(InverseTransform)( THIS_
271  _In_ const ID3D11UnorderedAccessView* pInputBuffer,
272  _Inout_ ID3D11UnorderedAccessView** ppOutputBuffer ) PURE;
273 };
274 
275 
277 // ID3DX11FFT Creation Routines
279 
281 {
285 
286 typedef enum D3DX11_FFT_DIM_MASK
287 {
292 
293 typedef struct D3DX11_FFT_DESC
294 {
295  UINT NumDimensions; // number of dimensions
296  UINT ElementLengths[D3DX11_FFT_MAX_DIMENSIONS]; // length of each dimension
297  UINT DimensionMask; // a bit set for each dimensions to transform
298  // (see D3DX11_FFT_DIM_MASK for common masks)
299  D3DX11_FFT_DATA_TYPE Type; // type of the elements in spatial domain
301 
302 
303 //------------------------------------------------------------------------------
304 // NumTempBufferSizes Number of temporary buffers needed
305 // pTempBufferSizes Minimum sizes (in FLOATs) of temporary buffers
306 // NumPrecomputeBufferSizes Number of precompute buffers needed
307 // pPrecomputeBufferSizes minimum sizes (in FLOATs) for precompute buffers
308 //------------------------------------------------------------------------------
309 
311 {
312  _Field_range_(0,D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBufferSizes;
314  _Field_range_(0,D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS) UINT NumPrecomputeBufferSizes;
317 
318 
320 {
321  D3DX11_FFT_CREATE_FLAG_NO_PRECOMPUTE_BUFFERS = 0x01L, // do not precompute values and store into buffers
323 
324 
325 //------------------------------------------------------------------------------
326 // Creates an ID3DX11FFT COM interface object and returns a pointer to it at *ppFFT.
327 // The descriptor describes the shape of the data as well as the scaling factors
328 // that should be used for forward and inverse transforms.
329 // The FFT computation may require temporaries that act as ping-pong buffers
330 // and for other purposes. aTempSizes is a list of the sizes required for
331 // temporaries. Likewise, some data may need to be precomputed and the sizes
332 // of those sizes are returned in aPrecomputedBufferSizes.
333 //
334 // To perform a computation, follow these steps:
335 // 1) Create the FFT context object
336 // 2) Precompute (and Attach temp working buffers of at least the required size)
337 // 3) Call Compute() on some input data
338 //
339 // Compute() may be called repeatedly with different inputs and transform
340 // directions. When finished with the FFT work, release the FFT interface()
341 //
342 // Device Direct3DDeviceContext to use in
343 // pDesc Descriptor for FFT transform in
344 // Count the number of 1D FFTs to perform in
345 // Flags See D3DX11_FFT_CREATE_FLAG in
346 // pBufferInfo Pointer to BUFFER_INFO struct, filled by funciton out
347 // ppFFT Pointer to returned context pointer out
348 //------------------------------------------------------------------------------
349 
350 HRESULT WINAPI D3DX11CreateFFT(
351  ID3D11DeviceContext* pDeviceContext,
352  _In_ const D3DX11_FFT_DESC* pDesc,
353  UINT Flags,
354  _Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
355  _Out_ ID3DX11FFT** ppFFT
356  );
357 
359  ID3D11DeviceContext* pDeviceContext,
360  UINT X,
361  UINT Flags,
362  _Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
363  _Out_ ID3DX11FFT** ppFFT
364  );
366  ID3D11DeviceContext* pDeviceContext,
367  UINT X,
368  UINT Flags,
369  _Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
370  _Out_ ID3DX11FFT** ppFFT
371  );
373  ID3D11DeviceContext* pDeviceContext,
374  UINT X,
375  UINT Y,
376  UINT Flags,
377  _Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
378  _Out_ ID3DX11FFT** ppFFT
379  );
381  ID3D11DeviceContext* pDeviceContext,
382  UINT X,
383  UINT Y,
384  UINT Flags,
385  _Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
386  _Out_ ID3DX11FFT** ppFFT
387  );
389  ID3D11DeviceContext* pDeviceContext,
390  UINT X,
391  UINT Y,
392  UINT Z,
393  UINT Flags,
394  _Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
395  _Out_ ID3DX11FFT** ppFFT
396  );
398  ID3D11DeviceContext* pDeviceContext,
399  UINT X,
400  UINT Y,
401  UINT Z,
402  UINT Flags,
403  _Out_ D3DX11_FFT_BUFFER_INFO* pBufferInfo,
404  _Out_ ID3DX11FFT** ppFFT
405  );
406 
407 
408 #ifdef __cplusplus
409 }
410 #endif //__cplusplus
411 
412 #endif //__D3DX11GPGPU_H__
413 
414 /*#endif*/ /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
415 /*#pragma endregion*/
416 
Definition: d3dcsx.h:282
Definition: d3dcsx.h:57
Definition: glslang_tab.cpp:129
UINT TempBufferFloatSizes[D3DX11_FFT_MAX_TEMP_BUFFERS]
Definition: d3dcsx.h:313
Definition: d3dcsx.h:48
Definition: d3dcsx.h:290
HRESULT WINAPI D3DX11CreateFFT1DComplex(ID3D11DeviceContext *pDeviceContext, UINT X, UINT Flags, _Out_ D3DX11_FFT_BUFFER_INFO *pBufferInfo, _Out_ ID3DX11FFT **ppFFT)
Definition: d3dcsx.h:65
Definition: d3dcsx.h:310
Definition: d3dcsx.h:288
#define D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS
Definition: d3dcsx.h:204
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
#define D3DX11_FFT_MAX_DIMENSIONS
Definition: d3dcsx.h:206
Unknown compiler Device disconnected from port File already exists Saving to backup buffer Got connection Public address Setting disk in tray You have left the game You have joined with input devices *s *s has joined as player u A netplay connection attempt failed because the peer is not running or is running an old version of RetroArch use the same version use the same version This core does not support inter architecture netplay Incorrect password A netplay client has disconnected You do not have permission to play The input devices requested are not available Netplay peer s paused Give hardware rendered cores their own private context Avoids having to assume hardware state changes inbetween frames Adjusts menu screen appearance settings Improves performance at the cost of latency and more video stuttering Use only if you cannot obtain full speed otherwise Autodetect Capabilities Connecting to port Password Username Accounts List Endpoint Achievements Scan Content Import content Ask Block Frames نظام تشغيل الصوت Audio Enable Turbo Deadzone Audio Maximum Timing Skew Audio Output Dynamic Audio Rate Control الصوت Audio Volume WASAPI Exclusive Mode WASAPI Shared Buffer Length Load Override Files Automatically Load Shader Presets Automatically Confirm Quit Scroll Up Toggle Keyboard Basic menu controls Info Scroll Up Toggle Keyboard Don t overwrite SaveRAM on loading savestate Buildbot Assets URL Allow Camera Cheat Cheat File Load Cheat File Cheat Passes Hardcore Mode Achievement Badges Locked Test Unofficial Achievements Unlocked Verbose Mode Config ملفات التكوين Collections Content Allow to remove entries Downloads Cheats Show core name Authors Core label Permissions System manufacturer Controls Options Start a Core Automatically Buildbot Cores URL Updater CPU Cursor Custom Ratio Database Selection Start directory< Default > Directory not found Disk Cycle Tray Status Disk Index Don t care Download Core DPI Override Enable أنظمة التشغيل Check for Missing Firmware Before Loading Dynamic Backgrounds Menu entry hover color False Favorites Limit Maximum Run Speed Frontend Counters Create game options file مساعدة Changing Virtual Gamepad Overlay مساعدة Scanning For Content History List Enable Horizontal Menu معلومات Analog To Digital Type Left Analog X Left analog Left Analog Y Left analog Y(down)") MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X
Definition: d3dcsx.h:49
Definition: d3dcsx.h:56
D3DX11_SCAN_OPCODE
Definition: d3dcsx.h:52
struct D3DX11_FFT_DESC D3DX11_FFT_DESC
#define D3DX11_FFT_MAX_TEMP_BUFFERS
Definition: d3dcsx.h:205
HRESULT WINAPI D3DX11CreateFFT3DComplex(ID3D11DeviceContext *pDeviceContext, UINT X, UINT Y, UINT Z, UINT Flags, _Out_ D3DX11_FFT_BUFFER_INFO *pBufferInfo, _Out_ ID3DX11FFT **ppFFT)
D3DX11_FFT_DATA_TYPE Type
Definition: d3dcsx.h:299
UINT DimensionMask
Definition: d3dcsx.h:297
UINT PrecomputeBufferFloatSizes[D3DX11_FFT_MAX_PRECOMPUTE_BUFFERS]
Definition: d3dcsx.h:315
HRESULT WINAPI D3DX11CreateFFT2DComplex(ID3D11DeviceContext *pDeviceContext, UINT X, UINT Y, UINT Flags, _Out_ D3DX11_FFT_BUFFER_INFO *pBufferInfo, _Out_ ID3DX11FFT **ppFFT)
Definition: d3dcsx.h:60
Definition: d3dcsx.h:47
HRESULT WINAPI D3DX11CreateFFT(ID3D11DeviceContext *pDeviceContext, _In_ const D3DX11_FFT_DESC *pDesc, UINT Flags, _Out_ D3DX11_FFT_BUFFER_INFO *pBufferInfo, _Out_ ID3DX11FFT **ppFFT)
D3DX11_SCAN_DIRECTION
Definition: d3dcsx.h:63
Definition: d3dcsx.h:293
D3DX11_SCAN_DATA_TYPE
Definition: d3dcsx.h:45
OpCode
Definition: lopcodes.h:167
HRESULT WINAPI D3DX11CreateFFT1DReal(ID3D11DeviceContext *pDeviceContext, UINT X, UINT Flags, _Out_ D3DX11_FFT_BUFFER_INFO *pBufferInfo, _Out_ ID3DX11FFT **ppFFT)
interface ID3D11UnorderedAccessView ID3D11UnorderedAccessView
Definition: d3d11.h:140
DEFINE_GUID(IID_ID3DX11Scan, 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05)
Definition: d3dcsx.h:283
Definition: d3dcsx.h:59
static INLINE ULONG Release(void *object)
Definition: dxgi_common.h:253
HRESULT WINAPI D3DX11CreateSegmentedScan(_In_ ID3D11DeviceContext *pDeviceContext, UINT MaxElementScanSize, _Out_ ID3DX11SegmentedScan **ppScan)
struct D3DX11_FFT_BUFFER_INFO D3DX11_FFT_BUFFER_INFO
DECLARE_INTERFACE_(ID3DX11Scan, IUnknown)
Definition: d3dcsx.h:80
D3DX11_FFT_DATA_TYPE
Definition: d3dcsx.h:280
interface ID3D11DeviceContext ID3D11DeviceContext
Definition: d3d11.h:252
HRESULT WINAPI D3DX11CreateScan(_In_ ID3D11DeviceContext *pDeviceContext, UINT MaxElementScanSize, UINT MaxScanCount, _Out_ ID3DX11Scan **ppScan)
D3DX11_FFT_CREATE_FLAG
Definition: d3dcsx.h:319
UINT ElementLengths[D3DX11_FFT_MAX_DIMENSIONS]
Definition: d3dcsx.h:296
Definition: glslang_tab.cpp:136
#define X(a, b)
Definition: bba.c:185
Ιστορικό Εικόνα Πληροφορίες Όλοι Οι Χρήστες Χειρίζονται Το Μενού Αριστερό Αναλογικό Αριστερό Αναλογικό Αριστερό Αναλογικό Y Αριστερό Αναλογικό Δεξί Αναλογικό X Δεξί Αναλογικό Δεξί Αναλογικό Y Δεξί Αναλογικό Σκανδάλη Όπλου Όπλο Aux A Όπλο Aux C Όπλο Select Όπλο D pad Κάτω Όπλο D pad Δεξιά Νεκρή Ζώνη Αναλογικού Σύνδεση Όλων Λήξη Χρόνου Σύνδεσης Hide Unbound Core Input Descriptors Κατάλογος Συσκευών Κατάλογος Ποντικιού Duty Cycle Keyboard Gamepad Mapping Enable Κουμπί D pad κάτω Κουμπί Κουμπί L(πίσω)" ) MSG_HASH( MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT
D3DX11_FFT_DIM_MASK
Definition: d3dcsx.h:286
HRESULT WINAPI D3DX11CreateFFT2DReal(ID3D11DeviceContext *pDeviceContext, UINT X, UINT Y, UINT Flags, _Out_ D3DX11_FFT_BUFFER_INFO *pBufferInfo, _Out_ ID3DX11FFT **ppFFT)
Definition: d3dcsx.h:289
UINT NumDimensions
Definition: d3dcsx.h:295
Definition: d3dcsx.h:58
Definition: d3dcsx.h:66
HRESULT WINAPI D3DX11CreateFFT3DReal(ID3D11DeviceContext *pDeviceContext, UINT X, UINT Y, UINT Z, UINT Flags, _Out_ D3DX11_FFT_BUFFER_INFO *pBufferInfo, _Out_ ID3DX11FFT **ppFFT)
Definition: d3dcsx.h:54
_Field_range_(0, D3DX11_FFT_MAX_TEMP_BUFFERS) UINT NumTempBufferSizes
Definition: d3dcsx.h:55