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
52f1e7ef
Commit
52f1e7ef
authored
Jul 08, 2013
by
Shannon Woods
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implements queriability for internal format sample counts.
TRAC #23273 Authored-by: Shannon Woods Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens
parent
dd4674f2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
107 additions
and
0 deletions
+107
-0
Context.cpp
src/libGLESv2/Context.cpp
+10
-0
Context.h
src/libGLESv2/Context.h
+2
-0
Renderer.h
src/libGLESv2/renderer/Renderer.h
+2
-0
Renderer11.cpp
src/libGLESv2/renderer/Renderer11.cpp
+49
-0
Renderer11.h
src/libGLESv2/renderer/Renderer11.h
+2
-0
Renderer9.cpp
src/libGLESv2/renderer/Renderer9.cpp
+40
-0
Renderer9.h
src/libGLESv2/renderer/Renderer9.h
+2
-0
No files found.
src/libGLESv2/Context.cpp
View file @
52f1e7ef
...
@@ -2550,6 +2550,16 @@ GLsizei Context::getMaxSupportedFormatSamples(GLint internalFormat) const
...
@@ -2550,6 +2550,16 @@ GLsizei Context::getMaxSupportedFormatSamples(GLint internalFormat) const
return
mRenderer
->
getMaxSupportedFormatSamples
(
internalFormat
);
return
mRenderer
->
getMaxSupportedFormatSamples
(
internalFormat
);
}
}
GLsizei
Context
::
getNumSampleCounts
(
GLint
internalFormat
)
const
{
return
mRenderer
->
getNumSampleCounts
(
internalFormat
);
}
void
Context
::
getSampleCounts
(
GLint
internalFormat
,
GLsizei
bufSize
,
GLint
*
params
)
const
{
mRenderer
->
getSampleCounts
(
internalFormat
,
bufSize
,
params
);
}
unsigned
int
Context
::
getMaxTransformFeedbackBufferBindings
()
const
unsigned
int
Context
::
getMaxTransformFeedbackBufferBindings
()
const
{
{
return
mRenderer
->
getMaxTransformFeedbackBuffers
();
return
mRenderer
->
getMaxTransformFeedbackBuffers
();
...
...
src/libGLESv2/Context.h
View file @
52f1e7ef
...
@@ -373,6 +373,8 @@ class Context
...
@@ -373,6 +373,8 @@ class Context
unsigned
int
getMaximumRenderTargets
()
const
;
unsigned
int
getMaximumRenderTargets
()
const
;
GLsizei
getMaxSupportedSamples
()
const
;
GLsizei
getMaxSupportedSamples
()
const
;
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
;
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
;
GLsizei
getNumSampleCounts
(
GLint
internalFormat
)
const
;
void
getSampleCounts
(
GLint
internalFormat
,
GLsizei
bufSize
,
GLint
*
params
)
const
;
unsigned
int
getMaxTransformFeedbackBufferBindings
()
const
;
unsigned
int
getMaxTransformFeedbackBufferBindings
()
const
;
GLintptr
getUniformBufferOffsetAlignment
()
const
;
GLintptr
getUniformBufferOffsetAlignment
()
const
;
const
char
*
getCombinedExtensionsString
()
const
;
const
char
*
getCombinedExtensionsString
()
const
;
...
...
src/libGLESv2/renderer/Renderer.h
View file @
52f1e7ef
...
@@ -204,6 +204,8 @@ class Renderer
...
@@ -204,6 +204,8 @@ class Renderer
virtual
GLsizei
getMaxSupportedSamples
()
const
=
0
;
virtual
GLsizei
getMaxSupportedSamples
()
const
=
0
;
virtual
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
=
0
;
virtual
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
=
0
;
virtual
GLsizei
getNumSampleCounts
(
GLint
internalFormat
)
const
=
0
;
virtual
void
getSampleCounts
(
GLint
internalFormat
,
GLsizei
bufSize
,
GLint
*
params
)
const
=
0
;
virtual
unsigned
int
getMaxRenderTargets
()
const
=
0
;
virtual
unsigned
int
getMaxRenderTargets
()
const
=
0
;
...
...
src/libGLESv2/renderer/Renderer11.cpp
View file @
52f1e7ef
...
@@ -2456,6 +2456,55 @@ GLsizei Renderer11::getMaxSupportedFormatSamples(GLint internalFormat) const
...
@@ -2456,6 +2456,55 @@ GLsizei Renderer11::getMaxSupportedFormatSamples(GLint internalFormat) const
return
(
iter
!=
mMultisampleSupportMap
.
end
())
?
iter
->
second
.
maxSupportedSamples
:
0
;
return
(
iter
!=
mMultisampleSupportMap
.
end
())
?
iter
->
second
.
maxSupportedSamples
:
0
;
}
}
GLsizei
Renderer11
::
getNumSampleCounts
(
GLint
internalFormat
)
const
{
unsigned
int
numCounts
=
0
;
// D3D11 supports multisampling for signed and unsigned format, but ES 3.0 does not
if
(
!
gl
::
IsIntegerFormat
(
internalFormat
,
getCurrentClientVersion
()))
{
DXGI_FORMAT
format
=
gl_d3d11
::
GetRenderableFormat
(
internalFormat
,
getCurrentClientVersion
());
MultisampleSupportMap
::
const_iterator
iter
=
mMultisampleSupportMap
.
find
(
format
);
if
(
iter
!=
mMultisampleSupportMap
.
end
())
{
const
MultisampleSupportInfo
&
info
=
iter
->
second
;
for
(
int
i
=
0
;
i
<
D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT
;
i
++
)
{
if
(
info
.
qualityLevels
[
i
]
>
0
)
{
numCounts
++
;
}
}
}
}
return
numCounts
;
}
void
Renderer11
::
getSampleCounts
(
GLint
internalFormat
,
GLsizei
bufSize
,
GLint
*
params
)
const
{
// D3D11 supports multisampling for signed and unsigned format, but ES 3.0 does not
if
(
gl
::
IsIntegerFormat
(
internalFormat
,
getCurrentClientVersion
()))
return
;
DXGI_FORMAT
format
=
gl_d3d11
::
GetRenderableFormat
(
internalFormat
,
getCurrentClientVersion
());
MultisampleSupportMap
::
const_iterator
iter
=
mMultisampleSupportMap
.
find
(
format
);
if
(
iter
!=
mMultisampleSupportMap
.
end
())
{
const
MultisampleSupportInfo
&
info
=
iter
->
second
;
int
bufPos
=
0
;
for
(
int
i
=
D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT
-
1
;
i
>=
0
&&
bufPos
<
bufSize
;
i
--
)
{
if
(
info
.
qualityLevels
[
i
]
>
0
)
{
params
[
bufPos
++
]
=
i
+
1
;
}
}
}
}
int
Renderer11
::
getNearestSupportedSamples
(
DXGI_FORMAT
format
,
unsigned
int
requested
)
const
int
Renderer11
::
getNearestSupportedSamples
(
DXGI_FORMAT
format
,
unsigned
int
requested
)
const
{
{
if
(
requested
==
0
)
if
(
requested
==
0
)
...
...
src/libGLESv2/renderer/Renderer11.h
View file @
52f1e7ef
...
@@ -146,6 +146,8 @@ class Renderer11 : public Renderer
...
@@ -146,6 +146,8 @@ class Renderer11 : public Renderer
virtual
GLsizei
getMaxSupportedSamples
()
const
;
virtual
GLsizei
getMaxSupportedSamples
()
const
;
virtual
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
;
virtual
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
;
virtual
GLsizei
getNumSampleCounts
(
GLint
internalFormat
)
const
;
virtual
void
getSampleCounts
(
GLint
internalFormat
,
GLsizei
bufSize
,
GLint
*
params
)
const
;
int
getNearestSupportedSamples
(
DXGI_FORMAT
format
,
unsigned
int
requested
)
const
;
int
getNearestSupportedSamples
(
DXGI_FORMAT
format
,
unsigned
int
requested
)
const
;
virtual
unsigned
int
getMaxRenderTargets
()
const
;
virtual
unsigned
int
getMaxRenderTargets
()
const
;
...
...
src/libGLESv2/renderer/Renderer9.cpp
View file @
52f1e7ef
...
@@ -2455,6 +2455,46 @@ GLsizei Renderer9::getMaxSupportedFormatSamples(GLint internalFormat) const
...
@@ -2455,6 +2455,46 @@ GLsizei Renderer9::getMaxSupportedFormatSamples(GLint internalFormat) const
return
(
itr
!=
mMultiSampleSupport
.
end
())
?
mMaxSupportedSamples
:
0
;
return
(
itr
!=
mMultiSampleSupport
.
end
())
?
mMaxSupportedSamples
:
0
;
}
}
GLsizei
Renderer9
::
getNumSampleCounts
(
GLint
internalFormat
)
const
{
D3DFORMAT
format
=
gl_d3d9
::
GetTextureFormat
(
internalFormat
,
this
);
MultisampleSupportMap
::
const_iterator
iter
=
mMultiSampleSupport
.
find
(
format
);
unsigned
int
numCounts
=
0
;
if
(
iter
!=
mMultiSampleSupport
.
end
())
{
const
MultisampleSupportInfo
&
info
=
iter
->
second
;
for
(
int
i
=
0
;
i
<
D3DMULTISAMPLE_16_SAMPLES
;
i
++
)
{
if
(
i
!=
D3DMULTISAMPLE_NONMASKABLE
&&
info
.
supportedSamples
[
i
])
{
numCounts
++
;
}
}
}
return
numCounts
;
}
void
Renderer9
::
getSampleCounts
(
GLint
internalFormat
,
GLsizei
bufSize
,
GLint
*
params
)
const
{
D3DFORMAT
format
=
gl_d3d9
::
GetTextureFormat
(
internalFormat
,
this
);
MultisampleSupportMap
::
const_iterator
iter
=
mMultiSampleSupport
.
find
(
format
);
if
(
iter
!=
mMultiSampleSupport
.
end
())
{
const
MultisampleSupportInfo
&
info
=
iter
->
second
;
int
bufPos
=
0
;
for
(
int
i
=
D3DMULTISAMPLE_16_SAMPLES
;
i
>=
0
&&
bufPos
<
bufSize
;
i
--
)
{
if
(
i
!=
D3DMULTISAMPLE_NONMASKABLE
&&
info
.
supportedSamples
[
i
])
{
params
[
bufPos
++
]
=
i
;
}
}
}
}
int
Renderer9
::
getNearestSupportedSamples
(
D3DFORMAT
format
,
int
requested
)
const
int
Renderer9
::
getNearestSupportedSamples
(
D3DFORMAT
format
,
int
requested
)
const
{
{
if
(
requested
==
0
)
if
(
requested
==
0
)
...
...
src/libGLESv2/renderer/Renderer9.h
View file @
52f1e7ef
...
@@ -162,6 +162,8 @@ class Renderer9 : public Renderer
...
@@ -162,6 +162,8 @@ class Renderer9 : public Renderer
virtual
GLsizei
getMaxSupportedSamples
()
const
;
virtual
GLsizei
getMaxSupportedSamples
()
const
;
virtual
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
;
virtual
GLsizei
getMaxSupportedFormatSamples
(
GLint
internalFormat
)
const
;
virtual
GLsizei
getNumSampleCounts
(
GLint
internalFormat
)
const
;
virtual
void
getSampleCounts
(
GLint
internalFormat
,
GLsizei
bufSize
,
GLint
*
params
)
const
;
int
getNearestSupportedSamples
(
D3DFORMAT
format
,
int
requested
)
const
;
int
getNearestSupportedSamples
(
D3DFORMAT
format
,
int
requested
)
const
;
virtual
unsigned
int
getMaxRenderTargets
()
const
;
virtual
unsigned
int
getMaxRenderTargets
()
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