summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
diff options
context:
space:
mode:
authorDavid Heidelberg <[email protected]>2014-11-25 00:38:07 +0100
committerEmil Velikov <[email protected]>2014-11-26 20:09:11 +0000
commita99f31bced1ac5dfea9942bb37301a21c9a73189 (patch)
tree0ca1c39f498c048e4f5e92365807cadd0a2f340f /src/gallium/state_trackers/nine/device9.c
parent4eea2496bcb573d730f84f34fb76db3e1ec2e733 (diff)
st/nine: return GetAvailableTextureMem in bytes as expected (v2)
PIPE_CAP_VIDEO_MEMORY returns the amount of video memory in megabytes, so need to converted it to bytes. Fixed Warframe memory detection. v2: also prepare for cards with more than 4GB memory Cc: "10.4" <[email protected]> Tested-by: Yaroslav Andrusyak <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Axel Davy <[email protected]> Signed-off-by: David Heidelberg <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r--src/gallium/state_trackers/nine/device9.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index 66d5e667f8e..d48f47d5bd4 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -423,7 +423,11 @@ NineDevice9_TestCooperativeLevel( struct NineDevice9 *This )
UINT WINAPI
NineDevice9_GetAvailableTextureMem( struct NineDevice9 *This )
{
- return This->screen->get_param(This->screen, PIPE_CAP_VIDEO_MEMORY);
+ const unsigned mem = This->screen->get_param(This->screen, PIPE_CAP_VIDEO_MEMORY);
+ if (mem < 4096)
+ return mem << 20;
+ else
+ return UINT_MAX;
}
HRESULT WINAPI