Mesa (master): d3d1x: make use of new query types

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Thu Oct 20 09:16:37 PDT 2011


Module: Mesa
Branch: master
Commit: 55c5ad8dfa68c18589f19fba2d1bfecd425785c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=55c5ad8dfa68c18589f19fba2d1bfecd425785c9

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Sat Oct 15 16:44:04 2011 +0200

d3d1x: make use of new query types

---

 .../state_trackers/d3d1x/gd3d11/d3d11_screen.h     |    9 ++++---
 .../state_trackers/d3d1x/gd3d1x/d3d_enums.cpp      |   26 ++++++++++----------
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
index 03a740f..f16492f 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
+++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h
@@ -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;
diff --git a/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp b/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp
index 853d114..b8b3676 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp
+++ b/src/gallium/state_trackers/d3d1x/gd3d1x/d3d_enums.cpp
@@ -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,



More information about the mesa-commit mailing list