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
fb7135ef
Commit
fb7135ef
authored
Aug 21, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 21, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce struct wined3d_rendertarget_view_desc.
parent
eb24c957
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
129 additions
and
14 deletions
+129
-14
view.c
dlls/d3d10core/view.c
+66
-2
view.c
dlls/wined3d/view.c
+33
-9
wined3d.spec
dlls/wined3d/wined3d.spec
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+8
-0
wined3d.h
include/wine/wined3d.h
+21
-2
No files found.
dlls/d3d10core/view.c
View file @
fb7135ef
...
...
@@ -654,9 +654,73 @@ static const struct ID3D10RenderTargetViewVtbl d3d10_rendertarget_view_vtbl =
d3d10_rendertarget_view_GetDesc
,
};
static
void
wined3d_rendertarget_view_desc_from_d3d10core
(
struct
wined3d_rendertarget_view_desc
*
wined3d_desc
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
)
{
wined3d_desc
->
format_id
=
wined3dformat_from_dxgi_format
(
desc
->
Format
);
switch
(
desc
->
ViewDimension
)
{
case
D3D10_RTV_DIMENSION_BUFFER
:
wined3d_desc
->
u
.
buffer
.
start_idx
=
desc
->
u
.
Buffer
.
ElementOffset
;
wined3d_desc
->
u
.
buffer
.
count
=
desc
->
u
.
Buffer
.
ElementWidth
;
break
;
case
D3D10_RTV_DIMENSION_TEXTURE1D
:
wined3d_desc
->
u
.
texture
.
level_idx
=
desc
->
u
.
Texture1D
.
MipSlice
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
0
;
wined3d_desc
->
u
.
texture
.
layer_count
=
1
;
break
;
case
D3D10_RTV_DIMENSION_TEXTURE1DARRAY
:
wined3d_desc
->
u
.
texture
.
level_idx
=
desc
->
u
.
Texture1DArray
.
MipSlice
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
desc
->
u
.
Texture1DArray
.
FirstArraySlice
;
wined3d_desc
->
u
.
texture
.
layer_count
=
desc
->
u
.
Texture1DArray
.
ArraySize
;
break
;
case
D3D10_RTV_DIMENSION_TEXTURE2D
:
wined3d_desc
->
u
.
texture
.
level_idx
=
desc
->
u
.
Texture2D
.
MipSlice
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
0
;
wined3d_desc
->
u
.
texture
.
layer_count
=
1
;
break
;
case
D3D10_RTV_DIMENSION_TEXTURE2DARRAY
:
wined3d_desc
->
u
.
texture
.
level_idx
=
desc
->
u
.
Texture2DArray
.
MipSlice
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
desc
->
u
.
Texture2DArray
.
FirstArraySlice
;
wined3d_desc
->
u
.
texture
.
layer_count
=
desc
->
u
.
Texture2DArray
.
ArraySize
;
break
;
case
D3D10_RTV_DIMENSION_TEXTURE2DMS
:
wined3d_desc
->
u
.
texture
.
level_idx
=
0
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
0
;
wined3d_desc
->
u
.
texture
.
layer_count
=
1
;
break
;
case
D3D10_RTV_DIMENSION_TEXTURE2DMSARRAY
:
wined3d_desc
->
u
.
texture
.
level_idx
=
0
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
desc
->
u
.
Texture2DMSArray
.
FirstArraySlice
;
wined3d_desc
->
u
.
texture
.
layer_count
=
desc
->
u
.
Texture2DMSArray
.
ArraySize
;
break
;
case
D3D10_RTV_DIMENSION_TEXTURE3D
:
wined3d_desc
->
u
.
texture
.
level_idx
=
desc
->
u
.
Texture3D
.
MipSlice
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
desc
->
u
.
Texture3D
.
FirstWSlice
;
wined3d_desc
->
u
.
texture
.
layer_count
=
desc
->
u
.
Texture3D
.
WSize
;
break
;
default:
FIXME
(
"Unhandled view dimension %#x.
\n
"
,
desc
->
ViewDimension
);
wined3d_desc
->
u
.
texture
.
level_idx
=
0
;
wined3d_desc
->
u
.
texture
.
layer_idx
=
0
;
wined3d_desc
->
u
.
texture
.
layer_count
=
1
;
break
;
}
}
HRESULT
d3d10_rendertarget_view_init
(
struct
d3d10_rendertarget_view
*
view
,
struct
d3d10_device
*
device
,
ID3D10Resource
*
resource
,
const
D3D10_RENDER_TARGET_VIEW_DESC
*
desc
)
{
struct
wined3d_rendertarget_view_desc
wined3d_desc
;
struct
wined3d_resource
*
wined3d_resource
;
HRESULT
hr
;
...
...
@@ -680,8 +744,8 @@ HRESULT d3d10_rendertarget_view_init(struct d3d10_rendertarget_view *view, struc
return
E_FAIL
;
}
hr
=
wined3d_rendertarget_view_create
(
wined3d_resource
,
view
,
&
view
->
wined3d_view
);
if
(
FAILED
(
hr
))
wined3d_rendertarget_view_desc_from_d3d10core
(
&
wined3d_desc
,
&
view
->
desc
);
if
(
FAILED
(
hr
=
wined3d_rendertarget_view_create
(
&
wined3d_desc
,
wined3d_resource
,
view
,
&
view
->
wined3d_view
)
))
{
WARN
(
"Failed to create a wined3d rendertarget view, hr %#x.
\n
"
,
hr
);
return
hr
;
...
...
dlls/wined3d/view.c
View file @
fb7135ef
...
...
@@ -63,30 +63,54 @@ struct wined3d_resource * CDECL wined3d_rendertarget_view_get_resource(const str
}
static
void
wined3d_rendertarget_view_init
(
struct
wined3d_rendertarget_view
*
view
,
struct
wined3d_resource
*
resource
,
void
*
parent
)
const
struct
wined3d_rendertarget_view_desc
*
desc
,
struct
wined3d_resource
*
resource
,
void
*
parent
)
{
const
struct
wined3d_gl_info
*
gl_info
=
&
resource
->
device
->
adapter
->
gl_info
;
view
->
refcount
=
1
;
view
->
resource
=
resource
;
wined3d_resource_incref
(
resource
);
view
->
parent
=
parent
;
view
->
format
=
wined3d_get_format
(
gl_info
,
desc
->
format_id
);
if
(
resource
->
type
==
WINED3D_RTYPE_BUFFER
)
{
view
->
sub_resource_idx
=
0
;
view
->
buffer_offset
=
desc
->
u
.
buffer
.
start_idx
;
view
->
width
=
desc
->
u
.
buffer
.
count
;
view
->
height
=
1
;
view
->
depth
=
1
;
}
else
{
struct
wined3d_texture
*
texture
=
wined3d_texture_from_resource
(
resource
);
struct
wined3d_resource
*
sub_resource
;
view
->
sub_resource_idx
=
desc
->
u
.
texture
.
layer_idx
*
texture
->
level_count
+
desc
->
u
.
texture
.
level_idx
;
sub_resource
=
wined3d_texture_get_sub_resource
(
texture
,
view
->
sub_resource_idx
);
view
->
buffer_offset
=
0
;
view
->
width
=
sub_resource
->
width
;
view
->
height
=
sub_resource
->
height
;
view
->
depth
=
desc
->
u
.
texture
.
layer_count
;
}
}
HRESULT
CDECL
wined3d_rendertarget_view_create
(
struct
wined3d_resource
*
resource
,
void
*
parent
,
struct
wined3d_rendertarget_view
**
rendertarget_
view
)
HRESULT
CDECL
wined3d_rendertarget_view_create
(
const
struct
wined3d_rendertarget_view_desc
*
desc
,
struct
wined3d_resource
*
resource
,
void
*
parent
,
struct
wined3d_rendertarget_view
**
view
)
{
struct
wined3d_rendertarget_view
*
object
;
TRACE
(
"
resource %p, parent %p, rendertarget_
view %p.
\n
"
,
resource
,
parent
,
rendertarget_
view
);
TRACE
(
"
desc %p, resource %p, parent %p,
view %p.
\n
"
,
desc
,
resource
,
parent
,
view
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
wined3d_rendertarget_view_init
(
object
,
resource
,
parent
);
wined3d_rendertarget_view_init
(
object
,
desc
,
resource
,
parent
);
TRACE
(
"Created render target view %p.
\n
"
,
object
);
*
rendertarget_
view
=
object
;
*
view
=
object
;
return
WINED3D_OK
;
}
dlls/wined3d/wined3d.spec
View file @
fb7135ef
...
...
@@ -177,7 +177,7 @@
@ cdecl wined3d_resource_set_parent(ptr ptr)
@ cdecl wined3d_resource_set_priority(ptr long)
@ cdecl wined3d_rendertarget_view_create(ptr ptr ptr)
@ cdecl wined3d_rendertarget_view_create(ptr ptr ptr
ptr
)
@ cdecl wined3d_rendertarget_view_decref(ptr)
@ cdecl wined3d_rendertarget_view_get_parent(ptr)
@ cdecl wined3d_rendertarget_view_get_resource(ptr)
...
...
dlls/wined3d/wined3d_private.h
View file @
fb7135ef
...
...
@@ -2617,6 +2617,14 @@ struct wined3d_rendertarget_view
struct
wined3d_resource
*
resource
;
void
*
parent
;
const
struct
wined3d_format
*
format
;
unsigned
int
sub_resource_idx
;
unsigned
int
buffer_offset
;
unsigned
int
width
;
unsigned
int
height
;
unsigned
int
depth
;
};
struct
wined3d_swapchain_ops
...
...
include/wine/wined3d.h
View file @
fb7135ef
...
...
@@ -1934,6 +1934,25 @@ struct wined3d_buffer_desc
UINT
misc_flags
;
};
struct
wined3d_rendertarget_view_desc
{
enum
wined3d_format_id
format_id
;
union
{
struct
{
unsigned
int
start_idx
;
unsigned
int
count
;
}
buffer
;
struct
{
unsigned
int
level_idx
;
unsigned
int
layer_idx
;
unsigned
int
layer_count
;
}
texture
;
}
u
;
};
struct
wined3d_shader_signature_element
{
const
char
*
semantic_name
;
...
...
@@ -2357,8 +2376,8 @@ DWORD __cdecl wined3d_resource_get_priority(const struct wined3d_resource *resou
void
__cdecl
wined3d_resource_set_parent
(
struct
wined3d_resource
*
resource
,
void
*
parent
);
DWORD
__cdecl
wined3d_resource_set_priority
(
struct
wined3d_resource
*
resource
,
DWORD
priority
);
HRESULT
__cdecl
wined3d_rendertarget_view_create
(
struct
wined3d_resource
*
resource
,
void
*
parent
,
struct
wined3d_rendertarget_view
**
rendertarget_
view
);
HRESULT
__cdecl
wined3d_rendertarget_view_create
(
const
struct
wined3d_rendertarget_view_desc
*
desc
,
struct
wined3d_resource
*
resource
,
void
*
parent
,
struct
wined3d_rendertarget_view
**
view
);
ULONG
__cdecl
wined3d_rendertarget_view_decref
(
struct
wined3d_rendertarget_view
*
view
);
void
*
__cdecl
wined3d_rendertarget_view_get_parent
(
const
struct
wined3d_rendertarget_view
*
view
);
struct
wined3d_resource
*
__cdecl
wined3d_rendertarget_view_get_resource
(
const
struct
wined3d_rendertarget_view
*
view
);
...
...
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