Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2c3adec5
Commit
2c3adec5
authored
Jun 04, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 05, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Render target locking fixes.
parent
473ad39d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
10 deletions
+29
-10
drawprim.c
dlls/wined3d/drawprim.c
+11
-1
surface.c
dlls/wined3d/surface.c
+15
-9
swapchain.c
dlls/wined3d/swapchain.c
+3
-0
No files found.
dlls/wined3d/drawprim.c
View file @
2c3adec5
...
@@ -2069,7 +2069,8 @@ void drawPrimitive(IWineD3DDevice *iface,
...
@@ -2069,7 +2069,8 @@ void drawPrimitive(IWineD3DDevice *iface,
BOOL
usePixelShaderFunction
=
FALSE
;
BOOL
usePixelShaderFunction
=
FALSE
;
BOOL
isLightingOn
=
FALSE
;
BOOL
isLightingOn
=
FALSE
;
WineDirect3DVertexStridedData
*
dataLocations
;
WineDirect3DVertexStridedData
*
dataLocations
;
int
useHW
=
FALSE
;
IWineD3DSwapChainImpl
*
swapchain
;
int
useHW
=
FALSE
,
i
;
if
(
This
->
stateBlock
->
vertexShader
!=
NULL
&&
wined3d_settings
.
vs_mode
!=
VS_NONE
if
(
This
->
stateBlock
->
vertexShader
!=
NULL
&&
wined3d_settings
.
vs_mode
!=
VS_NONE
&&
((
IWineD3DVertexShaderImpl
*
)
This
->
stateBlock
->
vertexShader
)
->
baseShader
.
function
!=
NULL
&&
((
IWineD3DVertexShaderImpl
*
)
This
->
stateBlock
->
vertexShader
)
->
baseShader
.
function
!=
NULL
...
@@ -2093,6 +2094,15 @@ void drawPrimitive(IWineD3DDevice *iface,
...
@@ -2093,6 +2094,15 @@ void drawPrimitive(IWineD3DDevice *iface,
TRACE
(
"(%p) : using vertex declaration %p
\n
"
,
iface
,
This
->
stateBlock
->
vertexDecl
);
TRACE
(
"(%p) : using vertex declaration %p
\n
"
,
iface
,
This
->
stateBlock
->
vertexDecl
);
}
}
/* Invalidate the back buffer memory so LockRect will read it the next time */
for
(
i
=
0
;
i
<
IWineD3DDevice_GetNumberOfSwapChains
(
iface
);
i
++
)
{
IWineD3DDevice_GetSwapChain
(
iface
,
i
,
(
IWineD3DSwapChain
**
)
&
swapchain
);
if
(
swapchain
)
{
if
(
swapchain
->
backBuffer
)
((
IWineD3DSurfaceImpl
*
)
swapchain
->
backBuffer
)
->
Flags
|=
SFLAG_GLDIRTY
;
IWineD3DSwapChain_Release
(
(
IWineD3DSwapChain
*
)
swapchain
);
}
}
/* Ok, we will be updating the screen from here onwards so grab the lock */
/* Ok, we will be updating the screen from here onwards so grab the lock */
ENTER_GL
();
ENTER_GL
();
...
...
dlls/wined3d/surface.c
View file @
2c3adec5
...
@@ -480,8 +480,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
...
@@ -480,8 +480,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
}
}
}
}
}
else
if
(
WINED3DUSAGE_RENDERTARGET
&
This
->
resource
.
usage
&&
!
(
Flags
&
WINED3DLOCK_DISCARD
))
{
/* render surfaces */
}
else
if
(
WINED3DUSAGE_RENDERTARGET
&
This
->
resource
.
usage
)
{
/* render surfaces */
if
((
!
(
Flags
&
WINED3DLOCK_DISCARD
)
&&
(
This
->
Flags
&
SFLAG_GLDIRTY
))
||
!
This
->
resource
.
allocatedMemory
)
{
GLint
prev_store
;
GLint
prev_store
;
GLint
prev_read
;
GLint
prev_read
;
BOOL
notInContext
=
FALSE
;
BOOL
notInContext
=
FALSE
;
...
@@ -559,7 +559,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
...
@@ -559,7 +559,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
if
(
swapchain
!=
NULL
)
IWineD3DSwapChain_Release
((
IWineD3DSwapChain
*
)
swapchain
);
if
(
swapchain
!=
NULL
)
IWineD3DSwapChain_Release
((
IWineD3DSwapChain
*
)
swapchain
);
if
(
targetSwapChain
!=
NULL
)
IWineD3DSwapChain_Release
((
IWineD3DSwapChain
*
)
targetSwapChain
);
if
(
targetSwapChain
!=
NULL
)
IWineD3DSwapChain_Release
((
IWineD3DSwapChain
*
)
targetSwapChain
);
/** the depth stencil in openGL has a format of GL_FLOAT
/** the depth stencil in openGL has a format of GL_FLOAT
* which should be good for WINED3DFMT_D16_LOCKABLE
* which should be good for WINED3DFMT_D16_LOCKABLE
* and WINED3DFMT_D16
* and WINED3DFMT_D16
...
@@ -577,6 +576,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
...
@@ -577,6 +576,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
*****************************************/
*****************************************/
if
(
!
notInContext
)
{
/* Only read the buffer if it's in the current context */
if
(
!
notInContext
)
{
/* Only read the buffer if it's in the current context */
long
j
;
long
j
;
#if 0
#if 0
/* Bizarly it takes 120 millseconds to get an 800x600 region a line at a time, but only 10 to get the whole lot every time,
/* Bizarly it takes 120 millseconds to get an 800x600 region a line at a time, but only 10 to get the whole lot every time,
* This is on an ATI9600, and may be format dependent, anyhow this hack makes this demo dx9_2d_demo_game
* This is on an ATI9600, and may be format dependent, anyhow this hack makes this demo dx9_2d_demo_game
...
@@ -616,6 +616,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
...
@@ -616,6 +616,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
}
}
HeapFree
(
GetProcessHeap
(),
0
,
row
);
HeapFree
(
GetProcessHeap
(),
0
,
row
);
This
->
Flags
&=
~
SFLAG_GLDIRTY
;
}
else
if
(
This
->
lockedRect
.
left
==
0
&&
This
->
lockedRect
.
right
==
This
->
currentDesc
.
Width
)
{
}
else
if
(
This
->
lockedRect
.
left
==
0
&&
This
->
lockedRect
.
right
==
This
->
currentDesc
.
Width
)
{
glReadPixels
(
0
,
glReadPixels
(
0
,
This
->
lockedRect
.
top
,
This
->
lockedRect
.
top
,
...
@@ -637,13 +639,14 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
...
@@ -637,13 +639,14 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKE
}
}
}
}
vcheckGLcall
(
"glReadPixels"
);
vcheckGLcall
(
"glReadPixels"
);
TRACE
(
"Resetting buffer
\n
"
);
TRACE
(
"Resetting buffer
\n
"
);
glReadBuffer
(
prev_read
);
glReadBuffer
(
prev_read
);
vcheckGLcall
(
"glReadBuffer"
);
vcheckGLcall
(
"glReadBuffer"
);
}
}
LEAVE_GL
();
LEAVE_GL
();
}
}
else
if
(
WINED3DUSAGE_DEPTHSTENCIL
&
This
->
resource
.
usage
)
{
/* stencil surfaces */
}
else
if
(
WINED3DUSAGE_DEPTHSTENCIL
&
This
->
resource
.
usage
)
{
/* stencil surfaces */
if
(
!
messages
&
1
)
{
if
(
!
messages
&
1
)
{
...
@@ -784,14 +787,14 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
...
@@ -784,14 +787,14 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
per drawprim (and leave set - it will sort itself out due to last_was_rhw */
per drawprim (and leave set - it will sort itself out due to last_was_rhw */
d3ddevice_set_ortho
(
This
->
resource
.
wineD3DDevice
);
d3ddevice_set_ortho
(
This
->
resource
.
wineD3DDevice
);
if
(
iface
==
implSwapChain
->
backBuffer
||
iface
==
myDevice
->
renderTarget
)
{
if
(
iface
==
implSwapChain
->
frontBuffer
)
{
glDrawBuffer
(
GL_BACK
);
}
else
if
(
iface
==
implSwapChain
->
frontBuffer
)
{
glDrawBuffer
(
GL_FRONT
);
glDrawBuffer
(
GL_FRONT
);
checkGLcall
(
"glDrawBuffer GL_FRONT"
);
}
else
if
(
iface
==
implSwapChain
->
backBuffer
||
iface
==
myDevice
->
renderTarget
)
{
glDrawBuffer
(
GL_BACK
);
checkGLcall
(
"glDrawBuffer GL_BACK"
);
}
}
vcheckGLcall
(
"glDrawBuffer"
);
/* If not fullscreen, we need to skip a number of bytes to find the next row of data */
/* If not fullscreen, we need to skip a number of bytes to find the next row of data */
glGetIntegerv
(
GL_UNPACK_ROW_LENGTH
,
&
skipBytes
);
glGetIntegerv
(
GL_UNPACK_ROW_LENGTH
,
&
skipBytes
);
glPixelStorei
(
GL_UNPACK_ROW_LENGTH
,
This
->
currentDesc
.
Width
);
glPixelStorei
(
GL_UNPACK_ROW_LENGTH
,
This
->
currentDesc
.
Width
);
...
@@ -2244,6 +2247,9 @@ HRESULT WINAPI IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
...
@@ -2244,6 +2247,9 @@ HRESULT WINAPI IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
LEAVE_GL
();
LEAVE_GL
();
/* TODO: If the surface is locked often, perform the Blt in software on the memory instead */
This
->
Flags
|=
SFLAG_GLDIRTY
;
return
WINED3D_OK
;
return
WINED3D_OK
;
}
}
...
...
dlls/wined3d/swapchain.c
View file @
2c3adec5
...
@@ -329,6 +329,9 @@ HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CONST REC
...
@@ -329,6 +329,9 @@ HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CONST REC
IWineD3DDevice_Clear
((
IWineD3DDevice
*
)
This
->
wineD3DDevice
,
0
,
NULL
,
D3DCLEAR_STENCIL
|
D3DCLEAR_ZBUFFER
,
0x00
,
1
.
0
,
0
);
IWineD3DDevice_Clear
((
IWineD3DDevice
*
)
This
->
wineD3DDevice
,
0
,
NULL
,
D3DCLEAR_STENCIL
|
D3DCLEAR_ZBUFFER
,
0x00
,
1
.
0
,
0
);
}
}
((
IWineD3DSurfaceImpl
*
)
This
->
frontBuffer
)
->
Flags
|=
SFLAG_GLDIRTY
;
((
IWineD3DSurfaceImpl
*
)
This
->
backBuffer
)
->
Flags
|=
SFLAG_GLDIRTY
;
TRACE
(
"returning
\n
"
);
TRACE
(
"returning
\n
"
);
return
WINED3D_OK
;
return
WINED3D_OK
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment