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
ac9c592c
Commit
ac9c592c
authored
Mar 08, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store all the resource desc information in struct wined3d_resource.
parent
63b72d78
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
91 additions
and
96 deletions
+91
-96
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+2
-2
basetexture.c
dlls/wined3d/basetexture.c
+3
-2
buffer.c
dlls/wined3d/buffer.c
+3
-2
context.c
dlls/wined3d/context.c
+2
-2
device.c
dlls/wined3d/device.c
+22
-22
glsl_shader.c
dlls/wined3d/glsl_shader.c
+2
-2
resource.c
dlls/wined3d/resource.c
+12
-5
state.c
dlls/wined3d/state.c
+4
-2
surface.c
dlls/wined3d/surface.c
+0
-0
surface_base.c
dlls/wined3d/surface_base.c
+0
-0
surface_gdi.c
dlls/wined3d/surface_gdi.c
+2
-2
swapchain.c
dlls/wined3d/swapchain.c
+8
-8
swapchain_gdi.c
dlls/wined3d/swapchain_gdi.c
+2
-2
volume.c
dlls/wined3d/volume.c
+16
-18
wined3d_private.h
dlls/wined3d/wined3d_private.h
+13
-27
No files found.
dlls/wined3d/arb_program_shader.c
View file @
ac9c592c
...
...
@@ -640,7 +640,7 @@ static void shader_arb_load_constants(const struct wined3d_context *context, cha
{
IWineD3DBaseShaderImpl
*
pshader
=
(
IWineD3DBaseShaderImpl
*
)
stateBlock
->
state
.
pixel_shader
;
const
struct
arb_ps_compiled_shader
*
gl_shader
=
priv
->
compiled_fprog
;
float
rt_height
=
device
->
render_targets
[
0
]
->
currentDesc
.
H
eight
;
float
rt_height
=
device
->
render_targets
[
0
]
->
resource
.
h
eight
;
/* Load DirectX 9 float constants for pixel shader */
device
->
highest_dirty_ps_const
=
shader_arb_load_constantsF
(
pshader
,
gl_info
,
GL_FRAGMENT_PROGRAM_ARB
,
...
...
@@ -4592,7 +4592,7 @@ static void shader_arb_select(const struct wined3d_context *context, BOOL usePS,
}
else
{
float
rt_height
=
This
->
render_targets
[
0
]
->
currentDesc
.
H
eight
;
float
rt_height
=
This
->
render_targets
[
0
]
->
resource
.
h
eight
;
shader_arb_ps_local_constants
(
compiled
,
context
,
state
,
rt_height
);
}
...
...
dlls/wined3d/basetexture.c
View file @
ac9c592c
...
...
@@ -34,8 +34,9 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, const struct wined3d_
{
HRESULT
hr
;
hr
=
resource_init
(
&
texture
->
resource
,
resource_type
,
device
,
0
,
usage
,
format
,
pool
,
parent
,
parent_ops
,
resource_ops
);
hr
=
resource_init
(
&
texture
->
resource
,
device
,
resource_type
,
format
,
WINED3DMULTISAMPLE_NONE
,
0
,
usage
,
pool
,
0
,
0
,
0
,
0
,
parent
,
parent_ops
,
resource_ops
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize resource, returning %#x
\n
"
,
hr
);
...
...
dlls/wined3d/buffer.c
View file @
ac9c592c
...
...
@@ -1431,8 +1431,9 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
return
WINED3DERR_INVALIDCALL
;
}
hr
=
resource_init
(
&
buffer
->
resource
,
WINED3DRTYPE_BUFFER
,
device
,
size
,
usage
,
format
,
pool
,
parent
,
parent_ops
,
&
buffer_resource_ops
);
hr
=
resource_init
(
&
buffer
->
resource
,
device
,
WINED3DRTYPE_BUFFER
,
format
,
WINED3DMULTISAMPLE_NONE
,
0
,
usage
,
pool
,
size
,
1
,
1
,
size
,
parent
,
parent_ops
,
&
buffer_resource_ops
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize resource, hr %#x
\n
"
,
hr
);
...
...
dlls/wined3d/context.c
View file @
ac9c592c
...
...
@@ -1663,8 +1663,8 @@ static void SetupForBlit(IWineD3DDeviceImpl *This, struct wined3d_context *conte
int
i
;
const
struct
StateEntry
*
StateTable
=
This
->
StateTable
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
UINT
width
=
context
->
current_rt
->
currentDesc
.
W
idth
;
UINT
height
=
context
->
current_rt
->
currentDesc
.
H
eight
;
UINT
width
=
context
->
current_rt
->
resource
.
w
idth
;
UINT
height
=
context
->
current_rt
->
resource
.
h
eight
;
DWORD
sampler
;
TRACE
(
"Setting up context %p for blitting
\n
"
,
context
);
...
...
dlls/wined3d/device.c
View file @
ac9c592c
...
...
@@ -591,14 +591,14 @@ static BOOL is_full_clear(IWineD3DSurfaceImpl *target, const RECT *draw_rect, co
{
/* partial draw rect */
if
(
draw_rect
->
left
||
draw_rect
->
top
||
draw_rect
->
right
<
target
->
currentDesc
.
W
idth
||
draw_rect
->
bottom
<
target
->
currentDesc
.
H
eight
)
||
draw_rect
->
right
<
target
->
resource
.
w
idth
||
draw_rect
->
bottom
<
target
->
resource
.
h
eight
)
return
FALSE
;
/* partial clear rect */
if
(
clear_rect
&&
(
clear_rect
->
left
>
0
||
clear_rect
->
top
>
0
||
clear_rect
->
right
<
target
->
currentDesc
.
W
idth
||
clear_rect
->
bottom
<
target
->
currentDesc
.
H
eight
))
||
clear_rect
->
right
<
target
->
resource
.
w
idth
||
clear_rect
->
bottom
<
target
->
resource
.
h
eight
))
return
FALSE
;
return
TRUE
;
...
...
@@ -5506,8 +5506,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
surface_internal_preload
(
dst_impl
,
SRGB_RGB
);
surface_bind
(
dst_impl
,
gl_info
,
FALSE
);
src_w
=
src_impl
->
currentDesc
.
W
idth
;
src_h
=
src_impl
->
currentDesc
.
H
eight
;
src_w
=
src_impl
->
resource
.
w
idth
;
src_h
=
src_impl
->
resource
.
h
eight
;
update_w
=
src_rect
?
src_rect
->
right
-
src_rect
->
left
:
src_w
;
update_h
=
src_rect
?
src_rect
->
bottom
-
src_rect
->
top
:
src_h
;
...
...
@@ -5833,8 +5833,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface,
/* Set the viewport and scissor rectangles, if requested. Tests show
* that stateblock recording is ignored, the change goes directly
* into the primary stateblock. */
device
->
stateBlock
->
state
.
viewport
.
Height
=
device
->
render_targets
[
0
]
->
currentDesc
.
H
eight
;
device
->
stateBlock
->
state
.
viewport
.
Width
=
device
->
render_targets
[
0
]
->
currentDesc
.
W
idth
;
device
->
stateBlock
->
state
.
viewport
.
Height
=
device
->
render_targets
[
0
]
->
resource
.
h
eight
;
device
->
stateBlock
->
state
.
viewport
.
Width
=
device
->
render_targets
[
0
]
->
resource
.
w
idth
;
device
->
stateBlock
->
state
.
viewport
.
X
=
0
;
device
->
stateBlock
->
state
.
viewport
.
Y
=
0
;
device
->
stateBlock
->
state
.
viewport
.
MaxZ
=
1
.
0
f
;
...
...
@@ -5870,8 +5870,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
||
This
->
depth_stencil
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
This
->
depth_stencil
,
SFLAG_DS_DISCARDED
,
This
->
depth_stencil
->
currentDesc
.
W
idth
,
This
->
depth_stencil
->
currentDesc
.
H
eight
);
This
->
depth_stencil
->
resource
.
w
idth
,
This
->
depth_stencil
->
resource
.
h
eight
);
if
(
This
->
depth_stencil
==
This
->
onscreen_depth_stencil
)
{
IWineD3DSurface_Release
((
IWineD3DSurface
*
)
This
->
onscreen_depth_stencil
);
...
...
@@ -5917,7 +5917,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
This
->
cursorTexture
=
0
;
}
if
(
(
s
->
currentDesc
.
Width
==
32
)
&&
(
s
->
currentDesc
.
Height
==
32
)
)
if
(
s
->
resource
.
width
==
32
&&
s
->
resource
.
height
==
32
)
This
->
haveHardwareCursor
=
TRUE
;
else
This
->
haveHardwareCursor
=
FALSE
;
...
...
@@ -5934,11 +5934,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
}
/* MSDN: Cursor must be smaller than the display mode */
if
(
s
->
currentDesc
.
W
idth
>
This
->
ddraw_width
||
s
->
currentDesc
.
H
eight
>
This
->
ddraw_height
)
if
(
s
->
resource
.
w
idth
>
This
->
ddraw_width
||
s
->
resource
.
h
eight
>
This
->
ddraw_height
)
{
WARN
(
"Surface %p dimensions are %ux%u, but screen dimensions are %ux%u.
\n
"
,
s
,
s
->
currentDesc
.
Width
,
s
->
currentDesc
.
H
eight
,
This
->
ddraw_width
,
This
->
ddraw_height
);
s
,
s
->
resource
.
width
,
s
->
resource
.
h
eight
,
This
->
ddraw_width
,
This
->
ddraw_height
);
return
WINED3DERR_INVALIDCALL
;
}
...
...
@@ -5951,8 +5951,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
* creating circular refcount dependencies. Copy out the gl texture
* instead.
*/
This
->
cursorWidth
=
s
->
currentDesc
.
W
idth
;
This
->
cursorHeight
=
s
->
currentDesc
.
H
eight
;
This
->
cursorWidth
=
s
->
resource
.
w
idth
;
This
->
cursorHeight
=
s
->
resource
.
h
eight
;
if
(
SUCCEEDED
(
IWineD3DSurface_Map
(
cursor_image
,
&
rect
,
NULL
,
WINED3DLOCK_READONLY
)))
{
const
struct
wined3d_gl_info
*
gl_info
=
&
This
->
adapter
->
gl_info
;
...
...
@@ -6028,16 +6028,16 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
* 32-bit cursors. 32x32 bits split into 32-bit chunks == 32
* chunks. */
DWORD
*
maskBits
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
(
s
->
currentDesc
.
Width
*
s
->
currentDesc
.
H
eight
/
8
));
(
s
->
resource
.
width
*
s
->
resource
.
h
eight
/
8
));
IWineD3DSurface_Map
(
cursor_image
,
&
lockedRect
,
NULL
,
WINED3DLOCK_NO_DIRTY_UPDATE
|
WINED3DLOCK_READONLY
);
TRACE
(
"width: %u height: %u.
\n
"
,
s
->
currentDesc
.
Width
,
s
->
currentDesc
.
H
eight
);
TRACE
(
"width: %u height: %u.
\n
"
,
s
->
resource
.
width
,
s
->
resource
.
h
eight
);
cursorInfo
.
fIcon
=
FALSE
;
cursorInfo
.
xHotspot
=
XHotSpot
;
cursorInfo
.
yHotspot
=
YHotSpot
;
cursorInfo
.
hbmMask
=
CreateBitmap
(
s
->
currentDesc
.
Width
,
s
->
currentDesc
.
H
eight
,
1
,
1
,
maskBits
);
cursorInfo
.
hbmColor
=
CreateBitmap
(
s
->
currentDesc
.
Width
,
s
->
currentDesc
.
H
eight
,
1
,
32
,
lockedRect
.
pBits
);
cursorInfo
.
hbmMask
=
CreateBitmap
(
s
->
resource
.
width
,
s
->
resource
.
h
eight
,
1
,
1
,
maskBits
);
cursorInfo
.
hbmColor
=
CreateBitmap
(
s
->
resource
.
width
,
s
->
resource
.
h
eight
,
1
,
32
,
lockedRect
.
pBits
);
IWineD3DSurface_Unmap
(
cursor_image
);
/* Create our cursor and clean up. */
cursor
=
CreateIconIndirect
(
&
cursorInfo
);
...
...
@@ -6140,8 +6140,8 @@ static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRES
surface
->
resource
.
allocatedMemory
=
NULL
;
surface
->
flags
&=
~
SFLAG_DIBSECTION
;
}
surface
->
currentDesc
.
W
idth
=
pPresentationParameters
->
BackBufferWidth
;
surface
->
currentDesc
.
H
eight
=
pPresentationParameters
->
BackBufferHeight
;
surface
->
resource
.
w
idth
=
pPresentationParameters
->
BackBufferWidth
;
surface
->
resource
.
h
eight
=
pPresentationParameters
->
BackBufferHeight
;
if
(
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
]
||
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
]
||
gl_info
->
supported
[
WINED3D_GL_NORMALIZED_TEXRECT
])
{
...
...
dlls/wined3d/glsl_shader.c
View file @
ac9c592c
...
...
@@ -821,7 +821,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
correction_params
[
1
]
=
1
.
0
f
;
}
else
{
/* position is window relative, not viewport relative */
correction_params
[
0
]
=
context
->
current_rt
->
currentDesc
.
H
eight
;
correction_params
[
0
]
=
context
->
current_rt
->
resource
.
h
eight
;
correction_params
[
1
]
=
-
1
.
0
f
;
}
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
ycorrection_location
,
1
,
correction_params
));
...
...
@@ -1039,7 +1039,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
*/
FIXME
(
"Cannot find a free uniform for vpos correction params
\n
"
);
shader_addline
(
buffer
,
"const vec4 ycorrection = vec4(%f, %f, 0.0, 0.0);
\n
"
,
context
->
render_offscreen
?
0
.
0
f
:
device
->
render_targets
[
0
]
->
currentDesc
.
H
eight
,
context
->
render_offscreen
?
0
.
0
f
:
device
->
render_targets
[
0
]
->
resource
.
h
eight
,
context
->
render_offscreen
?
1
.
0
f
:
-
1
.
0
f
);
}
shader_addline
(
buffer
,
"vec4 vpos;
\n
"
);
...
...
dlls/wined3d/resource.c
View file @
ac9c592c
...
...
@@ -43,17 +43,24 @@ struct private_data
DWORD
size
;
};
HRESULT
resource_init
(
struct
wined3d_resource
*
resource
,
WINED3DRESOURCETYPE
resource_type
,
IWineD3DDeviceImpl
*
device
,
UINT
size
,
DWORD
usage
,
const
struct
wined3d_format
*
format
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
HRESULT
resource_init
(
struct
wined3d_resource
*
resource
,
IWineD3DDeviceImpl
*
device
,
WINED3DRESOURCETYPE
resource_type
,
const
struct
wined3d_format
*
format
,
WINED3DMULTISAMPLE_TYPE
multisample_type
,
UINT
multisample_quality
,
DWORD
usage
,
WINED3DPOOL
pool
,
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
size
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
const
struct
wined3d_resource_ops
*
resource_ops
)
{
resource
->
ref
=
1
;
resource
->
device
=
device
;
resource
->
resourceType
=
resource_type
;
resource
->
ref
=
1
;
resource
->
pool
=
pool
;
resource
->
format
=
format
;
resource
->
multisample_type
=
multisample_type
;
resource
->
multisample_quality
=
multisample_quality
;
resource
->
usage
=
usage
;
resource
->
pool
=
pool
;
resource
->
width
=
width
;
resource
->
height
=
height
;
resource
->
depth
=
depth
;
resource
->
size
=
size
;
resource
->
priority
=
0
;
resource
->
parent
=
parent
;
...
...
dlls/wined3d/state.c
View file @
ac9c592c
...
...
@@ -4758,8 +4758,10 @@ static void viewport_miscpart(DWORD state, struct wined3d_stateblock *stateblock
UINT
width
,
height
;
WINED3DVIEWPORT
vp
=
stateblock
->
state
.
viewport
;
if
(
vp
.
Width
>
target
->
currentDesc
.
Width
)
vp
.
Width
=
target
->
currentDesc
.
Width
;
if
(
vp
.
Height
>
target
->
currentDesc
.
Height
)
vp
.
Height
=
target
->
currentDesc
.
Height
;
if
(
vp
.
Width
>
target
->
resource
.
width
)
vp
.
Width
=
target
->
resource
.
width
;
if
(
vp
.
Height
>
target
->
resource
.
height
)
vp
.
Height
=
target
->
resource
.
height
;
glDepthRange
(
vp
.
MinZ
,
vp
.
MaxZ
);
checkGLcall
(
"glDepthRange"
);
...
...
dlls/wined3d/surface.c
View file @
ac9c592c
This diff is collapsed.
Click to expand it.
dlls/wined3d/surface_base.c
View file @
ac9c592c
This diff is collapsed.
Click to expand it.
dlls/wined3d/surface_gdi.c
View file @
ac9c592c
...
...
@@ -369,8 +369,8 @@ IWineGDISurfaceImpl_PrivateSetup(IWineD3DSurface *iface)
}
/* We don't mind the nonpow2 stuff in GDI */
This
->
pow2Width
=
This
->
currentDesc
.
W
idth
;
This
->
pow2Height
=
This
->
currentDesc
.
H
eight
;
This
->
pow2Width
=
This
->
resource
.
w
idth
;
This
->
pow2Height
=
This
->
resource
.
h
eight
;
return
WINED3D_OK
;
}
...
...
dlls/wined3d/swapchain.c
View file @
ac9c592c
...
...
@@ -268,11 +268,11 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface,
cursor
.
texture_name
=
This
->
device
->
cursorTexture
;
cursor
.
texture_target
=
GL_TEXTURE_2D
;
cursor
.
texture_level
=
0
;
cursor
.
currentDesc
.
W
idth
=
This
->
device
->
cursorWidth
;
cursor
.
currentDesc
.
H
eight
=
This
->
device
->
cursorHeight
;
cursor
.
resource
.
w
idth
=
This
->
device
->
cursorWidth
;
cursor
.
resource
.
h
eight
=
This
->
device
->
cursorHeight
;
/* The cursor must have pow2 sizes */
cursor
.
pow2Width
=
cursor
.
currentDesc
.
W
idth
;
cursor
.
pow2Height
=
cursor
.
currentDesc
.
H
eight
;
cursor
.
pow2Width
=
cursor
.
resource
.
w
idth
;
cursor
.
pow2Height
=
cursor
.
resource
.
h
eight
;
/* The surface is in the texture */
cursor
.
flags
|=
SFLAG_INTEXTURE
;
/* DDBLT_KEYSRC will cause BltOverride to enable the alpha test with GL_NOTEQUAL, 0.0,
...
...
@@ -441,8 +441,8 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface,
||
This
->
device
->
depth_stencil
->
flags
&
SFLAG_DISCARD
)
{
surface_modify_ds_location
(
This
->
device
->
depth_stencil
,
SFLAG_DS_DISCARDED
,
This
->
device
->
depth_stencil
->
currentDesc
.
W
idth
,
This
->
device
->
depth_stencil
->
currentDesc
.
H
eight
);
This
->
device
->
depth_stencil
->
resource
.
w
idth
,
This
->
device
->
depth_stencil
->
resource
.
h
eight
);
if
(
This
->
device
->
depth_stencil
==
This
->
device
->
onscreen_depth_stencil
)
{
IWineD3DSurface_Release
((
IWineD3DSurface
*
)
This
->
device
->
onscreen_depth_stencil
);
...
...
@@ -832,6 +832,6 @@ void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, U
{
/* The drawable size of an onscreen drawable is the surface size.
* (Actually: The window size, but the surface is created in window size) */
*
width
=
context
->
current_rt
->
currentDesc
.
W
idth
;
*
height
=
context
->
current_rt
->
currentDesc
.
H
eight
;
*
width
=
context
->
current_rt
->
resource
.
w
idth
;
*
height
=
context
->
current_rt
->
resource
.
h
eight
;
}
dlls/wined3d/swapchain_gdi.c
View file @
ac9c592c
...
...
@@ -126,9 +126,9 @@ void x11_copy_to_screen(IWineD3DSwapChainImpl *This, const RECT *rc)
}
#endif
drawrect
.
left
=
0
;
drawrect
.
right
=
front
->
currentDesc
.
W
idth
;
drawrect
.
right
=
front
->
resource
.
w
idth
;
drawrect
.
top
=
0
;
drawrect
.
bottom
=
front
->
currentDesc
.
H
eight
;
drawrect
.
bottom
=
front
->
resource
.
h
eight
;
#if 0
/* TODO: Support clippers */
...
...
dlls/wined3d/volume.c
View file @
ac9c592c
...
...
@@ -79,9 +79,9 @@ void volume_add_dirty_box(struct IWineD3DVolumeImpl *volume, const WINED3DBOX *d
volume
->
lockedBox
.
Left
=
0
;
volume
->
lockedBox
.
Top
=
0
;
volume
->
lockedBox
.
Front
=
0
;
volume
->
lockedBox
.
Right
=
volume
->
currentDesc
.
W
idth
;
volume
->
lockedBox
.
Bottom
=
volume
->
currentDesc
.
H
eight
;
volume
->
lockedBox
.
Back
=
volume
->
currentDesc
.
D
epth
;
volume
->
lockedBox
.
Right
=
volume
->
resource
.
w
idth
;
volume
->
lockedBox
.
Bottom
=
volume
->
resource
.
h
eight
;
volume
->
lockedBox
.
Back
=
volume
->
resource
.
d
epth
;
}
}
...
...
@@ -105,7 +105,7 @@ void volume_load(IWineD3DVolumeImpl *volume, UINT level, BOOL srgb_mode)
ENTER_GL
();
GL_EXTCALL
(
glTexImage3DEXT
(
GL_TEXTURE_3D
,
level
,
format
->
glInternal
,
volume
->
currentDesc
.
Width
,
volume
->
currentDesc
.
Height
,
volume
->
currentDesc
.
D
epth
,
volume
->
resource
.
width
,
volume
->
resource
.
height
,
volume
->
resource
.
d
epth
,
0
,
format
->
glFormat
,
format
->
glType
,
volume
->
resource
.
allocatedMemory
));
checkGLcall
(
"glTexImage3D"
);
LEAVE_GL
();
...
...
@@ -233,9 +233,9 @@ static void WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, struct wine
desc
->
size
=
volume
->
resource
.
size
;
/* dx8 only */
desc
->
multisample_type
=
WINED3DMULTISAMPLE_NONE
;
desc
->
multisample_quality
=
0
;
desc
->
width
=
volume
->
currentDesc
.
W
idth
;
desc
->
height
=
volume
->
currentDesc
.
H
eight
;
desc
->
depth
=
volume
->
currentDesc
.
D
epth
;
desc
->
width
=
volume
->
resource
.
w
idth
;
desc
->
height
=
volume
->
resource
.
h
eight
;
desc
->
depth
=
volume
->
resource
.
d
epth
;
}
static
HRESULT
WINAPI
IWineD3DVolumeImpl_Map
(
IWineD3DVolume
*
iface
,
...
...
@@ -251,18 +251,18 @@ static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface,
/* fixme: should we really lock as such? */
TRACE
(
"(%p) : box=%p, output pbox=%p, allMem=%p
\n
"
,
This
,
pBox
,
pLockedVolume
,
This
->
resource
.
allocatedMemory
);
pLockedVolume
->
RowPitch
=
This
->
resource
.
format
->
byte_count
*
This
->
currentDesc
.
Width
;
/* Bytes / row
*/
pLockedVolume
->
RowPitch
=
This
->
resource
.
format
->
byte_count
*
This
->
resource
.
width
;
/* Bytes / row
*/
pLockedVolume
->
SlicePitch
=
This
->
resource
.
format
->
byte_count
*
This
->
currentDesc
.
Width
*
This
->
currentDesc
.
Height
;
/* Bytes / slice */
*
This
->
resource
.
width
*
This
->
resource
.
height
;
/* Bytes / slice */
if
(
!
pBox
)
{
TRACE
(
"No box supplied - all is ok
\n
"
);
pLockedVolume
->
pBits
=
This
->
resource
.
allocatedMemory
;
This
->
lockedBox
.
Left
=
0
;
This
->
lockedBox
.
Top
=
0
;
This
->
lockedBox
.
Front
=
0
;
This
->
lockedBox
.
Right
=
This
->
currentDesc
.
W
idth
;
This
->
lockedBox
.
Bottom
=
This
->
currentDesc
.
H
eight
;
This
->
lockedBox
.
Back
=
This
->
currentDesc
.
D
epth
;
This
->
lockedBox
.
Right
=
This
->
resource
.
w
idth
;
This
->
lockedBox
.
Bottom
=
This
->
resource
.
h
eight
;
This
->
lockedBox
.
Back
=
This
->
resource
.
d
epth
;
}
else
{
TRACE
(
"Lock Box (%p) = l %d, t %d, r %d, b %d, fr %d, ba %d
\n
"
,
pBox
,
pBox
->
Left
,
pBox
->
Top
,
pBox
->
Right
,
pBox
->
Bottom
,
pBox
->
Front
,
pBox
->
Back
);
pLockedVolume
->
pBits
=
This
->
resource
.
allocatedMemory
...
...
@@ -344,18 +344,16 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT
volume
->
lpVtbl
=
&
IWineD3DVolume_Vtbl
;
hr
=
resource_init
(
&
volume
->
resource
,
WINED3DRTYPE_VOLUME
,
device
,
width
*
height
*
depth
*
format
->
byte_count
,
usage
,
format
,
pool
,
parent
,
parent_ops
,
&
volume_resource_ops
);
hr
=
resource_init
(
&
volume
->
resource
,
device
,
WINED3DRTYPE_VOLUME
,
format
,
WINED3DMULTISAMPLE_NONE
,
0
,
usage
,
pool
,
width
,
height
,
depth
,
width
*
height
*
depth
*
format
->
byte_count
,
parent
,
parent_ops
,
&
volume_resource_ops
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize resource, returning %#x.
\n
"
,
hr
);
return
hr
;
}
volume
->
currentDesc
.
Width
=
width
;
volume
->
currentDesc
.
Height
=
height
;
volume
->
currentDesc
.
Depth
=
depth
;
volume
->
lockable
=
TRUE
;
volume
->
locked
=
FALSE
;
memset
(
&
volume
->
lockedBox
,
0
,
sizeof
(
volume
->
lockedBox
));
...
...
dlls/wined3d/wined3d_private.h
View file @
ac9c592c
...
...
@@ -1800,12 +1800,17 @@ struct wined3d_resource_ops
struct
wined3d_resource
{
LONG
ref
;
WINED3DRESOURCETYPE
resourceType
;
IWineD3DDeviceImpl
*
device
;
WINED3DRESOURCETYPE
resourceType
;
const
struct
wined3d_format
*
format
;
WINED3DMULTISAMPLE_TYPE
multisample_type
;
UINT
multisample_quality
;
DWORD
usage
;
WINED3DPOOL
pool
;
UINT
width
;
UINT
height
;
UINT
depth
;
UINT
size
;
DWORD
usage
;
const
struct
wined3d_format
*
format
;
DWORD
priority
;
BYTE
*
allocatedMemory
;
/* Pointer to the real data location */
BYTE
*
heapMemory
;
/* Pointer to the HeapAlloced block of memory */
...
...
@@ -1822,9 +1827,11 @@ HRESULT resource_free_private_data(struct wined3d_resource *resource, REFGUID gu
DWORD
resource_get_priority
(
const
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
HRESULT
resource_get_private_data
(
const
struct
wined3d_resource
*
resource
,
REFGUID
guid
,
void
*
data
,
DWORD
*
data_size
)
DECLSPEC_HIDDEN
;
HRESULT
resource_init
(
struct
wined3d_resource
*
resource
,
WINED3DRESOURCETYPE
resource_type
,
IWineD3DDeviceImpl
*
device
,
UINT
size
,
DWORD
usage
,
const
struct
wined3d_format
*
format
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
HRESULT
resource_init
(
struct
wined3d_resource
*
resource
,
IWineD3DDeviceImpl
*
device
,
WINED3DRESOURCETYPE
resource_type
,
const
struct
wined3d_format
*
format
,
WINED3DMULTISAMPLE_TYPE
multisample_type
,
UINT
multisample_quality
,
DWORD
usage
,
WINED3DPOOL
pool
,
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
size
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
,
const
struct
wined3d_resource_ops
*
resource_ops
)
DECLSPEC_HIDDEN
;
WINED3DRESOURCETYPE
resource_get_type
(
const
struct
wined3d_resource
*
resource
)
DECLSPEC_HIDDEN
;
DWORD
resource_set_priority
(
struct
wined3d_resource
*
resource
,
DWORD
priority
)
DECLSPEC_HIDDEN
;
...
...
@@ -1973,24 +1980,12 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN
IWineD3DDeviceImpl
*
device
,
DWORD
usage
,
enum
wined3d_format_id
format_id
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
typedef
struct
_WINED3DVOLUMET_DESC
{
UINT
Width
;
UINT
Height
;
UINT
Depth
;
}
WINED3DVOLUMET_DESC
;
/*****************************************************************************
* IWineD3DVolume implementation structure (extends IUnknown)
*/
typedef
struct
IWineD3DVolumeImpl
{
/* IUnknown & WineD3DResource fields */
const
IWineD3DVolumeVtbl
*
lpVtbl
;
struct
wined3d_resource
resource
;
/* WineD3DVolume Information */
WINED3DVOLUMET_DESC
currentDesc
;
struct
IWineD3DVolumeTextureImpl
*
container
;
BOOL
lockable
;
BOOL
locked
;
...
...
@@ -2026,14 +2021,6 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT
UINT
depth
,
UINT
levels
,
IWineD3DDeviceImpl
*
device
,
DWORD
usage
,
enum
wined3d_format_id
format_id
,
WINED3DPOOL
pool
,
void
*
parent
,
const
struct
wined3d_parent_ops
*
parent_ops
)
DECLSPEC_HIDDEN
;
typedef
struct
_WINED3DSURFACET_DESC
{
WINED3DMULTISAMPLE_TYPE
MultiSampleType
;
DWORD
MultiSampleQuality
;
UINT
Width
;
UINT
Height
;
}
WINED3DSURFACET_DESC
;
/*****************************************************************************
* Structure for DIB Surfaces (GetDC and GDI surfaces)
*/
...
...
@@ -2105,7 +2092,6 @@ struct IWineD3DSurfaceImpl
/* IWineD3DSurface fields */
const
struct
wined3d_surface_ops
*
surface_ops
;
struct
wined3d_subresource_container
container
;
WINED3DSURFACET_DESC
currentDesc
;
struct
wined3d_palette
*
palette
;
/* D3D7 style palette handling */
PALETTEENTRY
*
palette9
;
/* D3D8/9 style palette handling */
...
...
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