Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
739d565c
Commit
739d565c
authored
Jul 17, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jul 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a setting for the render target locking method.
parent
f8ca32b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
4 deletions
+83
-4
surface.c
dlls/wined3d/surface.c
+44
-2
wined3d_main.c
dlls/wined3d/wined3d_main.c
+31
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+8
-0
No files found.
dlls/wined3d/surface.c
View file @
739d565c
...
...
@@ -727,7 +727,28 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
* (char *)pLockedRect->pBits + (pLockedRect->Pitch * (j-This->lockedRect.top)));
*****************************************/
if
(
!
notInContext
)
{
/* Only read the buffer if it's in the current context */
read_from_framebuffer
(
This
,
&
This
->
lockedRect
,
pLockedRect
->
pBits
,
pLockedRect
->
Pitch
);
switch
(
wined3d_settings
.
rendertargetlock_mode
)
{
case
RTL_AUTO
:
case
RTL_READDRAW
:
case
RTL_READTEX
:
read_from_framebuffer
(
This
,
&
This
->
lockedRect
,
pLockedRect
->
pBits
,
pLockedRect
->
Pitch
);
break
;
case
RTL_TEXDRAW
:
case
RTL_TEXTEX
:
ERR
(
"Reading from render target with a texture isn't implemented yet
\n
"
);
break
;
case
RTL_DISABLE
:
{
static
BOOL
warned
=
FALSE
;
if
(
!
warned
)
{
ERR
(
"Application tries to lock the render target, but render target locking is disabled
\n
"
);
warned
=
TRUE
;
}
}
break
;
}
}
TRACE
(
"Resetting buffer
\n
"
);
...
...
@@ -1071,7 +1092,28 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
glDisable
(
GL_BLEND
);
glDisable
(
GL_DEPTH_TEST
);
flush_to_framebuffer_drawpixels
(
This
);
switch
(
wined3d_settings
.
rendertargetlock_mode
)
{
case
RTL_AUTO
:
case
RTL_READDRAW
:
case
RTL_TEXDRAW
:
flush_to_framebuffer_drawpixels
(
This
);
break
;
case
RTL_READTEX
:
case
RTL_TEXTEX
:
ERR
(
"Writing to the render target with textures is not implemented yet
\n
"
);
break
;
case
RTL_DISABLE
:
{
static
BOOL
warned
=
FALSE
;
if
(
!
warned
)
{
ERR
(
"The application tries to write to the render target, but render target locking is disabled
\n
"
);
warned
=
TRUE
;
}
}
break
;
}
if
(
implSwapChain
->
backBuffer
&&
implSwapChain
->
backBuffer
[
0
])
{
glDrawBuffer
(
GL_BACK
);
...
...
dlls/wined3d/wined3d_main.c
View file @
739d565c
...
...
@@ -36,8 +36,9 @@ wined3d_settings_t wined3d_settings =
{
VS_HW
,
/* Hardware by default */
PS_NONE
,
/* Disabled by default */
VBO_HW
,
/* Hardware by default */
FALSE
/* Use of GLSL disabled by default */
VBO_HW
,
/* Hardware by default */
FALSE
,
/* Use of GLSL disabled by default */
RTL_AUTO
/* Automatically determine best locking method */
};
WineD3DGlobalStatistics
*
wineD3DGlobalStatistics
=
NULL
;
...
...
@@ -196,6 +197,34 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
}
/* There will be a couple of other choices for nonpow2, they are: TextureRecrangle and OpenGL 2 */
}
if
(
!
get_config_key
(
hkey
,
appkey
,
"RenderTargetLockMode"
,
buffer
,
size
)
)
{
if
(
!
strcmp
(
buffer
,
"disabled"
))
{
TRACE
(
"Disabling render target locking
\n
"
);
wined3d_settings
.
rendertargetlock_mode
=
RTL_DISABLE
;
}
else
if
(
!
strcmp
(
buffer
,
"readdraw"
))
{
TRACE
(
"Using glReadPixels for render target reading and glDrawPixels for writing
\n
"
);
wined3d_settings
.
rendertargetlock_mode
=
RTL_READDRAW
;
}
else
if
(
!
strcmp
(
buffer
,
"readtex"
))
{
TRACE
(
"Using glReadPixels for render target reading and textures for writing
\n
"
);
wined3d_settings
.
rendertargetlock_mode
=
RTL_READTEX
;
}
else
if
(
!
strcmp
(
buffer
,
"texdraw"
))
{
TRACE
(
"Using textures for render target reading and glDrawPixels for writing
\n
"
);
wined3d_settings
.
rendertargetlock_mode
=
RTL_TEXDRAW
;
}
else
if
(
!
strcmp
(
buffer
,
"textex"
))
{
TRACE
(
"Reading render targets via textures and writing via textures
\n
"
);
wined3d_settings
.
rendertargetlock_mode
=
RTL_TEXTEX
;
}
}
}
if
(
wined3d_settings
.
vs_mode
==
VS_HW
)
TRACE
(
"Allow HW vertex shaders
\n
"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
739d565c
...
...
@@ -138,6 +138,13 @@ static WINED3DGLTYPE const glTypeLookup[D3DDECLTYPE_UNUSED] = {
#define SHADER_GLSL 2
#define SHADER_NONE 3
#define RTL_DISABLE -1
#define RTL_AUTO 0
#define RTL_READDRAW 1
#define RTL_READTEX 2
#define RTL_TEXDRAW 3
#define RTL_TEXTEX 4
typedef
struct
wined3d_settings_s
{
/* vertex and pixel shader modes */
int
vs_mode
;
...
...
@@ -151,6 +158,7 @@ typedef struct wined3d_settings_s {
int
ps_selected_mode
;
/* nonpower 2 function */
int
nonpower2_mode
;
int
rendertargetlock_mode
;
}
wined3d_settings_t
;
extern
wined3d_settings_t
wined3d_settings
;
...
...
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