Module: wine
Branch: master
Commit: fc064cb04b2d3bccac27cd6b8a8b90e967d6b69a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fc064cb04b2d3bccac27cd6b8…
Author: Alexander Dorofeyev <alexd4(a)inbox.lv>
Date: Sun Mar 9 16:09:52 2008 +0200
wined3d: Use primary_render_target_is_p8 in read_from_framebuffer.
---
dlls/wined3d/surface.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 1b7439a..413d3af 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -690,7 +690,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
{
case WINED3DFMT_P8:
{
- if(This->resource.usage & WINED3DUSAGE_RENDERTARGET) {
+ if(primary_render_target_is_p8(myDevice)) {
/* In case of P8 render targets the index is stored in the alpha component */
fmt = GL_ALPHA;
type = GL_UNSIGNED_BYTE;
@@ -792,9 +792,9 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v
/* For P8 textures we need to perform an inverse palette lookup. This is done by searching for a palette
* index which matches the RGB value. Note this isn't guaranteed to work when there are multiple entries for
* the same color but we have no choice.
- * In case of render targets, the index is stored in the alpha component so no conversion is needed.
+ * In case of P8 render targets, the index is stored in the alpha component so no conversion is needed.
*/
- if((This->resource.format == WINED3DFMT_P8) && !(This->resource.usage & WINED3DUSAGE_RENDERTARGET)) {
+ if((This->resource.format == WINED3DFMT_P8) && !primary_render_target_is_p8(myDevice)) {
PALETTEENTRY *pal;
DWORD width = pitch / 3;
int x, y, c;
Module: wine
Branch: master
Commit: 8f8076c3f7203451d030567f3421ac5e2fded77f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8f8076c3f7203451d030567f3…
Author: Alexander Dorofeyev <alexd4(a)inbox.lv>
Date: Sun Mar 9 16:08:57 2008 +0200
wined3d: Get rid of spurious err when locking with WINED3DLOCK_DISCARD.
---
dlls/wined3d/surface.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index fdc16cd..1b7439a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -986,7 +986,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
if (Flags & WINED3DLOCK_DISCARD) {
/* Set SFLAG_INSYSMEM, so we'll never try to download the data from the texture. */
TRACE("WINED3DLOCK_DISCARD flag passed, marking local copy as up to date\n");
+ surface_prepare_system_memory(This); /* Makes sure memory is allocated */
This->Flags |= SFLAG_INSYSMEM;
+ goto lock_end;
}
if (This->Flags & SFLAG_INSYSMEM) {