17ec681f3Smrg/**************************************************************************
27ec681f3Smrg *
37ec681f3Smrg * Copyright 2012-2021 VMware, Inc.
47ec681f3Smrg * All Rights Reserved.
57ec681f3Smrg *
67ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a
77ec681f3Smrg * copy of this software and associated documentation files (the
87ec681f3Smrg * "Software"), to deal in the Software without restriction, including
97ec681f3Smrg * without limitation the rights to use, copy, modify, merge, publish,
107ec681f3Smrg * distribute, sub license, and/or sell copies of the Software, and to
117ec681f3Smrg * permit persons to whom the Software is furnished to do so, subject to
127ec681f3Smrg * the following conditions:
137ec681f3Smrg *
147ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157ec681f3Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167ec681f3Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
177ec681f3Smrg * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
187ec681f3Smrg * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
197ec681f3Smrg * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
207ec681f3Smrg * USE OR OTHER DEALINGS IN THE SOFTWARE.
217ec681f3Smrg *
227ec681f3Smrg * The above copyright notice and this permission notice (including the
237ec681f3Smrg * next paragraph) shall be included in all copies or substantial portions
247ec681f3Smrg * of the Software.
257ec681f3Smrg *
267ec681f3Smrg **************************************************************************/
277ec681f3Smrg
287ec681f3Smrg/*
297ec681f3Smrg * Query.cpp --
307ec681f3Smrg *    Functions that manipulate query resources.
317ec681f3Smrg */
327ec681f3Smrg
337ec681f3Smrg
347ec681f3Smrg#include "Query.h"
357ec681f3Smrg#include "State.h"
367ec681f3Smrg
377ec681f3Smrg#include "Debug.h"
387ec681f3Smrg
397ec681f3Smrg
407ec681f3Smrg/*
417ec681f3Smrg * ----------------------------------------------------------------------
427ec681f3Smrg *
437ec681f3Smrg * CalcPrivateQuerySize --
447ec681f3Smrg *
457ec681f3Smrg *    The CalcPrivateQuerySize function determines the size of the
467ec681f3Smrg *    user-mode display driver's private region of memory (that is,
477ec681f3Smrg *    the size of internal driver structures, not the size of the
487ec681f3Smrg *    resource video memory) for a query.
497ec681f3Smrg *
507ec681f3Smrg * ----------------------------------------------------------------------
517ec681f3Smrg */
527ec681f3Smrg
537ec681f3SmrgSIZE_T APIENTRY
547ec681f3SmrgCalcPrivateQuerySize(D3D10DDI_HDEVICE hDevice,                          // IN
557ec681f3Smrg                     __in const D3D10DDIARG_CREATEQUERY *pCreateQuery)  // IN
567ec681f3Smrg{
577ec681f3Smrg   return sizeof(Query);
587ec681f3Smrg}
597ec681f3Smrg
607ec681f3Smrg
617ec681f3Smrgstatic uint
627ec681f3SmrgTranslateQueryType(D3D10DDI_QUERY query)
637ec681f3Smrg{
647ec681f3Smrg   switch (query) {
657ec681f3Smrg   case D3D10DDI_QUERY_EVENT:
667ec681f3Smrg      return PIPE_QUERY_GPU_FINISHED;
677ec681f3Smrg   case D3D10DDI_QUERY_OCCLUSION:
687ec681f3Smrg      return PIPE_QUERY_OCCLUSION_COUNTER;
697ec681f3Smrg   case D3D10DDI_QUERY_TIMESTAMP:
707ec681f3Smrg      return PIPE_QUERY_TIMESTAMP;
717ec681f3Smrg   case D3D10DDI_QUERY_TIMESTAMPDISJOINT:
727ec681f3Smrg      return PIPE_QUERY_TIMESTAMP_DISJOINT;
737ec681f3Smrg   case D3D10DDI_QUERY_PIPELINESTATS:
747ec681f3Smrg      return PIPE_QUERY_PIPELINE_STATISTICS;
757ec681f3Smrg   case D3D10DDI_QUERY_OCCLUSIONPREDICATE:
767ec681f3Smrg      return PIPE_QUERY_OCCLUSION_PREDICATE;
777ec681f3Smrg   case D3D10DDI_QUERY_STREAMOUTPUTSTATS:
787ec681f3Smrg      return PIPE_QUERY_SO_STATISTICS;
797ec681f3Smrg   case D3D10DDI_QUERY_STREAMOVERFLOWPREDICATE:
807ec681f3Smrg      return PIPE_QUERY_SO_OVERFLOW_PREDICATE;
817ec681f3Smrg   default:
827ec681f3Smrg      LOG_UNSUPPORTED(TRUE);
837ec681f3Smrg      return PIPE_QUERY_TYPES;
847ec681f3Smrg   }
857ec681f3Smrg}
867ec681f3Smrg
877ec681f3Smrg
887ec681f3Smrg/*
897ec681f3Smrg * ----------------------------------------------------------------------
907ec681f3Smrg *
917ec681f3Smrg * CreateQuery --
927ec681f3Smrg *
937ec681f3Smrg *    The CreateQuery function creates driver-side resources for a
947ec681f3Smrg *    query that the Microsoft Direct3D runtime subsequently issues
957ec681f3Smrg *    for processing.
967ec681f3Smrg *
977ec681f3Smrg * ----------------------------------------------------------------------
987ec681f3Smrg */
997ec681f3Smrg
1007ec681f3Smrgvoid APIENTRY
1017ec681f3SmrgCreateQuery(D3D10DDI_HDEVICE hDevice,                          // IN
1027ec681f3Smrg            __in const D3D10DDIARG_CREATEQUERY *pCreateQuery,  // IN
1037ec681f3Smrg            D3D10DDI_HQUERY hQuery,                            // IN
1047ec681f3Smrg            D3D10DDI_HRTQUERY hRTQuery)                        // IN
1057ec681f3Smrg{
1067ec681f3Smrg   LOG_ENTRYPOINT();
1077ec681f3Smrg
1087ec681f3Smrg   Device *pDevice = CastDevice(hDevice);
1097ec681f3Smrg   struct pipe_context *pipe = pDevice->pipe;
1107ec681f3Smrg
1117ec681f3Smrg   Query *pQuery = CastQuery(hQuery);
1127ec681f3Smrg   memset(pQuery, 0, sizeof *pQuery);
1137ec681f3Smrg
1147ec681f3Smrg   pQuery->Type = pCreateQuery->Query;
1157ec681f3Smrg   pQuery->Flags = pCreateQuery->MiscFlags;
1167ec681f3Smrg
1177ec681f3Smrg   pQuery->pipe_type = TranslateQueryType(pCreateQuery->Query);
1187ec681f3Smrg   if (pQuery->pipe_type < PIPE_QUERY_TYPES) {
1197ec681f3Smrg      pQuery->handle = pipe->create_query(pipe, pQuery->pipe_type, 0);
1207ec681f3Smrg   }
1217ec681f3Smrg}
1227ec681f3Smrg
1237ec681f3Smrg
1247ec681f3Smrg/*
1257ec681f3Smrg * ----------------------------------------------------------------------
1267ec681f3Smrg *
1277ec681f3Smrg * DestroyQuery --
1287ec681f3Smrg *
1297ec681f3Smrg *    The DestroyQuery function releases resources for a query.
1307ec681f3Smrg *
1317ec681f3Smrg * ----------------------------------------------------------------------
1327ec681f3Smrg */
1337ec681f3Smrg
1347ec681f3Smrgvoid APIENTRY
1357ec681f3SmrgDestroyQuery(D3D10DDI_HDEVICE hDevice, // IN
1367ec681f3Smrg             D3D10DDI_HQUERY hQuery)   // IN
1377ec681f3Smrg{
1387ec681f3Smrg   LOG_ENTRYPOINT();
1397ec681f3Smrg
1407ec681f3Smrg   struct pipe_context *pipe = CastPipeContext(hDevice);
1417ec681f3Smrg   Query *pQuery = CastQuery(hQuery);
1427ec681f3Smrg
1437ec681f3Smrg   if (pQuery->handle) {
1447ec681f3Smrg      pipe->destroy_query(pipe, pQuery->handle);
1457ec681f3Smrg   }
1467ec681f3Smrg}
1477ec681f3Smrg
1487ec681f3Smrg
1497ec681f3Smrg/*
1507ec681f3Smrg * ----------------------------------------------------------------------
1517ec681f3Smrg *
1527ec681f3Smrg * QueryBegin --
1537ec681f3Smrg *
1547ec681f3Smrg *    The QueryBegin function marks the beginning of a sequence of
1557ec681f3Smrg *    graphics commands for a query and transitions the query to the
1567ec681f3Smrg *    "building" state.
1577ec681f3Smrg *
1587ec681f3Smrg * ----------------------------------------------------------------------
1597ec681f3Smrg */
1607ec681f3Smrg
1617ec681f3Smrgvoid APIENTRY
1627ec681f3SmrgQueryBegin(D3D10DDI_HDEVICE hDevice,   // IN
1637ec681f3Smrg           D3D10DDI_HQUERY hQuery)     // IN
1647ec681f3Smrg{
1657ec681f3Smrg   LOG_ENTRYPOINT();
1667ec681f3Smrg
1677ec681f3Smrg   Device *pDevice = CastDevice(hDevice);
1687ec681f3Smrg   struct pipe_context *pipe = pDevice->pipe;
1697ec681f3Smrg
1707ec681f3Smrg   Query *pQuery = CastQuery(hQuery);
1717ec681f3Smrg   struct pipe_query *state = CastPipeQuery(hQuery);
1727ec681f3Smrg
1737ec681f3Smrg   if (state) {
1747ec681f3Smrg      assert(pQuery->pipe_type < PIPE_QUERY_TYPES);
1757ec681f3Smrg      pipe->begin_query(pipe, state);
1767ec681f3Smrg   }
1777ec681f3Smrg}
1787ec681f3Smrg
1797ec681f3Smrg
1807ec681f3Smrg/*
1817ec681f3Smrg * ----------------------------------------------------------------------
1827ec681f3Smrg *
1837ec681f3Smrg * QueryEnd --
1847ec681f3Smrg *
1857ec681f3Smrg *    The QueryEnd function marks the end of a sequence of graphics
1867ec681f3Smrg *    commands for a query and transitions the query to the
1877ec681f3Smrg *    "issued" state.
1887ec681f3Smrg *
1897ec681f3Smrg * ----------------------------------------------------------------------
1907ec681f3Smrg */
1917ec681f3Smrg
1927ec681f3Smrgvoid APIENTRY
1937ec681f3SmrgQueryEnd(D3D10DDI_HDEVICE hDevice,  // IN
1947ec681f3Smrg         D3D10DDI_HQUERY hQuery)    // IN
1957ec681f3Smrg{
1967ec681f3Smrg   LOG_ENTRYPOINT();
1977ec681f3Smrg
1987ec681f3Smrg   Device *pDevice = CastDevice(hDevice);
1997ec681f3Smrg   struct pipe_context *pipe = pDevice->pipe;
2007ec681f3Smrg   Query *pQuery = CastQuery(hQuery);
2017ec681f3Smrg   struct pipe_query *state = pQuery->handle;
2027ec681f3Smrg
2037ec681f3Smrg   pQuery->SeqNo = ++pDevice->LastEmittedQuerySeqNo;
2047ec681f3Smrg   pQuery->GetDataCount = 0;
2057ec681f3Smrg
2067ec681f3Smrg   if (state) {
2077ec681f3Smrg      pipe->end_query(pipe, state);
2087ec681f3Smrg   }
2097ec681f3Smrg}
2107ec681f3Smrg
2117ec681f3Smrg
2127ec681f3Smrg/*
2137ec681f3Smrg * ----------------------------------------------------------------------
2147ec681f3Smrg *
2157ec681f3Smrg * QueryGetData --
2167ec681f3Smrg *
2177ec681f3Smrg *    The QueryGetData function polls for the state of a query operation.
2187ec681f3Smrg *
2197ec681f3Smrg * ----------------------------------------------------------------------
2207ec681f3Smrg */
2217ec681f3Smrg
2227ec681f3Smrgvoid APIENTRY
2237ec681f3SmrgQueryGetData(D3D10DDI_HDEVICE hDevice,                      // IN
2247ec681f3Smrg             D3D10DDI_HQUERY hQuery,                        // IN
2257ec681f3Smrg             __out_bcount_full_opt (DataSize) void *pData,  // OUT
2267ec681f3Smrg             UINT DataSize,                                 // IN
2277ec681f3Smrg             UINT Flags)                                    // IN
2287ec681f3Smrg{
2297ec681f3Smrg   LOG_ENTRYPOINT();
2307ec681f3Smrg
2317ec681f3Smrg   Device *pDevice = CastDevice(hDevice);
2327ec681f3Smrg   struct pipe_context *pipe = pDevice->pipe;
2337ec681f3Smrg   Query *pQuery = CastQuery(hQuery);
2347ec681f3Smrg   struct pipe_query *state = pQuery->handle;
2357ec681f3Smrg
2367ec681f3Smrg   /*
2377ec681f3Smrg    * Never return data for recently emitted queries immediately, to make
2387ec681f3Smrg    * wgfasync happy.
2397ec681f3Smrg    */
2407ec681f3Smrg   if (DataSize == 0 &&
2417ec681f3Smrg       (pQuery->SeqNo - pDevice->LastFinishedQuerySeqNo) > 0 &&
2427ec681f3Smrg       (pQuery->GetDataCount++) == 0) {
2437ec681f3Smrg      SetError(hDevice, DXGI_DDI_ERR_WASSTILLDRAWING);
2447ec681f3Smrg      return;
2457ec681f3Smrg   }
2467ec681f3Smrg
2477ec681f3Smrg   boolean wait = !!(Flags & D3D10_DDI_GET_DATA_DO_NOT_FLUSH);
2487ec681f3Smrg   union pipe_query_result result;
2497ec681f3Smrg
2507ec681f3Smrg   memset(&result, 0, sizeof result);
2517ec681f3Smrg
2527ec681f3Smrg   boolean ret;
2537ec681f3Smrg
2547ec681f3Smrg   if (state) {
2557ec681f3Smrg      ret = pipe->get_query_result(pipe, state, wait, &result);
2567ec681f3Smrg   } else {
2577ec681f3Smrg      LOG_UNSUPPORTED(TRUE);
2587ec681f3Smrg      ret = TRUE;
2597ec681f3Smrg   }
2607ec681f3Smrg
2617ec681f3Smrg   if (!ret) {
2627ec681f3Smrg      SetError(hDevice, DXGI_DDI_ERR_WASSTILLDRAWING);
2637ec681f3Smrg      return;
2647ec681f3Smrg   }
2657ec681f3Smrg
2667ec681f3Smrg   if (pData) {
2677ec681f3Smrg      switch (pQuery->Type) {
2687ec681f3Smrg      case D3D10DDI_QUERY_EVENT:
2697ec681f3Smrg      case D3D10DDI_QUERY_OCCLUSIONPREDICATE:
2707ec681f3Smrg      case D3D10DDI_QUERY_STREAMOVERFLOWPREDICATE:
2717ec681f3Smrg         *(BOOL *)pData = result.b;
2727ec681f3Smrg         break;
2737ec681f3Smrg      case D3D10DDI_QUERY_OCCLUSION:
2747ec681f3Smrg      case D3D10DDI_QUERY_TIMESTAMP:
2757ec681f3Smrg         *(UINT64 *)pData = result.u64;
2767ec681f3Smrg         break;
2777ec681f3Smrg      case D3D10DDI_QUERY_TIMESTAMPDISJOINT:
2787ec681f3Smrg         {
2797ec681f3Smrg            D3D10_DDI_QUERY_DATA_TIMESTAMP_DISJOINT *pResult =
2807ec681f3Smrg              (D3D10_DDI_QUERY_DATA_TIMESTAMP_DISJOINT *)pData;
2817ec681f3Smrg            pResult->Frequency = result.timestamp_disjoint.frequency;
2827ec681f3Smrg            pResult->Disjoint = result.timestamp_disjoint.disjoint;
2837ec681f3Smrg         }
2847ec681f3Smrg         break;
2857ec681f3Smrg      case D3D10DDI_QUERY_PIPELINESTATS:
2867ec681f3Smrg         {
2877ec681f3Smrg            D3D10_DDI_QUERY_DATA_PIPELINE_STATISTICS *pResult =
2887ec681f3Smrg              (D3D10_DDI_QUERY_DATA_PIPELINE_STATISTICS *)pData;
2897ec681f3Smrg            pResult->IAVertices = result.pipeline_statistics.ia_vertices;
2907ec681f3Smrg            pResult->IAPrimitives = result.pipeline_statistics.ia_primitives;
2917ec681f3Smrg            pResult->VSInvocations = result.pipeline_statistics.vs_invocations;
2927ec681f3Smrg            pResult->GSInvocations = result.pipeline_statistics.gs_invocations;
2937ec681f3Smrg            pResult->GSPrimitives = result.pipeline_statistics.gs_primitives;
2947ec681f3Smrg            pResult->CInvocations = result.pipeline_statistics.c_invocations;
2957ec681f3Smrg            pResult->CPrimitives = result.pipeline_statistics.c_primitives;
2967ec681f3Smrg            pResult->PSInvocations = result.pipeline_statistics.ps_invocations;
2977ec681f3Smrg            //pResult->HSInvocations = result.pipeline_statistics.hs_invocations;
2987ec681f3Smrg            //pResult->DSInvocations = result.pipeline_statistics.ds_invocations;
2997ec681f3Smrg            //pResult->CSInvocations = result.pipeline_statistics.cs_invocations;
3007ec681f3Smrg         }
3017ec681f3Smrg         break;
3027ec681f3Smrg      case D3D10DDI_QUERY_STREAMOUTPUTSTATS:
3037ec681f3Smrg         {
3047ec681f3Smrg            D3D10_DDI_QUERY_DATA_SO_STATISTICS *pResult =
3057ec681f3Smrg              (D3D10_DDI_QUERY_DATA_SO_STATISTICS *)pData;
3067ec681f3Smrg            pResult->NumPrimitivesWritten = result.so_statistics.num_primitives_written;
3077ec681f3Smrg            pResult->PrimitivesStorageNeeded = result.so_statistics.primitives_storage_needed;
3087ec681f3Smrg         }
3097ec681f3Smrg         break;
3107ec681f3Smrg      default:
3117ec681f3Smrg         assert(0);
3127ec681f3Smrg         break;
3137ec681f3Smrg      }
3147ec681f3Smrg   }
3157ec681f3Smrg
3167ec681f3Smrg   /*
3177ec681f3Smrg    * Keep track of the last finished query, as wgfasync checks that queries
3187ec681f3Smrg    * are completed in order.
3197ec681f3Smrg    */
3207ec681f3Smrg   if ((pQuery->SeqNo - pDevice->LastFinishedQuerySeqNo) > 0) {
3217ec681f3Smrg      pDevice->LastFinishedQuerySeqNo = pQuery->SeqNo;
3227ec681f3Smrg   }
3237ec681f3Smrg   pQuery->GetDataCount = 0x80000000;
3247ec681f3Smrg}
3257ec681f3Smrg
3267ec681f3Smrg
3277ec681f3Smrg/*
3287ec681f3Smrg * ----------------------------------------------------------------------
3297ec681f3Smrg *
3307ec681f3Smrg * SetPredication --
3317ec681f3Smrg *
3327ec681f3Smrg *    The SetPredication function specifies whether rendering and
3337ec681f3Smrg *    resource-manipulation commands that follow are actually performed.
3347ec681f3Smrg *
3357ec681f3Smrg * ----------------------------------------------------------------------
3367ec681f3Smrg */
3377ec681f3Smrg
3387ec681f3Smrgvoid APIENTRY
3397ec681f3SmrgSetPredication(D3D10DDI_HDEVICE hDevice,  // IN
3407ec681f3Smrg               D3D10DDI_HQUERY hQuery,    // IN
3417ec681f3Smrg               BOOL PredicateValue)       // IN
3427ec681f3Smrg{
3437ec681f3Smrg   LOG_ENTRYPOINT();
3447ec681f3Smrg
3457ec681f3Smrg   Device *pDevice = CastDevice(hDevice);
3467ec681f3Smrg   struct pipe_context *pipe = pDevice->pipe;
3477ec681f3Smrg   Query *pQuery = CastQuery(hQuery);
3487ec681f3Smrg   struct pipe_query *state = CastPipeQuery(hQuery);
3497ec681f3Smrg   enum pipe_render_cond_flag wait;
3507ec681f3Smrg
3517ec681f3Smrg   wait = (pQuery && pQuery->Flags & D3D10DDI_QUERY_MISCFLAG_PREDICATEHINT) ?
3527ec681f3Smrg             PIPE_RENDER_COND_NO_WAIT : PIPE_RENDER_COND_WAIT;
3537ec681f3Smrg
3547ec681f3Smrg   pipe->render_condition(pipe, state, PredicateValue, wait);
3557ec681f3Smrg
3567ec681f3Smrg   pDevice->pPredicate = pQuery;
3577ec681f3Smrg   pDevice->PredicateValue = PredicateValue;
3587ec681f3Smrg}
3597ec681f3Smrg
3607ec681f3Smrg
3617ec681f3Smrg/*
3627ec681f3Smrg * ----------------------------------------------------------------------
3637ec681f3Smrg *
3647ec681f3Smrg * CheckPredicate --
3657ec681f3Smrg *
3667ec681f3Smrg *    Check predicate value and whether to draw or not.
3677ec681f3Smrg *
3687ec681f3Smrg * ----------------------------------------------------------------------
3697ec681f3Smrg */
3707ec681f3Smrg
3717ec681f3SmrgBOOL
3727ec681f3SmrgCheckPredicate(Device *pDevice)
3737ec681f3Smrg{
3747ec681f3Smrg   Query *pQuery = pDevice->pPredicate;
3757ec681f3Smrg   if (!pQuery) {
3767ec681f3Smrg      return TRUE;
3777ec681f3Smrg   }
3787ec681f3Smrg
3797ec681f3Smrg   assert(pQuery->Type == D3D10DDI_QUERY_OCCLUSIONPREDICATE ||
3807ec681f3Smrg          pQuery->Type == D3D10DDI_QUERY_STREAMOVERFLOWPREDICATE);
3817ec681f3Smrg
3827ec681f3Smrg   struct pipe_context *pipe = pDevice->pipe;
3837ec681f3Smrg   struct pipe_query *query = pQuery->handle;
3847ec681f3Smrg   assert(query);
3857ec681f3Smrg
3867ec681f3Smrg   union pipe_query_result result;
3877ec681f3Smrg   memset(&result, 0, sizeof result);
3887ec681f3Smrg
3897ec681f3Smrg   boolean ret;
3907ec681f3Smrg   ret = pipe->get_query_result(pipe, query, TRUE, &result);
3917ec681f3Smrg   assert(ret == TRUE);
3927ec681f3Smrg   if (!ret) {
3937ec681f3Smrg      return TRUE;
3947ec681f3Smrg   }
3957ec681f3Smrg
3967ec681f3Smrg   if (!!result.b == !!pDevice->PredicateValue) {
3977ec681f3Smrg      return FALSE;
3987ec681f3Smrg   }
3997ec681f3Smrg
4007ec681f3Smrg   return TRUE;
4017ec681f3Smrg}
4027ec681f3Smrg
4037ec681f3Smrg
4047ec681f3Smrg/*
4057ec681f3Smrg * ----------------------------------------------------------------------
4067ec681f3Smrg *
4077ec681f3Smrg * CheckCounterInfo --
4087ec681f3Smrg *
4097ec681f3Smrg *    The CheckCounterInfo function determines global information that
4107ec681f3Smrg *    is related to manipulating counters.
4117ec681f3Smrg *
4127ec681f3Smrg * ----------------------------------------------------------------------
4137ec681f3Smrg */
4147ec681f3Smrg
4157ec681f3Smrgvoid APIENTRY
4167ec681f3SmrgCheckCounterInfo(D3D10DDI_HDEVICE hDevice,                  // IN
4177ec681f3Smrg                 __out D3D10DDI_COUNTER_INFO *pCounterInfo) // OUT
4187ec681f3Smrg{
4197ec681f3Smrg   //LOG_ENTRYPOINT();
4207ec681f3Smrg
4217ec681f3Smrg   pCounterInfo->LastDeviceDependentCounter = (D3D10DDI_QUERY)0;
4227ec681f3Smrg   pCounterInfo->NumSimultaneousCounters = 0;
4237ec681f3Smrg   pCounterInfo->NumDetectableParallelUnits = 0;
4247ec681f3Smrg}
4257ec681f3Smrg
4267ec681f3Smrg
4277ec681f3Smrg/*
4287ec681f3Smrg * ----------------------------------------------------------------------
4297ec681f3Smrg *
4307ec681f3Smrg * CheckCounter --
4317ec681f3Smrg *
4327ec681f3Smrg *    The CheckCounter function retrieves information that
4337ec681f3Smrg *    describes a counter.
4347ec681f3Smrg *
4357ec681f3Smrg * ----------------------------------------------------------------------
4367ec681f3Smrg */
4377ec681f3Smrg
4387ec681f3Smrgvoid APIENTRY
4397ec681f3SmrgCheckCounter(
4407ec681f3Smrg   D3D10DDI_HDEVICE hDevice,                                                                // IN
4417ec681f3Smrg   D3D10DDI_QUERY Query,                                                                    // IN
4427ec681f3Smrg   __out D3D10DDI_COUNTER_TYPE *pCounterType,                                               // OUT
4437ec681f3Smrg   __out UINT *pActiveCounters,                                                             // OUT
4447ec681f3Smrg   __out_ecount_part_z_opt (*pNameLength, *pNameLength) LPSTR pName,                        // OUT
4457ec681f3Smrg   __inout_opt UINT *pNameLength,                                                           // OUT
4467ec681f3Smrg   __out_ecount_part_z_opt (*pUnitsLength, *pUnitsLength) LPSTR pUnits,                     // OUT
4477ec681f3Smrg   __inout_opt UINT *pUnitsLength,                                                          // OUT
4487ec681f3Smrg   __out_ecount_part_z_opt (*pDescriptionLength, *pDescriptionLength) LPSTR pDescription,   // OUT
4497ec681f3Smrg   __inout_opt UINT* pDescriptionLength)                                                    // OUT
4507ec681f3Smrg{
4517ec681f3Smrg   LOG_ENTRYPOINT();
4527ec681f3Smrg
4537ec681f3Smrg   SetError(hDevice, DXGI_DDI_ERR_UNSUPPORTED);
4547ec681f3Smrg}
455