[MPlayer-dev-eng] [PATCH] - No Reset of D3D device on resize

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Fri Dec 12 10:13:07 CET 2008


On Fri, Dec 12, 2008 at 08:23:32AM +0000, Jim Hauxwell wrote:
> I take the point on the memory.  The memory is in the GPU or already set
> aside for GPU activities in a UMA. so its not wasted.  If your max
> surface dimension is 2k x 2k then in 32bit, this is 16MB.  Only a really
> really low end system would have about this much graphics memory set aside.

Well, I guess it is still work-in-progress, but there could be cards
where there actually is no maximum surface dimension except as limited
by the available card memory.
Actually except for driver "issues" any DirectX10 card should fall in
that category.

> Even if you don't allocate the memory at the start, the user could load
> a video that required that much space and then, crash! They are left
> scratching their heads as to why it bombed out on them.

Hm, I think we never access the backbuffer directly, so crashes should
not be possible just due to wrong backbuffer size.
But actually I would suggest the normal way of handling dynamic size
arrays:
Allocate only the size necessary first and double the size each time you hit
the limit.
This would make resizing "stutter" once at certain points, but I doubt it
would be a huge issue.
You could also reduce the amount of memory consumed again, e.g. if we
have allocated 4 times the size we actually need, but this is low
priority, and simpler code might be preferable to it.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list