summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-02-23 18:30:27 +0000
committerJosé Fonseca <[email protected]>2011-03-09 13:34:21 +0000
commit830827229141c08411c521f81283d1ad62f37163 (patch)
treee0c8edfd9febb8ea0ab568bc53a0ac0def957eb6 /src/gallium/drivers/svga
parentd5249b7d89a12490335750eda01309e36c7d80cb (diff)
svga: Add a new winsys entry point to query the hw version.
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_screen.c6
-rw-r--r--src/gallium/drivers/svga/svga_screen.h2
-rw-r--r--src/gallium/drivers/svga/svga_winsys.h3
3 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index f4029c7e363..0dee8b1bec1 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -499,6 +499,12 @@ svga_screen_create(struct svga_winsys_screen *sws)
svga_init_screen_resource_functions(svgascreen);
+ if (sws->get_hw_version) {
+ svgascreen->hw_version = sws->get_hw_version(sws);
+ } else {
+ svgascreen->hw_version = SVGA3D_HWVERSION_WS65_B1;
+ }
+
svgascreen->use_ps30 =
sws->get_cap(sws, SVGA3D_DEVCAP_FRAGMENT_SHADER_VERSION, &result) &&
result.u >= SVGA3DPSVERSION_30 ? TRUE : FALSE;
diff --git a/src/gallium/drivers/svga/svga_screen.h b/src/gallium/drivers/svga/svga_screen.h
index 86ec89d88c1..7ef627f928d 100644
--- a/src/gallium/drivers/svga/svga_screen.h
+++ b/src/gallium/drivers/svga/svga_screen.h
@@ -49,6 +49,8 @@ struct svga_screen
struct pipe_screen screen;
struct svga_winsys_screen *sws;
+ SVGA3dHardwareVersion hw_version;
+
unsigned use_ps30;
unsigned use_vs30;
diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h
index 5e4bdeff2ee..269659ed4c4 100644
--- a/src/gallium/drivers/svga/svga_winsys.h
+++ b/src/gallium/drivers/svga/svga_winsys.h
@@ -136,6 +136,9 @@ struct svga_winsys_screen
void
(*destroy)(struct svga_winsys_screen *sws);
+ SVGA3dHardwareVersion
+ (*get_hw_version)(struct svga_winsys_screen *sws);
+
boolean
(*get_cap)(struct svga_winsys_screen *sws,
SVGA3dDevCapIndex index,