d3d1x: make use of new query types
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sat, 15 Oct 2011 14:44:04 +0000 (16:44 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 20 Oct 2011 16:03:54 +0000 (18:03 +0200)
src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp

index 03a740f02f958eac8357daef046d4884f5df968f..f16492f728c38610a3d51a2893667d8cb21fb513 100644 (file)
@@ -1327,10 +1327,10 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
                if(invalid(query_desc->Query >= D3D11_QUERY_COUNT))
                        return E_INVALIDARG;
                unsigned query_type = d3d11_to_pipe_query[query_desc->Query];
-               if(!query_type)
+               if(query_type >= PIPE_QUERY_TYPES)
                        return E_NOTIMPL;
 
-               if(out_query)
+               if(!out_query)
                        return S_FALSE;
 
                struct pipe_query* query = immediate_pipe->create_query(immediate_pipe, query_type);
@@ -1351,9 +1351,10 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen
                switch(predicate_desc->Query)
                {
                case D3D11_QUERY_SO_OVERFLOW_PREDICATE:
-                       return E_NOTIMPL;
+                       query_type = PIPE_QUERY_SO_OVERFLOW_PREDICATE;
+                       break;
                case D3D11_QUERY_OCCLUSION_PREDICATE:
-                       query_type = PIPE_QUERY_OCCLUSION_COUNTER;
+                       query_type = PIPE_QUERY_OCCLUSION_PREDICATE;
                        break;
                default:
                        return E_INVALIDARG;
index 853d11410df5cc0ba976cf1de79cf5a25856d34d..b8b367655962826b64c26cf6cda1c37c8d81675f 100644 (file)
@@ -85,21 +85,21 @@ unsigned d3d11_to_pipe_query[D3D11_QUERY_COUNT] =
 {
        PIPE_QUERY_GPU_FINISHED,
        PIPE_QUERY_OCCLUSION_COUNTER,
-       PIPE_QUERY_TIME_ELAPSED,
+       PIPE_QUERY_TIMESTAMP,
        PIPE_QUERY_TIMESTAMP_DISJOINT,
-       0, /* D3D11_QUERY_PIPELINE_STATISTICS */
-       PIPE_QUERY_OCCLUSION_COUNTER,
+       PIPE_QUERY_PIPELINE_STATISTICS,
+       PIPE_QUERY_OCCLUSION_PREDICATE,
        PIPE_QUERY_SO_STATISTICS,
-       0, /* D3D11_QUERY_SO_OVERFLOW_PREDICATE */
+       PIPE_QUERY_SO_OVERFLOW_PREDICATE,
        /* per-stream SO queries */
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
+       PIPE_QUERY_TYPES,
+       PIPE_QUERY_TYPES,
+       PIPE_QUERY_TYPES,
+       PIPE_QUERY_TYPES,
+       PIPE_QUERY_TYPES,
+       PIPE_QUERY_TYPES,
+       PIPE_QUERY_TYPES,
+       PIPE_QUERY_TYPES,
 };
 
 unsigned d3d11_query_size[D3D11_QUERY_COUNT] =
@@ -108,7 +108,7 @@ unsigned d3d11_query_size[D3D11_QUERY_COUNT] =
                sizeof(UINT64),
                sizeof(UINT64),
                sizeof(UINT64),
-               0,
+               sizeof(D3D11_QUERY_DATA_PIPELINE_STATISTICS),
                sizeof(BOOL),
                sizeof(D3D11_QUERY_DATA_SO_STATISTICS),
                0,