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
55ba29c5
Commit
55ba29c5
authored
Jul 11, 2013
by
Geoff Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement the DEPTH_STENCIL attachment point for FBOs.
Trac #23469 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
parent
1c3192ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
3 deletions
+52
-3
version.h
src/common/version.h
+1
-1
Framebuffer.cpp
src/libGLESv2/Framebuffer.cpp
+28
-0
Framebuffer.h
src/libGLESv2/Framebuffer.h
+3
-0
libGLESv2.cpp
src/libGLESv2/libGLESv2.cpp
+20
-2
No files found.
src/common/version.h
View file @
55ba29c5
#define MAJOR_VERSION 2
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 199
6
#define BUILD_REVISION 199
7
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
...
...
src/libGLESv2/Framebuffer.cpp
View file @
55ba29c5
...
...
@@ -90,6 +90,24 @@ void Framebuffer::setStencilbuffer(GLenum type, GLuint stencilbuffer)
mStencilbufferPointer
.
set
(
lookupRenderbuffer
(
type
,
stencilbuffer
));
}
void
Framebuffer
::
setDepthStencilBuffer
(
GLenum
type
,
GLuint
depthStencilBuffer
)
{
Renderbuffer
*
renderBuffer
=
lookupRenderbuffer
(
type
,
depthStencilBuffer
);
if
(
renderBuffer
&&
renderBuffer
->
getDepthSize
()
>
0
&&
renderBuffer
->
getStencilSize
()
>
0
)
{
mDepthbufferType
=
type
;
mDepthbufferPointer
.
set
(
renderBuffer
);
mStencilbufferType
=
type
;
mStencilbufferPointer
.
set
(
renderBuffer
);
}
else
{
mDepthbufferType
=
GL_NONE
;
mStencilbufferType
=
GL_NONE
;
}
}
void
Framebuffer
::
detachTexture
(
GLuint
texture
)
{
for
(
unsigned
int
colorAttachment
=
0
;
colorAttachment
<
IMPLEMENTATION_MAX_DRAW_BUFFERS
;
colorAttachment
++
)
...
...
@@ -245,6 +263,11 @@ GLenum Framebuffer::getStencilbufferType() const
return
mStencilbufferType
;
}
GLenum
Framebuffer
::
getDepthStencilbufferType
()
const
{
return
(
mDepthbufferPointer
.
id
()
==
mStencilbufferPointer
.
id
())
?
mDepthbufferType
:
GL_NONE
;
}
GLuint
Framebuffer
::
getColorbufferHandle
(
unsigned
int
colorAttachment
)
const
{
ASSERT
(
colorAttachment
<
IMPLEMENTATION_MAX_DRAW_BUFFERS
);
...
...
@@ -261,6 +284,11 @@ GLuint Framebuffer::getStencilbufferHandle() const
return
mStencilbufferPointer
.
id
();
}
GLenum
Framebuffer
::
getDepthStencilbufferHandle
()
const
{
return
(
mDepthbufferPointer
.
id
()
==
mStencilbufferPointer
.
id
())
?
mDepthbufferPointer
.
id
()
:
0
;
}
GLenum
Framebuffer
::
getDrawBufferState
(
unsigned
int
colorAttachment
)
const
{
return
mDrawBufferStates
[
colorAttachment
];
...
...
src/libGLESv2/Framebuffer.h
View file @
55ba29c5
...
...
@@ -37,6 +37,7 @@ class Framebuffer
void
setColorbuffer
(
unsigned
int
colorAttachment
,
GLenum
type
,
GLuint
colorbuffer
);
void
setDepthbuffer
(
GLenum
type
,
GLuint
depthbuffer
);
void
setStencilbuffer
(
GLenum
type
,
GLuint
stencilbuffer
);
void
setDepthStencilBuffer
(
GLenum
type
,
GLuint
depthStencilBuffer
);
void
detachTexture
(
GLuint
texture
);
void
detachRenderbuffer
(
GLuint
renderbuffer
);
...
...
@@ -56,10 +57,12 @@ class Framebuffer
GLenum
getColorbufferType
(
unsigned
int
colorAttachment
)
const
;
GLenum
getDepthbufferType
()
const
;
GLenum
getStencilbufferType
()
const
;
GLenum
getDepthStencilbufferType
()
const
;
GLuint
getColorbufferHandle
(
unsigned
int
colorAttachment
)
const
;
GLuint
getDepthbufferHandle
()
const
;
GLuint
getStencilbufferHandle
()
const
;
GLenum
getDepthStencilbufferHandle
()
const
;
GLenum
getDrawBufferState
(
unsigned
int
colorAttachment
)
const
;
void
setDrawBufferState
(
unsigned
int
colorAttachment
,
GLenum
drawBuffer
);
...
...
src/libGLESv2/libGLESv2.cpp
View file @
55ba29c5
...
...
@@ -4170,6 +4170,12 @@ void __stdcall glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum t
case
GL_DEPTH_ATTACHMENT
:
case
GL_STENCIL_ATTACHMENT
:
break
;
case
GL_DEPTH_STENCIL_ATTACHMENT
:
if
(
context
->
getClientVersion
()
<
3
)
{
return
gl
::
error
(
GL_INVALID_ENUM
);
}
break
;
default
:
return
gl
::
error
(
GL_INVALID_ENUM
);
}
...
...
@@ -4266,8 +4272,9 @@ void __stdcall glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum t
{
switch
(
attachment
)
{
case
GL_DEPTH_ATTACHMENT
:
framebuffer
->
setDepthbuffer
(
textarget
,
texture
);
break
;
case
GL_STENCIL_ATTACHMENT
:
framebuffer
->
setStencilbuffer
(
textarget
,
texture
);
break
;
case
GL_DEPTH_ATTACHMENT
:
framebuffer
->
setDepthbuffer
(
textarget
,
texture
);
break
;
case
GL_STENCIL_ATTACHMENT
:
framebuffer
->
setStencilbuffer
(
textarget
,
texture
);
break
;
case
GL_DEPTH_STENCIL_ATTACHMENT
:
framebuffer
->
setDepthStencilBuffer
(
textarget
,
texture
);
break
;
}
}
}
...
...
@@ -5065,6 +5072,17 @@ void __stdcall glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attac
attachmentType
=
framebuffer
->
getStencilbufferType
();
attachmentHandle
=
framebuffer
->
getStencilbufferHandle
();
break
;
case
GL_DEPTH_STENCIL_ATTACHMENT
:
if
(
context
->
getClientVersion
()
<
3
)
{
return
gl
::
error
(
GL_INVALID_ENUM
);
}
if
(
framebuffer
->
getDepthbufferHandle
()
!=
framebuffer
->
getStencilbufferHandle
())
{
return
gl
::
error
(
GL_INVALID_OPERATION
);
}
attachmentType
=
framebuffer
->
getDepthStencilbufferType
();
attachmentHandle
=
framebuffer
->
getDepthStencilbufferHandle
();
default
:
return
gl
::
error
(
GL_INVALID_ENUM
);
}
}
...
...
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