Commit 36b21e33 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Remove some unused query code.

parent a2624ae8
......@@ -101,168 +101,6 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetParent(IWineD3DQuery *iface, IUnknown
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
HRESULT res = S_OK;
TRACE("(%p) : type %#x, pData %p, dwSize %#x, dwGetDataFlags %#x\n", This, This->type, pData, dwSize, dwGetDataFlags);
switch (This->type){
case WINED3DQUERYTYPE_VCACHE:
{
WINED3DDEVINFO_VCACHE *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_VCACHE\n", This);
if(pData == NULL || dwSize == 0) break;
data->Pattern = WINEMAKEFOURCC('C','A','C','H');
data->OptMethod = 0; /*0 get longest strips, 1 optimize vertex cache*/
data->CacheSize = 0; /*cache size, only required if OptMethod == 1*/
data->MagicNumber = 0; /*only required if OptMethod == 1 (used internally)*/
}
break;
case WINED3DQUERYTYPE_RESOURCEMANAGER:
{
WINED3DDEVINFO_RESOURCEMANAGER *data = pData;
int i;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_RESOURCEMANAGER\n", This);
if(pData == NULL || dwSize == 0) break;
for(i = 0; i < WINED3DRTYPECOUNT; i++){
/*I'm setting the default values to 1 so as to reduce the risk of a div/0 in the caller*/
/* isTextureResident could be used to get some of this information */
data->stats[i].bThrashing = FALSE;
data->stats[i].ApproxBytesDownloaded = 1;
data->stats[i].NumEvicts = 1;
data->stats[i].NumVidCreates = 1;
data->stats[i].LastPri = 1;
data->stats[i].NumUsed = 1;
data->stats[i].NumUsedInVidMem = 1;
data->stats[i].WorkingSet = 1;
data->stats[i].WorkingSetBytes = 1;
data->stats[i].TotalManaged = 1;
data->stats[i].TotalBytes = 1;
}
}
break;
case WINED3DQUERYTYPE_VERTEXSTATS:
{
WINED3DDEVINFO_VERTEXSTATS *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_VERTEXSTATS\n", This);
if(pData == NULL || dwSize == 0) break;
data->NumRenderedTriangles = 1;
data->NumExtraClippingTriangles = 1;
}
break;
case WINED3DQUERYTYPE_TIMESTAMP:
{
UINT64* data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_TIMESTAMP\n", This);
if(pData == NULL || dwSize == 0) break;
*data = 1; /*Don't know what this is supposed to be*/
}
break;
case WINED3DQUERYTYPE_TIMESTAMPDISJOINT:
{
BOOL* data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_TIMESTAMPDISJOINT\n", This);
if(pData == NULL || dwSize == 0) break;
*data = FALSE; /*Don't know what this is supposed to be*/
}
break;
case WINED3DQUERYTYPE_TIMESTAMPFREQ:
{
UINT64* data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_TIMESTAMPFREQ\n", This);
if(pData == NULL || dwSize == 0) break;
*data = 1; /*Don't know what this is supposed to be*/
}
break;
case WINED3DQUERYTYPE_PIPELINETIMINGS:
{
WINED3DDEVINFO_PIPELINETIMINGS *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_PIPELINETIMINGS\n", This);
if(pData == NULL || dwSize == 0) break;
data->VertexProcessingTimePercent = 1.0f;
data->PixelProcessingTimePercent = 1.0f;
data->OtherGPUProcessingTimePercent = 97.0f;
data->GPUIdleTimePercent = 1.0f;
}
break;
case WINED3DQUERYTYPE_INTERFACETIMINGS:
{
WINED3DDEVINFO_INTERFACETIMINGS *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_INTERFACETIMINGS\n", This);
if(pData == NULL || dwSize == 0) break;
data->WaitingForGPUToUseApplicationResourceTimePercent = 1.0f;
data->WaitingForGPUToAcceptMoreCommandsTimePercent = 1.0f;
data->WaitingForGPUToStayWithinLatencyTimePercent = 1.0f;
data->WaitingForGPUExclusiveResourceTimePercent = 1.0f;
data->WaitingForGPUOtherTimePercent = 96.0f;
}
break;
case WINED3DQUERYTYPE_VERTEXTIMINGS:
{
WINED3DDEVINFO_STAGETIMINGS *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_VERTEXTIMINGS\n", This);
if(pData == NULL || dwSize == 0) break;
data->MemoryProcessingPercent = 50.0f;
data->ComputationProcessingPercent = 50.0f;
}
break;
case WINED3DQUERYTYPE_PIXELTIMINGS:
{
WINED3DDEVINFO_STAGETIMINGS *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_PIXELTIMINGS\n", This);
if(pData == NULL || dwSize == 0) break;
data->MemoryProcessingPercent = 50.0f;
data->ComputationProcessingPercent = 50.0f;
}
break;
case WINED3DQUERYTYPE_BANDWIDTHTIMINGS:
{
WINED3DDEVINFO_BANDWIDTHTIMINGS *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_BANDWIDTHTIMINGS\n", This);
if(pData == NULL || dwSize == 0) break;
data->MaxBandwidthUtilized = 1.0f;
data->FrontEndUploadMemoryUtilizedPercent = 1.0f;
data->VertexRateUtilizedPercent = 1.0f;
data->TriangleSetupRateUtilizedPercent = 1.0f;
data->FillRateUtilizedPercent = 97.0f;
}
break;
case WINED3DQUERYTYPE_CACHEUTILIZATION:
{
WINED3DDEVINFO_CACHEUTILIZATION *data = pData;
FIXME("(%p): Unimplemented query WINED3DQUERYTYPE_CACHEUTILIZATION\n", This);
if(pData == NULL || dwSize == 0) break;
data->TextureCacheHitRate = 1.0f;
data->PostTransformVertexCacheHitRate = 1.0f;
}
break;
default:
FIXME("(%p) Unhandled query type %d\n",This , This->type);
};
/*dwGetDataFlags = 0 || D3DGETDATA_FLUSH
D3DGETDATA_FLUSH may return WINED3DERR_DEVICELOST if the device is lost
*/
return res; /* S_OK if the query data is available*/
}
static HRESULT WINAPI IWineD3DOcclusionQueryImpl_GetData(IWineD3DQuery* iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags) {
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *) iface;
struct wined3d_occlusion_query *query = This->extendedData;
......@@ -392,57 +230,6 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_GetData(IWineD3DQuery* iface, void
return S_OK;
}
static DWORD WINAPI IWineD3DQueryImpl_GetDataSize(IWineD3DQuery* iface){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
int dataSize = 0;
TRACE("(%p) : type %#x\n", This, This->type);
switch(This->type){
case WINED3DQUERYTYPE_VCACHE:
dataSize = sizeof(WINED3DDEVINFO_VCACHE);
break;
case WINED3DQUERYTYPE_RESOURCEMANAGER:
dataSize = sizeof(WINED3DDEVINFO_RESOURCEMANAGER);
break;
case WINED3DQUERYTYPE_VERTEXSTATS:
dataSize = sizeof(WINED3DDEVINFO_VERTEXSTATS);
break;
case WINED3DQUERYTYPE_EVENT:
dataSize = sizeof(BOOL);
break;
case WINED3DQUERYTYPE_TIMESTAMP:
dataSize = sizeof(UINT64);
break;
case WINED3DQUERYTYPE_TIMESTAMPDISJOINT:
dataSize = sizeof(BOOL);
break;
case WINED3DQUERYTYPE_TIMESTAMPFREQ:
dataSize = sizeof(UINT64);
break;
case WINED3DQUERYTYPE_PIPELINETIMINGS:
dataSize = sizeof(WINED3DDEVINFO_PIPELINETIMINGS);
break;
case WINED3DQUERYTYPE_INTERFACETIMINGS:
dataSize = sizeof(WINED3DDEVINFO_INTERFACETIMINGS);
break;
case WINED3DQUERYTYPE_VERTEXTIMINGS:
dataSize = sizeof(WINED3DDEVINFO_STAGETIMINGS);
break;
case WINED3DQUERYTYPE_PIXELTIMINGS:
dataSize = sizeof(WINED3DDEVINFO_STAGETIMINGS);
break;
case WINED3DQUERYTYPE_BANDWIDTHTIMINGS:
dataSize = sizeof(WINED3DQUERYTYPE_BANDWIDTHTIMINGS);
break;
case WINED3DQUERYTYPE_CACHEUTILIZATION:
dataSize = sizeof(WINED3DDEVINFO_CACHEUTILIZATION);
break;
default:
FIXME("(%p) Unhandled query type %d\n",This , This->type);
dataSize = 0;
}
return dataSize;
}
static DWORD WINAPI IWineD3DEventQueryImpl_GetDataSize(IWineD3DQuery* iface){
TRACE("(%p) : type D3DQUERY_EVENT\n", iface);
......@@ -604,42 +391,6 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */
}
static HRESULT WINAPI IWineD3DQueryImpl_Issue(IWineD3DQuery* iface, DWORD dwIssueFlags){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
TRACE("(%p) : dwIssueFlags %#x, type %#x\n", This, dwIssueFlags, This->type);
/* The fixme is printed when the app asks for the resulting data */
WARN("(%p) : Unhandled query type %#x\n", This, This->type);
if(dwIssueFlags & WINED3DISSUE_BEGIN) {
This->state = QUERY_BUILDING;
} else {
This->state = QUERY_SIGNALLED;
}
return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */
}
/**********************************************************
* IWineD3DQuery VTbl follows
**********************************************************/
static const IWineD3DQueryVtbl IWineD3DQuery_Vtbl =
{
/*** IUnknown methods ***/
IWineD3DQueryImpl_QueryInterface,
IWineD3DQueryImpl_AddRef,
IWineD3DQueryImpl_Release,
/*** IWineD3Dquery methods ***/
IWineD3DQueryImpl_GetParent,
IWineD3DQueryImpl_GetData,
IWineD3DQueryImpl_GetDataSize,
IWineD3DQueryImpl_GetType,
IWineD3DQueryImpl_Issue
};
static const IWineD3DQueryVtbl IWineD3DEventQuery_Vtbl =
{
/*** IUnknown methods ***/
......@@ -725,8 +476,6 @@ HRESULT query_init(IWineD3DQueryImpl *query, IWineD3DDeviceImpl *device,
case WINED3DQUERYTYPE_BANDWIDTHTIMINGS:
case WINED3DQUERYTYPE_CACHEUTILIZATION:
default:
/* Use the base query vtable until we have a special one for each query. */
query->lpVtbl = &IWineD3DQuery_Vtbl;
FIXME("Unhandled query type %#x.\n", type);
return WINED3DERR_NOTAVAILABLE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment