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
16b7ae6e
Commit
16b7ae6e
authored
Jun 18, 2013
by
Nicolas Capens
Committed by
Shannon Woods
Jun 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only discard the storage texture when there is a mismatch with its mipmap chain
TRAC #23341 Signed-off-by: Shannon Woods Author: Nicolas Capens
parent
63d5e35f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
7 deletions
+40
-7
Texture.cpp
src/libGLESv2/Texture.cpp
+35
-4
Texture.h
src/libGLESv2/Texture.h
+5
-3
No files found.
src/libGLESv2/Texture.cpp
View file @
16b7ae6e
...
...
@@ -1311,6 +1311,11 @@ int TextureStorage::getLodOffset() const
return
mLodOffset
;
}
int
TextureStorage
::
levelCount
()
{
return
getBaseTexture
()
?
getBaseTexture
()
->
GetLevelCount
()
-
getLodOffset
()
:
0
;
}
Texture
::
Texture
(
GLuint
id
)
:
RefCountObject
(
id
)
{
mMinFilter
=
GL_NEAREST_MIPMAP_LINEAR
;
...
...
@@ -1798,9 +1803,21 @@ void Texture2D::redefineImage(GLint level, GLint internalformat, GLsizei width,
{
releaseTexImage
();
bool
redefined
=
mImageArray
[
level
].
redefine
(
internalformat
,
width
,
height
,
false
);
// If there currently is a corresponding storage texture image, it has these parameters
const
int
storageWidth
=
std
::
max
(
1
,
mImageArray
[
0
].
getWidth
()
>>
level
);
const
int
storageHeight
=
std
::
max
(
1
,
mImageArray
[
0
].
getHeight
()
>>
level
);
const
int
storageFormat
=
mImageArray
[
0
].
getInternalFormat
();
mImageArray
[
level
].
redefine
(
internalformat
,
width
,
height
,
false
);
if
(
mTexStorage
)
{
const
int
storageLevels
=
mTexStorage
->
levelCount
();
if
(
mTexStorage
&&
redefined
)
if
((
level
>=
storageLevels
&&
storageLevels
!=
0
)
||
width
!=
storageWidth
||
height
!=
storageHeight
||
internalformat
!=
storageFormat
)
// Discard mismatched storage
{
for
(
int
i
=
0
;
i
<
IMPLEMENTATION_MAX_TEXTURE_LEVELS
;
i
++
)
{
...
...
@@ -1811,6 +1828,7 @@ void Texture2D::redefineImage(GLint level, GLint internalformat, GLsizei width,
mTexStorage
=
NULL
;
mDirtyImages
=
true
;
}
}
}
void
Texture2D
::
setImage
(
GLint
level
,
GLsizei
width
,
GLsizei
height
,
GLenum
format
,
GLenum
type
,
GLint
unpackAlignment
,
const
void
*
pixels
)
...
...
@@ -2821,9 +2839,21 @@ unsigned int TextureCubeMap::faceIndex(GLenum face)
void
TextureCubeMap
::
redefineImage
(
int
face
,
GLint
level
,
GLint
internalformat
,
GLsizei
width
,
GLsizei
height
)
{
bool
redefined
=
mImageArray
[
face
][
level
].
redefine
(
internalformat
,
width
,
height
,
false
);
// If there currently is a corresponding storage texture image, it has these parameters
const
int
storageWidth
=
std
::
max
(
1
,
mImageArray
[
0
][
0
].
getWidth
()
>>
level
);
const
int
storageHeight
=
std
::
max
(
1
,
mImageArray
[
0
][
0
].
getHeight
()
>>
level
);
const
int
storageFormat
=
mImageArray
[
0
][
0
].
getInternalFormat
();
if
(
mTexStorage
&&
redefined
)
mImageArray
[
face
][
level
].
redefine
(
internalformat
,
width
,
height
,
false
);
if
(
mTexStorage
)
{
const
int
storageLevels
=
mTexStorage
->
levelCount
();
if
((
level
>=
storageLevels
&&
storageLevels
!=
0
)
||
width
!=
storageWidth
||
height
!=
storageHeight
||
internalformat
!=
storageFormat
)
// Discard mismatched storage
{
for
(
int
i
=
0
;
i
<
IMPLEMENTATION_MAX_TEXTURE_LEVELS
;
i
++
)
{
...
...
@@ -2838,6 +2868,7 @@ void TextureCubeMap::redefineImage(int face, GLint level, GLint internalformat,
mDirtyImages
=
true
;
}
}
}
void
TextureCubeMap
::
copyImage
(
GLenum
target
,
GLint
level
,
GLenum
format
,
GLint
x
,
GLint
y
,
GLsizei
width
,
GLsizei
height
,
Framebuffer
*
source
)
...
...
src/libGLESv2/Texture.h
View file @
16b7ae6e
//
// Copyright (c) 2002-201
2
The ANGLE Project Authors. All rights reserved.
// Copyright (c) 2002-201
3
The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
...
...
@@ -147,8 +147,10 @@ class TextureStorage
D3DPOOL
getPool
()
const
;
DWORD
getUsage
()
const
;
unsigned
int
getTextureSerial
()
const
;
virtual
IDirect3DBaseTexture9
*
getBaseTexture
()
const
=
0
;
virtual
unsigned
int
getRenderTargetSerial
(
GLenum
target
)
const
=
0
;
int
getLodOffset
()
const
;
int
levelCount
();
protected
:
int
mLodOffset
;
...
...
@@ -258,7 +260,7 @@ class TextureStorage2D : public TextureStorage
virtual
~
TextureStorage2D
();
IDirect3DSurface9
*
getSurfaceLevel
(
int
level
,
bool
dirty
);
IDirect3DBaseTexture9
*
getBaseTexture
()
const
;
virtual
IDirect3DBaseTexture9
*
getBaseTexture
()
const
;
virtual
unsigned
int
getRenderTargetSerial
(
GLenum
target
)
const
;
...
...
@@ -345,7 +347,7 @@ class TextureStorageCubeMap : public TextureStorage
virtual
~
TextureStorageCubeMap
();
IDirect3DSurface9
*
getCubeMapSurface
(
GLenum
faceTarget
,
int
level
,
bool
dirty
);
IDirect3DBaseTexture9
*
getBaseTexture
()
const
;
virtual
IDirect3DBaseTexture9
*
getBaseTexture
()
const
;
virtual
unsigned
int
getRenderTargetSerial
(
GLenum
target
)
const
;
...
...
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