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
9b7ff40d
Commit
9b7ff40d
authored
Aug 01, 2016
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Merge wined3d_volume_upload_data() into texture3d_upload_data().
Signed-off-by:
Henri Verbeet
<
hverbeet@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
61fa6ea2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
95 deletions
+54
-95
Makefile.in
dlls/wined3d/Makefile.in
+0
-1
texture.c
dlls/wined3d/texture.c
+54
-4
volume.c
dlls/wined3d/volume.c
+0
-87
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-3
No files found.
dlls/wined3d/Makefile.in
View file @
9b7ff40d
...
...
@@ -29,7 +29,6 @@ C_SRCS = \
utils.c
\
vertexdeclaration.c
\
view.c
\
volume.c
\
wined3d_main.c
RC_SRCS
=
version.rc
dlls/wined3d/texture.c
View file @
9b7ff40d
...
...
@@ -2072,17 +2072,67 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
return
WINED3D_OK
;
}
/* This call just uploads data, the caller is responsible for binding the
* correct texture. */
/* Context activation is done by the caller. */
static
void
texture3d_upload_data
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_const_bo_address
*
data
,
unsigned
int
row_pitch
,
unsigned
int
slice_pitch
)
{
const
struct
wined3d_format
*
format
=
texture
->
resource
.
format
;
unsigned
int
level
=
sub_resource_idx
%
texture
->
level_count
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
unsigned
int
dst_row_pitch
,
dst_slice_pitch
;
unsigned
int
width
,
height
,
depth
;
const
void
*
mem
=
data
->
addr
;
void
*
converted_mem
=
NULL
;
TRACE
(
"texture %p, sub_resource_idx %u, context %p, data {%#x:%p}, row_pitch %#x, slice_pitch %#x.
\n
"
,
texture
,
sub_resource_idx
,
context
,
data
->
buffer_object
,
data
->
addr
,
row_pitch
,
slice_pitch
);
width
=
wined3d_texture_get_level_width
(
texture
,
level
);
height
=
wined3d_texture_get_level_height
(
texture
,
level
);
depth
=
wined3d_texture_get_level_depth
(
texture
,
level
);
if
(
format
->
convert
)
{
if
(
data
->
buffer_object
)
ERR
(
"Loading a converted texture from a PBO.
\n
"
);
if
(
texture
->
resource
.
format_flags
&
WINED3DFMT_FLAG_BLOCKS
)
ERR
(
"Converting a block-based format.
\n
"
);
dst_row_pitch
=
width
*
format
->
conv_byte_count
;
dst_slice_pitch
=
dst_row_pitch
*
height
;
converted_mem
=
wined3d_calloc
(
depth
,
dst_slice_pitch
);
format
->
convert
(
data
->
addr
,
converted_mem
,
row_pitch
,
slice_pitch
,
dst_row_pitch
,
dst_slice_pitch
,
width
,
height
,
depth
);
mem
=
converted_mem
;
}
else
{
wined3d_texture_get_pitch
(
texture
,
sub_resource_idx
,
&
dst_row_pitch
,
&
dst_slice_pitch
);
if
(
row_pitch
!=
dst_row_pitch
||
slice_pitch
!=
dst_slice_pitch
)
FIXME
(
"Ignoring row/slice pitch (%u/%u).
\n
"
,
row_pitch
,
slice_pitch
);
}
if
(
data
->
buffer_object
)
{
GL_EXTCALL
(
glBindBuffer
(
GL_PIXEL_UNPACK_BUFFER
,
data
->
buffer_object
));
checkGLcall
(
"glBindBuffer"
);
}
GL_EXTCALL
(
glTexSubImage3D
(
GL_TEXTURE_3D
,
level
,
0
,
0
,
0
,
width
,
height
,
depth
,
format
->
glFormat
,
format
->
glType
,
mem
));
checkGLcall
(
"glTexSubImage3D"
);
wined3d_texture_get_pitch
(
texture
,
sub_resource_idx
,
&
dst_row_pitch
,
&
dst_slice_pitch
);
if
(
row_pitch
!=
dst_row_pitch
||
slice_pitch
!=
dst_slice_pitch
)
FIXME
(
"Ignoring row/slice pitch (%u/%u).
\n
"
,
row_pitch
,
slice_pitch
);
if
(
data
->
buffer_object
)
{
GL_EXTCALL
(
glBindBuffer
(
GL_PIXEL_UNPACK_BUFFER
,
0
));
checkGLcall
(
"glBindBuffer"
);
}
wined3d_volume_upload_data
(
texture
,
sub_resource_idx
,
context
,
data
);
HeapFree
(
GetProcessHeap
(),
0
,
converted_mem
);
}
/* Context activation is done by the caller. */
...
...
dlls/wined3d/volume.c
deleted
100644 → 0
View file @
61fa6ea2
/*
* Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber
* Copyright 2009-2011 Henri Verbeet for CodeWeavers
* Copyright 2013 Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include "wined3d_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
/* This call just uploads data, the caller is responsible for binding the
* correct texture. */
/* Context activation is done by the caller. */
void
wined3d_volume_upload_data
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_const_bo_address
*
data
)
{
const
struct
wined3d_format
*
format
=
texture
->
resource
.
format
;
unsigned
int
level
=
sub_resource_idx
%
texture
->
level_count
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
unsigned
int
width
,
height
,
depth
;
const
void
*
mem
=
data
->
addr
;
void
*
converted_mem
=
NULL
;
TRACE
(
"texture %p, sub_resource_idx %u, context %p, format %s (%#x).
\n
"
,
texture
,
level
,
context
,
debug_d3dformat
(
format
->
id
),
format
->
id
);
width
=
wined3d_texture_get_level_width
(
texture
,
level
);
height
=
wined3d_texture_get_level_height
(
texture
,
level
);
depth
=
wined3d_texture_get_level_depth
(
texture
,
level
);
if
(
format
->
convert
)
{
UINT
dst_row_pitch
,
dst_slice_pitch
;
UINT
src_row_pitch
,
src_slice_pitch
;
if
(
data
->
buffer_object
)
ERR
(
"Loading a converted texture from a PBO.
\n
"
);
if
(
texture
->
resource
.
format_flags
&
WINED3DFMT_FLAG_BLOCKS
)
ERR
(
"Converting a block-based format.
\n
"
);
dst_row_pitch
=
width
*
format
->
conv_byte_count
;
dst_slice_pitch
=
dst_row_pitch
*
height
;
wined3d_texture_get_pitch
(
texture
,
level
,
&
src_row_pitch
,
&
src_slice_pitch
);
converted_mem
=
wined3d_calloc
(
depth
,
dst_slice_pitch
);
format
->
convert
(
data
->
addr
,
converted_mem
,
src_row_pitch
,
src_slice_pitch
,
dst_row_pitch
,
dst_slice_pitch
,
width
,
height
,
depth
);
mem
=
converted_mem
;
}
if
(
data
->
buffer_object
)
{
GL_EXTCALL
(
glBindBuffer
(
GL_PIXEL_UNPACK_BUFFER
,
data
->
buffer_object
));
checkGLcall
(
"glBindBuffer"
);
}
GL_EXTCALL
(
glTexSubImage3D
(
GL_TEXTURE_3D
,
level
,
0
,
0
,
0
,
width
,
height
,
depth
,
format
->
glFormat
,
format
->
glType
,
mem
));
checkGLcall
(
"glTexSubImage3D"
);
if
(
data
->
buffer_object
)
{
GL_EXTCALL
(
glBindBuffer
(
GL_PIXEL_UNPACK_BUFFER
,
0
));
checkGLcall
(
"glBindBuffer"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
converted_mem
);
}
dlls/wined3d/wined3d_private.h
View file @
9b7ff40d
...
...
@@ -2786,9 +2786,6 @@ void wined3d_texture_validate_location(struct wined3d_texture *texture,
const
char
*
wined3d_debug_location
(
DWORD
location
)
DECLSPEC_HIDDEN
;
void
wined3d_volume_upload_data
(
struct
wined3d_texture
*
texture
,
unsigned
int
sub_resource_idx
,
const
struct
wined3d_context
*
context
,
const
struct
wined3d_const_bo_address
*
data
)
DECLSPEC_HIDDEN
;
struct
wined3d_renderbuffer_entry
{
struct
list
entry
;
...
...
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