Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
angle
Commits
065e1a32
Commit
065e1a32
authored
Oct 10, 2013
by
Jamie Madill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for pixel unpack buffers to TexSubImage2D.
TRAC #23845 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods
parent
4461f097
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
Texture.cpp
src/libGLESv2/Texture.cpp
+30
-3
No files found.
src/libGLESv2/Texture.cpp
View file @
065e1a32
...
...
@@ -257,9 +257,20 @@ void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, rx::Imag
bool
Texture
::
subImage
(
GLint
xoffset
,
GLint
yoffset
,
GLint
zoffset
,
GLsizei
width
,
GLsizei
height
,
GLsizei
depth
,
GLenum
format
,
GLenum
type
,
const
PixelUnpackState
&
unpack
,
const
void
*
pixels
,
rx
::
Image
*
image
)
{
if
(
pixels
!=
NULL
)
const
void
*
pixelData
=
pixels
;
// CPU readback & copy where direct GPU copy is not supported
if
(
unpack
.
pixelBuffer
.
id
()
!=
0
)
{
Buffer
*
pixelBuffer
=
unpack
.
pixelBuffer
.
get
();
unsigned
int
offset
=
reinterpret_cast
<
unsigned
int
>
(
pixels
);
const
void
*
bufferData
=
pixelBuffer
->
getStorage
()
->
getData
();
pixelData
=
static_cast
<
const
unsigned
char
*>
(
bufferData
)
+
offset
;
}
if
(
pixelData
!=
NULL
)
{
image
->
loadData
(
xoffset
,
yoffset
,
zoffset
,
width
,
height
,
depth
,
unpack
.
alignment
,
type
,
pixel
s
);
image
->
loadData
(
xoffset
,
yoffset
,
zoffset
,
width
,
height
,
depth
,
unpack
.
alignment
,
type
,
pixel
Data
);
mDirtyImages
=
true
;
}
...
...
@@ -517,7 +528,23 @@ void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei wi
void
Texture2D
::
subImage
(
GLint
level
,
GLint
xoffset
,
GLint
yoffset
,
GLsizei
width
,
GLsizei
height
,
GLenum
format
,
GLenum
type
,
const
PixelUnpackState
&
unpack
,
const
void
*
pixels
)
{
if
(
Texture
::
subImage
(
xoffset
,
yoffset
,
0
,
width
,
height
,
1
,
format
,
type
,
unpack
,
pixels
,
mImageArray
[
level
]))
bool
fastUnpacked
=
false
;
if
(
isFastUnpackable
(
unpack
,
getInternalFormat
(
level
))
&&
isLevelComplete
(
level
))
{
rx
::
RenderTarget
*
renderTarget
=
getRenderTarget
(
level
);
Box
destArea
(
xoffset
,
yoffset
,
0
,
width
,
height
,
1
);
if
(
renderTarget
&&
fastUnpackPixels
(
unpack
,
pixels
,
destArea
,
getInternalFormat
(
level
),
type
,
renderTarget
))
{
// Ensure we don't overwrite our newly initialized data
mImageArray
[
level
]
->
markClean
();
fastUnpacked
=
true
;
}
}
if
(
!
fastUnpacked
&&
Texture
::
subImage
(
xoffset
,
yoffset
,
0
,
width
,
height
,
1
,
format
,
type
,
unpack
,
pixels
,
mImageArray
[
level
]))
{
commitRect
(
level
,
xoffset
,
yoffset
,
width
,
height
);
}
...
...
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