1 /****************************************************************************
2 * Copyright (C) 2014-2016 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 * @brief API definitions
27 ******************************************************************************/
32 #include "common/os.h"
37 #include "common/simdintrin.h"
38 #include "common/formats.h"
39 #include "core/state.h"
41 typedef void(SWR_API
*PFN_CALLBACK_FUNC
)(uint64_t data
, uint64_t data2
, uint64_t data3
);
43 //////////////////////////////////////////////////////////////////////////
44 /// @brief Rectangle structure
47 int32_t xmin
; ///< inclusive
48 int32_t ymin
; ///< inclusive
49 int32_t xmax
; ///< exclusive
50 int32_t ymax
; ///< exclusive
52 bool operator == (const SWR_RECT
& rhs
)
54 return (this->ymin
== rhs
.ymin
&&
55 this->ymax
== rhs
.ymax
&&
56 this->xmin
== rhs
.xmin
&&
57 this->xmax
== rhs
.xmax
);
60 bool operator != (const SWR_RECT
& rhs
)
62 return !(*this == rhs
);
65 SWR_RECT
& Intersect(const SWR_RECT
& other
)
67 this->xmin
= std::max(this->xmin
, other
.xmin
);
68 this->ymin
= std::max(this->ymin
, other
.ymin
);
69 this->xmax
= std::min(this->xmax
, other
.xmax
);
70 this->ymax
= std::min(this->ymax
, other
.ymax
);
72 if (xmax
- xmin
< 0 ||
76 ymin
= ymax
= xmin
= xmax
= 0;
81 SWR_RECT
& operator &= (const SWR_RECT
& other
)
83 return Intersect(other
);
86 SWR_RECT
& Union(const SWR_RECT
& other
)
88 this->xmin
= std::min(this->xmin
, other
.xmin
);
89 this->ymin
= std::min(this->ymin
, other
.ymin
);
90 this->xmax
= std::max(this->xmax
, other
.xmax
);
91 this->ymax
= std::max(this->ymax
, other
.ymax
);
96 SWR_RECT
& operator |= (const SWR_RECT
& other
)
101 void Translate(int32_t x
, int32_t y
)
110 //////////////////////////////////////////////////////////////////////////
111 /// @brief Function signature for load hot tiles
112 /// @param hPrivateContext - handle to private data
113 /// @param dstFormat - format of the hot tile
114 /// @param renderTargetIndex - render target to store, can be color, depth or stencil
115 /// @param x - destination x coordinate
116 /// @param y - destination y coordinate
117 /// @param pDstHotTile - pointer to the hot tile surface
118 typedef void(SWR_API
*PFN_LOAD_TILE
)(HANDLE hPrivateContext
, SWR_FORMAT dstFormat
,
119 SWR_RENDERTARGET_ATTACHMENT renderTargetIndex
,
120 uint32_t x
, uint32_t y
, uint32_t renderTargetArrayIndex
, uint8_t *pDstHotTile
);
122 //////////////////////////////////////////////////////////////////////////
123 /// @brief Function signature for store hot tiles
124 /// @param hPrivateContext - handle to private data
125 /// @param srcFormat - format of the hot tile
126 /// @param renderTargetIndex - render target to store, can be color, depth or stencil
127 /// @param x - destination x coordinate
128 /// @param y - destination y coordinate
129 /// @param pSrcHotTile - pointer to the hot tile surface
130 typedef void(SWR_API
*PFN_STORE_TILE
)(HANDLE hPrivateContext
, SWR_FORMAT srcFormat
,
131 SWR_RENDERTARGET_ATTACHMENT renderTargetIndex
,
132 uint32_t x
, uint32_t y
, uint32_t renderTargetArrayIndex
, uint8_t *pSrcHotTile
);
134 //////////////////////////////////////////////////////////////////////////
135 /// @brief Function signature for clearing from the hot tiles clear value
136 /// @param hPrivateContext - handle to private data
137 /// @param renderTargetIndex - render target to store, can be color, depth or stencil
138 /// @param x - destination x coordinate
139 /// @param y - destination y coordinate
140 /// @param pClearColor - pointer to the hot tile's clear value
141 typedef void(SWR_API
*PFN_CLEAR_TILE
)(HANDLE hPrivateContext
,
142 SWR_RENDERTARGET_ATTACHMENT rtIndex
,
143 uint32_t x
, uint32_t y
, const float* pClearColor
);
145 //////////////////////////////////////////////////////////////////////////
146 /// @brief Callback to allow driver to update their copy of streamout write offset.
147 /// This is call is made for any draw operation that has streamout enabled
148 /// and has updated the write offset.
149 /// @param hPrivateContext - handle to private data
150 /// @param soBufferSlot - buffer slot for write offset
151 /// @param soWriteOffset - update value for so write offset.
152 typedef void(SWR_API
*PFN_UPDATE_SO_WRITE_OFFSET
)(HANDLE hPrivateContext
,
153 uint32_t soBufferSlot
, uint32_t soWriteOffset
);
155 //////////////////////////////////////////////////////////////////////////
156 /// @brief Callback to allow driver to update their copy of stats.
157 /// @param hPrivateContext - handle to private data
158 /// @param pStats - pointer to draw stats
159 typedef void(SWR_API
*PFN_UPDATE_STATS
)(HANDLE hPrivateContext
,
160 const SWR_STATS
* pStats
);
162 //////////////////////////////////////////////////////////////////////////
163 /// @brief Callback to allow driver to update their copy of FE stats.
164 /// @note Its optimal to have a separate callback for FE stats since
165 /// there is only one DC per FE thread. This means we do not have
166 /// to sum up the stats across all of the workers.
167 /// @param hPrivateContext - handle to private data
168 /// @param pStats - pointer to draw stats
169 typedef void(SWR_API
*PFN_UPDATE_STATS_FE
)(HANDLE hPrivateContext
,
170 const SWR_STATS_FE
* pStats
);
172 //////////////////////////////////////////////////////////////////////////
174 /// Forward Declaration (see rdtsc_buckets.h for full definition)
175 /////////////////////////////////////////////////////////////////////////
178 //////////////////////////////////////////////////////////////////////////
179 /// SWR_THREADING_INFO
180 /////////////////////////////////////////////////////////////////////////
181 struct SWR_THREADING_INFO
183 uint32_t MAX_WORKER_THREADS
;
184 uint32_t MAX_NUMA_NODES
;
185 uint32_t MAX_CORES_PER_NUMA_NODE
;
186 uint32_t MAX_THREADS_PER_CORE
;
187 bool SINGLE_THREADED
;
190 //////////////////////////////////////////////////////////////////////////
191 /// SWR_CREATECONTEXT_INFO
192 /////////////////////////////////////////////////////////////////////////
193 struct SWR_CREATECONTEXT_INFO
195 // External functions (e.g. sampler) need per draw context state.
196 // Use SwrGetPrivateContextState() to access private state.
197 uint32_t privateStateSize
;
199 // Callback functions
200 PFN_LOAD_TILE pfnLoadTile
;
201 PFN_STORE_TILE pfnStoreTile
;
202 PFN_CLEAR_TILE pfnClearTile
;
203 PFN_UPDATE_SO_WRITE_OFFSET pfnUpdateSoWriteOffset
;
204 PFN_UPDATE_STATS pfnUpdateStats
;
205 PFN_UPDATE_STATS_FE pfnUpdateStatsFE
;
208 // Pointer to rdtsc buckets mgr returned to the caller.
209 // Only populated when KNOB_ENABLE_RDTSC is set
210 BucketManager
* pBucketMgr
;
212 // Output: size required memory passed to for SwrSaveState / SwrRestoreState
213 size_t contextSaveSize
;
215 // Input (optional): Threading info that overrides any set KNOB values.
216 SWR_THREADING_INFO
* pThreadInfo
;
219 //////////////////////////////////////////////////////////////////////////
220 /// @brief Create SWR Context.
221 /// @param pCreateInfo - pointer to creation info.
222 HANDLE SWR_API
SwrCreateContext(
223 SWR_CREATECONTEXT_INFO
* pCreateInfo
);
225 //////////////////////////////////////////////////////////////////////////
226 /// @brief Destroys SWR Context.
227 /// @param hContext - Handle passed back from SwrCreateContext
228 void SWR_API
SwrDestroyContext(
231 //////////////////////////////////////////////////////////////////////////
232 /// @brief Saves API state associated with hContext
233 /// @param hContext - Handle passed back from SwrCreateContext
234 /// @param pOutputStateBlock - Memory block to receive API state data
235 /// @param memSize - Size of memory pointed to by pOutputStateBlock
236 void SWR_API
SwrSaveState(
238 void* pOutputStateBlock
,
241 //////////////////////////////////////////////////////////////////////////
242 /// @brief Restores API state to hContext previously saved with SwrSaveState
243 /// @param hContext - Handle passed back from SwrCreateContext
244 /// @param pStateBlock - Memory block to read API state data from
245 /// @param memSize - Size of memory pointed to by pStateBlock
246 void SWR_API
SwrRestoreState(
248 const void* pStateBlock
,
251 //////////////////////////////////////////////////////////////////////////
252 /// @brief Sync cmd. Executes the callback func when all rendering up to this sync
253 /// has been completed
254 /// @param hContext - Handle passed back from SwrCreateContext
255 /// @param pfnFunc - pointer to callback function,
256 /// @param userData - user data to pass back
257 void SWR_API
SwrSync(
259 PFN_CALLBACK_FUNC pfnFunc
,
262 uint64_t userData3
= 0);
264 //////////////////////////////////////////////////////////////////////////
265 /// @brief Blocks until all rendering has been completed.
266 /// @param hContext - Handle passed back from SwrCreateContext
267 void SWR_API
SwrWaitForIdle(
270 //////////////////////////////////////////////////////////////////////////
271 /// @brief Blocks until all FE rendering has been completed.
272 /// @param hContext - Handle passed back from SwrCreateContext
273 void SWR_API
SwrWaitForIdleFE(
276 //////////////////////////////////////////////////////////////////////////
277 /// @brief Set vertex buffer state.
278 /// @param hContext - Handle passed back from SwrCreateContext
279 /// @param numBuffers - Number of vertex buffer state descriptors.
280 /// @param pVertexBuffers - Array of vertex buffer state descriptors.
281 void SWR_API
SwrSetVertexBuffers(
284 const SWR_VERTEX_BUFFER_STATE
* pVertexBuffers
);
286 //////////////////////////////////////////////////////////////////////////
287 /// @brief Set index buffer
288 /// @param hContext - Handle passed back from SwrCreateContext
289 /// @param pIndexBuffer - Index buffer.
290 void SWR_API
SwrSetIndexBuffer(
292 const SWR_INDEX_BUFFER_STATE
* pIndexBuffer
);
294 //////////////////////////////////////////////////////////////////////////
295 /// @brief Set fetch shader pointer.
296 /// @param hContext - Handle passed back from SwrCreateContext
297 /// @param pfnFetchFunc - Pointer to shader.
298 void SWR_API
SwrSetFetchFunc(
300 PFN_FETCH_FUNC pfnFetchFunc
);
302 //////////////////////////////////////////////////////////////////////////
303 /// @brief Set streamout shader pointer.
304 /// @param hContext - Handle passed back from SwrCreateContext
305 /// @param pfnSoFunc - Pointer to shader.
306 /// @param streamIndex - specifies stream
307 void SWR_API
SwrSetSoFunc(
309 PFN_SO_FUNC pfnSoFunc
,
310 uint32_t streamIndex
);
312 //////////////////////////////////////////////////////////////////////////
313 /// @brief Set streamout state
314 /// @param hContext - Handle passed back from SwrCreateContext
315 /// @param pSoState - Pointer to streamout state.
316 void SWR_API
SwrSetSoState(
318 SWR_STREAMOUT_STATE
* pSoState
);
320 //////////////////////////////////////////////////////////////////////////
321 /// @brief Set streamout buffer state
322 /// @param hContext - Handle passed back from SwrCreateContext
323 /// @param pSoBuffer - Pointer to streamout buffer.
324 /// @param slot - Slot to bind SO buffer to.
325 void SWR_API
SwrSetSoBuffers(
327 SWR_STREAMOUT_BUFFER
* pSoBuffer
,
330 //////////////////////////////////////////////////////////////////////////
331 /// @brief Set vertex shader pointer.
332 /// @param hContext - Handle passed back from SwrCreateContext
333 /// @param pfnVertexFunc - Pointer to shader.
334 void SWR_API
SwrSetVertexFunc(
336 PFN_VERTEX_FUNC pfnVertexFunc
);
338 //////////////////////////////////////////////////////////////////////////
339 /// @brief Set frontend state.
340 /// @param hContext - Handle passed back from SwrCreateContext
341 /// @param pState - Pointer to state
342 void SWR_API
SwrSetFrontendState(
344 SWR_FRONTEND_STATE
*pState
);
346 //////////////////////////////////////////////////////////////////////////
347 /// @brief Set geometry shader state.
348 /// @param hContext - Handle passed back from SwrCreateContext
349 /// @param pState - Pointer to state
350 void SWR_API
SwrSetGsState(
352 SWR_GS_STATE
*pState
);
354 //////////////////////////////////////////////////////////////////////////
355 /// @brief Set geometry shader
356 /// @param hContext - Handle passed back from SwrCreateContext
357 /// @param pState - Pointer to geometry shader function
358 void SWR_API
SwrSetGsFunc(
360 PFN_GS_FUNC pfnGsFunc
);
362 //////////////////////////////////////////////////////////////////////////
363 /// @brief Set compute shader
364 /// @param hContext - Handle passed back from SwrCreateContext
365 /// @param pfnCsFunc - Pointer to compute shader function
366 /// @param totalThreadsInGroup - product of thread group dimensions.
367 /// @param totalSpillFillSize - size in bytes needed for spill/fill.
368 void SWR_API
SwrSetCsFunc(
370 PFN_CS_FUNC pfnCsFunc
,
371 uint32_t totalThreadsInGroup
,
372 uint32_t totalSpillFillSize
);
374 //////////////////////////////////////////////////////////////////////////
375 /// @brief Set tessellation state.
376 /// @param hContext - Handle passed back from SwrCreateContext
377 /// @param pState - Pointer to state
378 void SWR_API
SwrSetTsState(
380 SWR_TS_STATE
*pState
);
382 //////////////////////////////////////////////////////////////////////////
383 /// @brief Set hull shader
384 /// @param hContext - Handle passed back from SwrCreateContext
385 /// @param pfnFunc - Pointer to shader function
386 void SWR_API
SwrSetHsFunc(
388 PFN_HS_FUNC pfnFunc
);
390 //////////////////////////////////////////////////////////////////////////
391 /// @brief Set domain shader
392 /// @param hContext - Handle passed back from SwrCreateContext
393 /// @param pfnFunc - Pointer to shader function
394 void SWR_API
SwrSetDsFunc(
396 PFN_DS_FUNC pfnFunc
);
398 //////////////////////////////////////////////////////////////////////////
399 /// @brief Set depth stencil state
400 /// @param hContext - Handle passed back from SwrCreateContext
401 /// @param pState - Pointer to state.
402 void SWR_API
SwrSetDepthStencilState(
404 SWR_DEPTH_STENCIL_STATE
*pState
);
406 //////////////////////////////////////////////////////////////////////////
407 /// @brief Set backend state
408 /// @param hContext - Handle passed back from SwrCreateContext
409 /// @param pState - Pointer to state.
410 void SWR_API
SwrSetBackendState(
412 SWR_BACKEND_STATE
*pState
);
414 //////////////////////////////////////////////////////////////////////////
415 /// @brief Set depth bounds state
416 /// @param hContext - Handle passed back from SwrCreateContext
417 /// @param pState - Pointer to state.
418 void SWR_API
SwrSetDepthBoundsState(
420 SWR_DEPTH_BOUNDS_STATE
*pState
);
422 //////////////////////////////////////////////////////////////////////////
423 /// @brief Set pixel shader state
424 /// @param hContext - Handle passed back from SwrCreateContext
425 /// @param pState - Pointer to state.
426 void SWR_API
SwrSetPixelShaderState(
428 SWR_PS_STATE
*pState
);
430 //////////////////////////////////////////////////////////////////////////
431 /// @brief Set blend state
432 /// @param hContext - Handle passed back from SwrCreateContext
433 /// @param pState - Pointer to state.
434 void SWR_API
SwrSetBlendState(
436 SWR_BLEND_STATE
*pState
);
438 //////////////////////////////////////////////////////////////////////////
439 /// @brief Set blend function
440 /// @param hContext - Handle passed back from SwrCreateContext
441 /// @param renderTarget - render target index
442 /// @param pfnBlendFunc - function pointer
443 void SWR_API
SwrSetBlendFunc(
445 uint32_t renderTarget
,
446 PFN_BLEND_JIT_FUNC pfnBlendFunc
);
448 //////////////////////////////////////////////////////////////////////////
450 /// @param hContext - Handle passed back from SwrCreateContext
451 /// @param topology - Specifies topology for draw.
452 /// @param startVertex - Specifies start vertex in vertex buffer for draw.
453 /// @param primCount - Number of vertices.
454 void SWR_API
SwrDraw(
456 PRIMITIVE_TOPOLOGY topology
,
457 uint32_t startVertex
,
460 //////////////////////////////////////////////////////////////////////////
461 /// @brief SwrDrawInstanced
462 /// @param hContext - Handle passed back from SwrCreateContext
463 /// @param topology - Specifies topology for draw.
464 /// @param numVertsPerInstance - How many vertices to read sequentially from vertex data.
465 /// @param numInstances - How many instances to render.
466 /// @param startVertex - Specifies start vertex for draw. (vertex data)
467 /// @param startInstance - Which instance to start sequentially fetching from in each buffer (instanced data)
468 void SWR_API
SwrDrawInstanced(
470 PRIMITIVE_TOPOLOGY topology
,
471 uint32_t numVertsPerInstance
,
472 uint32_t numInstances
,
473 uint32_t startVertex
,
474 uint32_t startInstance
);
476 //////////////////////////////////////////////////////////////////////////
477 /// @brief DrawIndexed
478 /// @param hContext - Handle passed back from SwrCreateContext
479 /// @param topology - Specifies topology for draw.
480 /// @param numIndices - Number of indices to read sequentially from index buffer.
481 /// @param indexOffset - Starting index into index buffer.
482 /// @param baseVertex - Vertex in vertex buffer to consider as index "0". Note value is signed.
483 void SWR_API
SwrDrawIndexed(
485 PRIMITIVE_TOPOLOGY topology
,
487 uint32_t indexOffset
,
490 //////////////////////////////////////////////////////////////////////////
491 /// @brief SwrDrawIndexedInstanced
492 /// @param hContext - Handle passed back from SwrCreateContext
493 /// @param topology - Specifies topology for draw.
494 /// @param numIndices - Number of indices to read sequentially from index buffer.
495 /// @param numInstances - Number of instances to render.
496 /// @param indexOffset - Starting index into index buffer.
497 /// @param baseVertex - Vertex in vertex buffer to consider as index "0". Note value is signed.
498 /// @param startInstance - Which instance to start sequentially fetching from in each buffer (instanced data)
499 void SWR_API
SwrDrawIndexedInstanced(
501 PRIMITIVE_TOPOLOGY topology
,
503 uint32_t numInstances
,
504 uint32_t indexOffset
,
506 uint32_t startInstance
);
508 //////////////////////////////////////////////////////////////////////////
509 /// @brief SwrInvalidateTiles
510 /// @param hContext - Handle passed back from SwrCreateContext
511 /// @param attachmentMask - The mask specifies which surfaces attached to the hottiles to invalidate.
512 /// @param invalidateRect - The pixel-coordinate rectangle to invalidate. This will be expanded to
513 /// be hottile size-aligned.
514 void SWR_API
SwrInvalidateTiles(
516 uint32_t attachmentMask
,
517 const SWR_RECT
& invalidateRect
);
519 //////////////////////////////////////////////////////////////////////////
520 /// @brief SwrDiscardRect
521 /// @param hContext - Handle passed back from SwrCreateContext
522 /// @param attachmentMask - The mask specifies which surfaces attached to the hottiles to discard.
523 /// @param rect - The pixel-coordinate rectangle to discard. Only fully-covered hottiles will be
525 void SWR_API
SwrDiscardRect(
527 uint32_t attachmentMask
,
528 const SWR_RECT
& rect
);
530 //////////////////////////////////////////////////////////////////////////
531 /// @brief SwrDispatch
532 /// @param hContext - Handle passed back from SwrCreateContext
533 /// @param threadGroupCountX - Number of thread groups dispatched in X direction
534 /// @param threadGroupCountY - Number of thread groups dispatched in Y direction
535 /// @param threadGroupCountZ - Number of thread groups dispatched in Z direction
536 void SWR_API
SwrDispatch(
538 uint32_t threadGroupCountX
,
539 uint32_t threadGroupCountY
,
540 uint32_t threadGroupCountZ
);
545 SWR_TILE_INVALID
= 0, // tile is in unitialized state and should be loaded with surface contents before rendering
546 SWR_TILE_DIRTY
= 2, // tile contains newer data than surface it represents
547 SWR_TILE_RESOLVED
= 3, // is in sync with surface it represents
550 /// @todo Add a good description for what attachments are and when and why you would use the different SWR_TILE_STATEs.
551 void SWR_API
SwrStoreTiles(
553 uint32_t attachmentMask
,
554 SWR_TILE_STATE postStoreTileState
,
555 const SWR_RECT
& storeRect
);
558 //////////////////////////////////////////////////////////////////////////
559 /// @brief SwrClearRenderTarget - Clear attached render targets / depth / stencil
560 /// @param hContext - Handle passed back from SwrCreateContext
561 /// @param attachmentMask - combination of SWR_ATTACHMENT_*_BIT attachments to clear
562 /// @param clearColor - color use for clearing render targets
563 /// @param z - depth value use for clearing depth buffer
564 /// @param stencil - stencil value used for clearing stencil buffer
565 /// @param clearRect - The pixel-coordinate rectangle to clear in all cleared buffers
566 void SWR_API
SwrClearRenderTarget(
568 uint32_t attachmentMask
,
569 const float clearColor
[4],
572 const SWR_RECT
& clearRect
);
574 //////////////////////////////////////////////////////////////////////////
575 /// @brief SwrSetRastState
576 /// @param hContext - Handle passed back from SwrCreateContext
577 /// @param pRastState - New SWR_RASTSTATE used for SwrDraw* commands
578 void SWR_API
SwrSetRastState(
580 const SWR_RASTSTATE
*pRastState
);
582 //////////////////////////////////////////////////////////////////////////
583 /// @brief SwrSetViewports
584 /// @param hContext - Handle passed back from SwrCreateContext
585 /// @param numViewports - number of viewports passed in
586 /// @param pViewports - Specifies extents of viewport.
587 /// @param pMatrices - If not specified then SWR computes a default one.
588 void SWR_API
SwrSetViewports(
590 uint32_t numViewports
,
591 const SWR_VIEWPORT
* pViewports
,
592 const SWR_VIEWPORT_MATRICES
* pMatrices
);
594 //////////////////////////////////////////////////////////////////////////
595 /// @brief SwrSetScissorRects
596 /// @param hContext - Handle passed back from SwrCreateContext
597 /// @param numScissors - number of scissors passed in
598 /// @param pScissors - array of scissors
599 void SWR_API
SwrSetScissorRects(
601 uint32_t numScissors
,
602 const SWR_RECT
* pScissors
);
604 //////////////////////////////////////////////////////////////////////////
605 /// @brief Returns a pointer to the private context state for the current
606 /// draw operation. This is used for external componets such as the
609 /// @note Client needs to resend private state prior to each draw call.
610 /// Also, SWR is responsible for the private state memory.
611 /// @param hContext - Handle passed back from SwrCreateContext
612 VOID
* SWR_API
SwrGetPrivateContextState(
615 //////////////////////////////////////////////////////////////////////////
616 /// @brief Clients can use this to allocate memory for draw/dispatch
617 /// operations. The memory will automatically be freed once operation
618 /// has completed. Client can use this to allocate binding tables,
619 /// etc. needed for shader execution.
620 /// @param hContext - Handle passed back from SwrCreateContext
621 /// @param size - Size of allocation
622 /// @param align - Alignment needed for allocation.
623 VOID
* SWR_API
SwrAllocDrawContextMemory(
628 //////////////////////////////////////////////////////////////////////////
629 /// @brief Enables stats counting
630 /// @param hContext - Handle passed back from SwrCreateContext
631 /// @param enable - If true then counts are incremented.
632 void SWR_API
SwrEnableStatsFE(
636 //////////////////////////////////////////////////////////////////////////
637 /// @brief Enables stats counting
638 /// @param hContext - Handle passed back from SwrCreateContext
639 /// @param enable - If true then counts are incremented.
640 void SWR_API
SwrEnableStatsBE(
644 //////////////////////////////////////////////////////////////////////////
645 /// @brief Mark end of frame - used for performance profiling
646 /// @param hContext - Handle passed back from SwrCreateContext
647 void SWR_API
SwrEndFrame(