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
4b48845f
Commit
4b48845f
authored
Oct 28, 2013
by
Geoff Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't apply textures that are currently bound to the framebuffer.
BUG=496 Review URL=
https://codereview.appspot.com/18690043/
parent
681c50e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
Context.cpp
src/libGLESv2/Context.cpp
+27
-1
Context.h
src/libGLESv2/Context.h
+4
-0
No files found.
src/libGLESv2/Context.cpp
View file @
4b48845f
...
@@ -1812,6 +1812,8 @@ void Context::applyTextures(SamplerType type)
...
@@ -1812,6 +1812,8 @@ void Context::applyTextures(SamplerType type)
{
{
ProgramBinary
*
programBinary
=
getCurrentProgramBinary
();
ProgramBinary
*
programBinary
=
getCurrentProgramBinary
();
FramebufferTextureSerialSet
boundFramebufferTextures
=
getBoundFramebufferTextureSerials
();
// Range of Direct3D samplers of given sampler type
// Range of Direct3D samplers of given sampler type
int
samplerCount
=
(
type
==
SAMPLER_PIXEL
)
?
MAX_TEXTURE_IMAGE_UNITS
:
mRenderer
->
getMaxVertexTextureImageUnits
();
int
samplerCount
=
(
type
==
SAMPLER_PIXEL
)
?
MAX_TEXTURE_IMAGE_UNITS
:
mRenderer
->
getMaxVertexTextureImageUnits
();
int
samplerRange
=
programBinary
->
getUsedSamplerRange
(
type
);
int
samplerRange
=
programBinary
->
getUsedSamplerRange
(
type
);
...
@@ -1825,7 +1827,8 @@ void Context::applyTextures(SamplerType type)
...
@@ -1825,7 +1827,8 @@ void Context::applyTextures(SamplerType type)
TextureType
textureType
=
programBinary
->
getSamplerTextureType
(
type
,
samplerIndex
);
TextureType
textureType
=
programBinary
->
getSamplerTextureType
(
type
,
samplerIndex
);
Texture
*
texture
=
getSamplerTexture
(
textureUnit
,
textureType
);
Texture
*
texture
=
getSamplerTexture
(
textureUnit
,
textureType
);
if
(
texture
->
isSamplerComplete
())
if
(
texture
->
isSamplerComplete
()
&&
boundFramebufferTextures
.
find
(
texture
->
getTextureSerial
())
==
boundFramebufferTextures
.
end
())
{
{
SamplerState
samplerState
;
SamplerState
samplerState
;
texture
->
getSamplerState
(
&
samplerState
);
texture
->
getSamplerState
(
&
samplerState
);
...
@@ -2655,6 +2658,29 @@ const char *Context::getRendererString() const
...
@@ -2655,6 +2658,29 @@ const char *Context::getRendererString() const
return
mRendererString
;
return
mRendererString
;
}
}
Context
::
FramebufferTextureSerialSet
Context
::
getBoundFramebufferTextureSerials
()
{
FramebufferTextureSerialSet
set
;
Framebuffer
*
drawFramebuffer
=
getDrawFramebuffer
();
for
(
unsigned
int
i
=
0
;
i
<
IMPLEMENTATION_MAX_DRAW_BUFFERS
;
i
++
)
{
Renderbuffer
*
renderBuffer
=
drawFramebuffer
->
getColorbuffer
(
i
);
if
(
renderBuffer
&&
renderBuffer
->
getTextureSerial
()
!=
0
)
{
set
.
insert
(
renderBuffer
->
getTextureSerial
());
}
}
Renderbuffer
*
depthStencilBuffer
=
drawFramebuffer
->
getDepthOrStencilbuffer
();
if
(
depthStencilBuffer
&&
depthStencilBuffer
->
getTextureSerial
()
!=
0
)
{
set
.
insert
(
depthStencilBuffer
->
getTextureSerial
());
}
return
set
;
}
void
Context
::
blitFramebuffer
(
GLint
srcX0
,
GLint
srcY0
,
GLint
srcX1
,
GLint
srcY1
,
void
Context
::
blitFramebuffer
(
GLint
srcX0
,
GLint
srcY0
,
GLint
srcX1
,
GLint
srcY1
,
GLint
dstX0
,
GLint
dstY0
,
GLint
dstX1
,
GLint
dstY1
,
GLint
dstX0
,
GLint
dstY0
,
GLint
dstX1
,
GLint
dstY1
,
GLbitfield
mask
)
GLbitfield
mask
)
...
...
src/libGLESv2/Context.h
View file @
4b48845f
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include <string>
#include <string>
#include <map>
#include <map>
#include <set>
#ifdef _MSC_VER
#ifdef _MSC_VER
#include <hash_map>
#include <hash_map>
#else
#else
...
@@ -420,6 +421,9 @@ class Context
...
@@ -420,6 +421,9 @@ class Context
void
initExtensionString
();
void
initExtensionString
();
void
initRendererString
();
void
initRendererString
();
typedef
std
::
set
<
unsigned
>
FramebufferTextureSerialSet
;
FramebufferTextureSerialSet
getBoundFramebufferTextureSerials
();
rx
::
Renderer
*
const
mRenderer
;
rx
::
Renderer
*
const
mRenderer
;
State
mState
;
State
mState
;
...
...
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