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
d6cb2443
Commit
d6cb2443
authored
Jul 10, 2013
by
Jamie Madill
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a client version parameter to several D3D11-specific texture format queries.
TRAC #23483 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent
9e33a112
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
49 deletions
+55
-49
Blit11.cpp
src/libGLESv2/renderer/Blit11.cpp
+2
-2
Image11.cpp
src/libGLESv2/renderer/Image11.cpp
+8
-8
Image11.h
src/libGLESv2/renderer/Image11.h
+1
-1
RenderTarget11.cpp
src/libGLESv2/renderer/RenderTarget11.cpp
+5
-5
Renderer11.cpp
src/libGLESv2/renderer/Renderer11.cpp
+9
-5
TextureStorage11.cpp
src/libGLESv2/renderer/TextureStorage11.cpp
+8
-6
formatutils11.cpp
src/libGLESv2/renderer/formatutils11.cpp
+15
-15
formatutils11.h
src/libGLESv2/renderer/formatutils11.h
+7
-7
No files found.
src/libGLESv2/renderer/Blit11.cpp
View file @
d6cb2443
...
@@ -228,7 +228,7 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source
...
@@ -228,7 +228,7 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source
// be GL_XXXX_INTEGER but it does not tell us if it is signed or unsigned.
// be GL_XXXX_INTEGER but it does not tell us if it is signed or unsigned.
D3D11_SHADER_RESOURCE_VIEW_DESC
sourceSRVDesc
;
D3D11_SHADER_RESOURCE_VIEW_DESC
sourceSRVDesc
;
source
->
GetDesc
(
&
sourceSRVDesc
);
source
->
GetDesc
(
&
sourceSRVDesc
);
GLint
sourceInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
sourceSRVDesc
.
Format
);
GLint
sourceInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
sourceSRVDesc
.
Format
,
mRenderer
->
getCurrentClientVersion
()
);
BlitParameters
parameters
=
{
0
};
BlitParameters
parameters
=
{
0
};
parameters
.
mDestinationFormat
=
destFormat
;
parameters
.
mDestinationFormat
=
destFormat
;
...
@@ -559,7 +559,7 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso
...
@@ -559,7 +559,7 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso
DXGI_FORMAT
format
=
getTextureFormat
(
source
);
DXGI_FORMAT
format
=
getTextureFormat
(
source
);
ASSERT
(
format
==
getTextureFormat
(
dest
));
ASSERT
(
format
==
getTextureFormat
(
dest
));
unsigned
int
pixelSize
=
d3d11
::
GetFormatPixelBytes
(
format
);
unsigned
int
pixelSize
=
d3d11
::
GetFormatPixelBytes
(
format
,
mRenderer
->
getCurrentClientVersion
()
);
unsigned
int
copyOffset
=
0
;
unsigned
int
copyOffset
=
0
;
unsigned
int
copySize
=
pixelSize
;
unsigned
int
copySize
=
pixelSize
;
if
(
stencilOnly
)
if
(
stencilOnly
)
...
...
src/libGLESv2/renderer/Image11.cpp
View file @
d6cb2443
...
@@ -43,13 +43,13 @@ Image11 *Image11::makeImage11(Image *img)
...
@@ -43,13 +43,13 @@ Image11 *Image11::makeImage11(Image *img)
return
static_cast
<
rx
::
Image11
*>
(
img
);
return
static_cast
<
rx
::
Image11
*>
(
img
);
}
}
void
Image11
::
generateMipmap
(
Image11
*
dest
,
Image11
*
src
)
void
Image11
::
generateMipmap
(
GLuint
clientVersion
,
Image11
*
dest
,
Image11
*
src
)
{
{
ASSERT
(
src
->
getDXGIFormat
()
==
dest
->
getDXGIFormat
());
ASSERT
(
src
->
getDXGIFormat
()
==
dest
->
getDXGIFormat
());
ASSERT
(
src
->
getWidth
()
==
1
||
src
->
getWidth
()
/
2
==
dest
->
getWidth
());
ASSERT
(
src
->
getWidth
()
==
1
||
src
->
getWidth
()
/
2
==
dest
->
getWidth
());
ASSERT
(
src
->
getHeight
()
==
1
||
src
->
getHeight
()
/
2
==
dest
->
getHeight
());
ASSERT
(
src
->
getHeight
()
==
1
||
src
->
getHeight
()
/
2
==
dest
->
getHeight
());
MipGenerationFunction
mipFunction
=
d3d11
::
GetMipGenerationFunction
(
src
->
getDXGIFormat
());
MipGenerationFunction
mipFunction
=
d3d11
::
GetMipGenerationFunction
(
src
->
getDXGIFormat
()
,
clientVersion
);
ASSERT
(
mipFunction
!=
NULL
);
ASSERT
(
mipFunction
!=
NULL
);
D3D11_MAPPED_SUBRESOURCE
destMapped
;
D3D11_MAPPED_SUBRESOURCE
destMapped
;
...
@@ -129,7 +129,7 @@ bool Image11::redefine(Renderer *renderer, GLenum target, GLint internalformat,
...
@@ -129,7 +129,7 @@ bool Image11::redefine(Renderer *renderer, GLenum target, GLint internalformat,
// compute the d3d format that will be used
// compute the d3d format that will be used
mDXGIFormat
=
gl_d3d11
::
GetTexFormat
(
internalformat
,
clientVersion
);
mDXGIFormat
=
gl_d3d11
::
GetTexFormat
(
internalformat
,
clientVersion
);
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
mDXGIFormat
);
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
mDXGIFormat
,
clientVersion
);
mRenderable
=
gl_d3d11
::
GetRTVFormat
(
internalformat
,
clientVersion
)
!=
DXGI_FORMAT_UNKNOWN
;
mRenderable
=
gl_d3d11
::
GetRTVFormat
(
internalformat
,
clientVersion
)
!=
DXGI_FORMAT_UNKNOWN
;
if
(
mStagingTexture
)
if
(
mStagingTexture
)
...
@@ -161,7 +161,7 @@ void Image11::loadData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei widt
...
@@ -161,7 +161,7 @@ void Image11::loadData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei widt
GLuint
clientVersion
=
mRenderer
->
getCurrentClientVersion
();
GLuint
clientVersion
=
mRenderer
->
getCurrentClientVersion
();
GLsizei
inputRowPitch
=
gl
::
GetRowPitch
(
mInternalFormat
,
type
,
clientVersion
,
width
,
unpackAlignment
);
GLsizei
inputRowPitch
=
gl
::
GetRowPitch
(
mInternalFormat
,
type
,
clientVersion
,
width
,
unpackAlignment
);
GLsizei
inputDepthPitch
=
gl
::
GetDepthPitch
(
mInternalFormat
,
type
,
clientVersion
,
width
,
height
,
unpackAlignment
);
GLsizei
inputDepthPitch
=
gl
::
GetDepthPitch
(
mInternalFormat
,
type
,
clientVersion
,
width
,
height
,
unpackAlignment
);
GLuint
outputPixelSize
=
d3d11
::
GetFormatPixelBytes
(
mDXGIFormat
);
GLuint
outputPixelSize
=
d3d11
::
GetFormatPixelBytes
(
mDXGIFormat
,
clientVersion
);
LoadImageFunction
loadFunction
=
d3d11
::
GetImageLoadFunction
(
mInternalFormat
,
type
,
clientVersion
);
LoadImageFunction
loadFunction
=
d3d11
::
GetImageLoadFunction
(
mInternalFormat
,
type
,
clientVersion
);
ASSERT
(
loadFunction
!=
NULL
);
ASSERT
(
loadFunction
!=
NULL
);
...
@@ -187,9 +187,9 @@ void Image11::loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GL
...
@@ -187,9 +187,9 @@ void Image11::loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GL
GLsizei
inputRowPitch
=
gl
::
GetRowPitch
(
mInternalFormat
,
GL_UNSIGNED_BYTE
,
clientVersion
,
width
,
1
);
GLsizei
inputRowPitch
=
gl
::
GetRowPitch
(
mInternalFormat
,
GL_UNSIGNED_BYTE
,
clientVersion
,
width
,
1
);
GLsizei
inputDepthPitch
=
gl
::
GetDepthPitch
(
mInternalFormat
,
GL_UNSIGNED_BYTE
,
clientVersion
,
width
,
height
,
1
);
GLsizei
inputDepthPitch
=
gl
::
GetDepthPitch
(
mInternalFormat
,
GL_UNSIGNED_BYTE
,
clientVersion
,
width
,
height
,
1
);
GLuint
outputPixelSize
=
d3d11
::
GetFormatPixelBytes
(
mDXGIFormat
);
GLuint
outputPixelSize
=
d3d11
::
GetFormatPixelBytes
(
mDXGIFormat
,
clientVersion
);
GLuint
outputBlockWidth
=
d3d11
::
GetBlockWidth
(
mDXGIFormat
);
GLuint
outputBlockWidth
=
d3d11
::
GetBlockWidth
(
mDXGIFormat
,
clientVersion
);
GLuint
outputBlockHeight
=
d3d11
::
GetBlockHeight
(
mDXGIFormat
);
GLuint
outputBlockHeight
=
d3d11
::
GetBlockHeight
(
mDXGIFormat
,
clientVersion
);
ASSERT
(
xoffset
%
outputBlockWidth
==
0
);
ASSERT
(
xoffset
%
outputBlockWidth
==
0
);
ASSERT
(
yoffset
%
outputBlockHeight
==
0
);
ASSERT
(
yoffset
%
outputBlockHeight
==
0
);
...
@@ -329,7 +329,7 @@ void Image11::createStagingTexture()
...
@@ -329,7 +329,7 @@ void Image11::createStagingTexture()
GLsizei
height
=
mHeight
;
GLsizei
height
=
mHeight
;
// adjust size if needed for compressed textures
// adjust size if needed for compressed textures
d3d11
::
MakeValidSize
(
false
,
dxgiFormat
,
&
width
,
&
height
,
&
lodOffset
);
d3d11
::
MakeValidSize
(
false
,
dxgiFormat
,
mRenderer
->
getCurrentClientVersion
(),
&
width
,
&
height
,
&
lodOffset
);
if
(
mTarget
==
GL_TEXTURE_3D
)
if
(
mTarget
==
GL_TEXTURE_3D
)
{
{
...
...
src/libGLESv2/renderer/Image11.h
View file @
d6cb2443
...
@@ -34,7 +34,7 @@ class Image11 : public Image
...
@@ -34,7 +34,7 @@ class Image11 : public Image
static
Image11
*
makeImage11
(
Image
*
img
);
static
Image11
*
makeImage11
(
Image
*
img
);
static
void
generateMipmap
(
Image11
*
dest
,
Image11
*
src
);
static
void
generateMipmap
(
GLuint
clientVersion
,
Image11
*
dest
,
Image11
*
src
);
virtual
bool
isDirty
()
const
;
virtual
bool
isDirty
()
const
;
...
...
src/libGLESv2/renderer/RenderTarget11.cpp
View file @
d6cb2443
...
@@ -202,8 +202,8 @@ RenderTarget11::RenderTarget11(Renderer *renderer, ID3D11RenderTargetView *rtv,
...
@@ -202,8 +202,8 @@ RenderTarget11::RenderTarget11(Renderer *renderer, ID3D11RenderTargetView *rtv,
mDepth
=
depth
;
mDepth
=
depth
;
mSamples
=
samples
;
mSamples
=
samples
;
mInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
);
mInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
,
renderer
->
getCurrentClientVersion
()
);
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
);
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
,
renderer
->
getCurrentClientVersion
()
);
}
}
}
}
...
@@ -231,8 +231,8 @@ RenderTarget11::RenderTarget11(Renderer *renderer, ID3D11DepthStencilView *dsv,
...
@@ -231,8 +231,8 @@ RenderTarget11::RenderTarget11(Renderer *renderer, ID3D11DepthStencilView *dsv,
mDepth
=
depth
;
mDepth
=
depth
;
mSamples
=
samples
;
mSamples
=
samples
;
mInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
);
mInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
,
renderer
->
getCurrentClientVersion
()
);
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
);
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
desc
.
Format
,
renderer
->
getCurrentClientVersion
()
);
}
}
}
}
...
@@ -351,7 +351,7 @@ RenderTarget11::RenderTarget11(Renderer *renderer, GLsizei width, GLsizei height
...
@@ -351,7 +351,7 @@ RenderTarget11::RenderTarget11(Renderer *renderer, GLsizei width, GLsizei height
mDepth
=
1
;
mDepth
=
1
;
mInternalFormat
=
internalFormat
;
mInternalFormat
=
internalFormat
;
mSamples
=
supportedSamples
;
mSamples
=
supportedSamples
;
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
texFormat
);
mActualFormat
=
d3d11_gl
::
GetInternalFormat
(
texFormat
,
renderer
->
getCurrentClientVersion
()
);
mSubresourceIndex
=
D3D11CalcSubresource
(
0
,
0
,
1
);
mSubresourceIndex
=
D3D11CalcSubresource
(
0
,
0
,
1
);
}
}
...
...
src/libGLESv2/renderer/Renderer11.cpp
View file @
d6cb2443
...
@@ -434,9 +434,13 @@ int Renderer11::generateConfigs(ConfigDesc **configDescList)
...
@@ -434,9 +434,13 @@ int Renderer11::generateConfigs(ConfigDesc **configDescList)
if
(
depthStencilFormatOK
)
if
(
depthStencilFormatOK
)
{
{
// FIXME: parse types from context version
ASSERT
(
d3d11_gl
::
GetInternalFormat
(
renderTargetFormat
,
2
)
==
d3d11_gl
::
GetInternalFormat
(
renderTargetFormat
,
3
));
ASSERT
(
d3d11_gl
::
GetInternalFormat
(
depthStencilFormat
,
2
)
==
d3d11_gl
::
GetInternalFormat
(
depthStencilFormat
,
3
));
ConfigDesc
newConfig
;
ConfigDesc
newConfig
;
newConfig
.
renderTargetFormat
=
d3d11_gl
::
GetInternalFormat
(
renderTargetFormat
);
newConfig
.
renderTargetFormat
=
d3d11_gl
::
GetInternalFormat
(
renderTargetFormat
,
getCurrentClientVersion
()
);
newConfig
.
depthStencilFormat
=
d3d11_gl
::
GetInternalFormat
(
depthStencilFormat
);
newConfig
.
depthStencilFormat
=
d3d11_gl
::
GetInternalFormat
(
depthStencilFormat
,
getCurrentClientVersion
()
);
newConfig
.
multiSample
=
0
;
// FIXME: enumerate multi-sampling
newConfig
.
multiSample
=
0
;
// FIXME: enumerate multi-sampling
newConfig
.
fastConfig
=
true
;
// Assume all DX11 format conversions to be fast
newConfig
.
fastConfig
=
true
;
// Assume all DX11 format conversions to be fast
newConfig
.
es3Capable
=
true
;
newConfig
.
es3Capable
=
true
;
...
@@ -3167,7 +3171,7 @@ void Renderer11::generateMipmap(Image *dest, Image *src)
...
@@ -3167,7 +3171,7 @@ void Renderer11::generateMipmap(Image *dest, Image *src)
{
{
Image11
*
dest11
=
Image11
::
makeImage11
(
dest
);
Image11
*
dest11
=
Image11
::
makeImage11
(
dest
);
Image11
*
src11
=
Image11
::
makeImage11
(
src
);
Image11
*
src11
=
Image11
::
makeImage11
(
src
);
Image11
::
generateMipmap
(
dest11
,
src11
);
Image11
::
generateMipmap
(
getCurrentClientVersion
(),
dest11
,
src11
);
}
}
TextureStorage
*
Renderer11
::
createTextureStorage2D
(
SwapChain
*
swapChain
)
TextureStorage
*
Renderer11
::
createTextureStorage2D
(
SwapChain
*
swapChain
)
...
@@ -3288,7 +3292,7 @@ void Renderer11::readTextureData(ID3D11Texture2D *texture, unsigned int subResou
...
@@ -3288,7 +3292,7 @@ void Renderer11::readTextureData(ID3D11Texture2D *texture, unsigned int subResou
GLuint
clientVersion
=
getCurrentClientVersion
();
GLuint
clientVersion
=
getCurrentClientVersion
();
GLint
sourceInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
textureDesc
.
Format
);
GLint
sourceInternalFormat
=
d3d11_gl
::
GetInternalFormat
(
textureDesc
.
Format
,
clientVersion
);
GLenum
sourceFormat
=
gl
::
GetFormat
(
sourceInternalFormat
,
clientVersion
);
GLenum
sourceFormat
=
gl
::
GetFormat
(
sourceInternalFormat
,
clientVersion
);
GLenum
sourceType
=
gl
::
GetType
(
sourceInternalFormat
,
clientVersion
);
GLenum
sourceType
=
gl
::
GetType
(
sourceInternalFormat
,
clientVersion
);
...
@@ -3325,7 +3329,7 @@ void Renderer11::readTextureData(ID3D11Texture2D *texture, unsigned int subResou
...
@@ -3325,7 +3329,7 @@ void Renderer11::readTextureData(ID3D11Texture2D *texture, unsigned int subResou
}
}
else
else
{
{
ColorReadFunction
readFunc
=
d3d11
::
GetColorReadFunction
(
textureDesc
.
Format
);
ColorReadFunction
readFunc
=
d3d11
::
GetColorReadFunction
(
textureDesc
.
Format
,
clientVersion
);
ColorWriteFunction
writeFunc
=
gl
::
GetColorWriteFunction
(
format
,
type
,
clientVersion
);
ColorWriteFunction
writeFunc
=
gl
::
GetColorWriteFunction
(
format
,
type
,
clientVersion
);
unsigned
char
temp
[
16
];
// Maximum size of any Color<T> type used.
unsigned
char
temp
[
16
];
// Maximum size of any Color<T> type used.
...
...
src/libGLESv2/renderer/TextureStorage11.cpp
View file @
d6cb2443
...
@@ -115,11 +115,13 @@ bool TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture, unsign
...
@@ -115,11 +115,13 @@ bool TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture, unsign
{
{
if
(
srcTexture
)
if
(
srcTexture
)
{
{
GLuint
clientVersion
=
mRenderer
->
getCurrentClientVersion
();
D3D11_BOX
srcBox
;
D3D11_BOX
srcBox
;
srcBox
.
left
=
xoffset
;
srcBox
.
left
=
xoffset
;
srcBox
.
top
=
yoffset
;
srcBox
.
top
=
yoffset
;
srcBox
.
right
=
xoffset
+
roundUp
((
unsigned
int
)
width
,
d3d11
::
GetBlockWidth
(
mTextureFormat
));
srcBox
.
right
=
xoffset
+
roundUp
((
unsigned
int
)
width
,
d3d11
::
GetBlockWidth
(
mTextureFormat
,
clientVersion
));
srcBox
.
bottom
=
yoffset
+
roundUp
((
unsigned
int
)
height
,
d3d11
::
GetBlockHeight
(
mTextureFormat
));
srcBox
.
bottom
=
yoffset
+
roundUp
((
unsigned
int
)
height
,
d3d11
::
GetBlockHeight
(
mTextureFormat
,
clientVersion
));
srcBox
.
front
=
zoffset
;
srcBox
.
front
=
zoffset
;
srcBox
.
back
=
zoffset
+
depth
;
srcBox
.
back
=
zoffset
+
depth
;
...
@@ -214,7 +216,7 @@ TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, int levels, GLenum
...
@@ -214,7 +216,7 @@ TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, int levels, GLenum
if
(
width
>
0
&&
height
>
0
)
if
(
width
>
0
&&
height
>
0
)
{
{
// adjust size if needed for compressed textures
// adjust size if needed for compressed textures
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
&
width
,
&
height
,
&
mLodOffset
);
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
clientVersion
,
&
width
,
&
height
,
&
mLodOffset
);
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
...
@@ -436,7 +438,7 @@ TextureStorage11_Cube::TextureStorage11_Cube(Renderer *renderer, int levels, GLe
...
@@ -436,7 +438,7 @@ TextureStorage11_Cube::TextureStorage11_Cube(Renderer *renderer, int levels, GLe
{
{
// adjust size if needed for compressed textures
// adjust size if needed for compressed textures
int
height
=
size
;
int
height
=
size
;
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
&
size
,
&
height
,
&
mLodOffset
);
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
clientVersion
,
&
size
,
&
height
,
&
mLodOffset
);
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
...
@@ -659,7 +661,7 @@ TextureStorage11_3D::TextureStorage11_3D(Renderer *renderer, int levels, GLenum
...
@@ -659,7 +661,7 @@ TextureStorage11_3D::TextureStorage11_3D(Renderer *renderer, int levels, GLenum
if
(
width
>
0
&&
height
>
0
&&
depth
>
0
)
if
(
width
>
0
&&
height
>
0
&&
depth
>
0
)
{
{
// adjust size if needed for compressed textures
// adjust size if needed for compressed textures
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
&
width
,
&
height
,
&
mLodOffset
);
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
clientVersion
,
&
width
,
&
height
,
&
mLodOffset
);
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
...
@@ -909,7 +911,7 @@ TextureStorage11_2DArray::TextureStorage11_2DArray(Renderer *renderer, int level
...
@@ -909,7 +911,7 @@ TextureStorage11_2DArray::TextureStorage11_2DArray(Renderer *renderer, int level
if
(
width
>
0
&&
height
>
0
&&
depth
>
0
)
if
(
width
>
0
&&
height
>
0
&&
depth
>
0
)
{
{
// adjust size if needed for compressed textures
// adjust size if needed for compressed textures
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
&
width
,
&
height
,
&
mLodOffset
);
d3d11
::
MakeValidSize
(
false
,
mTextureFormat
,
clientVersion
,
&
width
,
&
height
,
&
mLodOffset
);
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
ID3D11Device
*
device
=
mRenderer
->
getDevice
();
...
...
src/libGLESv2/renderer/formatutils11.cpp
View file @
d6cb2443
...
@@ -534,7 +534,7 @@ static const DXGIFormatInfoMap &GetDXGIFormatInfoMap()
...
@@ -534,7 +534,7 @@ static const DXGIFormatInfoMap &GetDXGIFormatInfoMap()
return
infoMap
;
return
infoMap
;
}
}
static
bool
GetDXGIFormatInfo
(
DXGI_FORMAT
format
,
DXGIFormatInfo
*
outFormatInfo
)
static
bool
GetDXGIFormatInfo
(
DXGI_FORMAT
format
,
GLuint
clientVersion
,
DXGIFormatInfo
*
outFormatInfo
)
{
{
const
DXGIFormatInfoMap
&
infoMap
=
GetDXGIFormatInfoMap
();
const
DXGIFormatInfoMap
&
infoMap
=
GetDXGIFormatInfoMap
();
DXGIFormatInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
format
);
DXGIFormatInfoMap
::
const_iterator
iter
=
infoMap
.
find
(
format
);
...
@@ -662,10 +662,10 @@ bool GetDepthStencilInfo(DXGI_FORMAT format, DXGIDepthStencilInfo *outDepthStenc
...
@@ -662,10 +662,10 @@ bool GetDepthStencilInfo(DXGI_FORMAT format, DXGIDepthStencilInfo *outDepthStenc
namespace
d3d11
namespace
d3d11
{
{
MipGenerationFunction
GetMipGenerationFunction
(
DXGI_FORMAT
format
)
MipGenerationFunction
GetMipGenerationFunction
(
DXGI_FORMAT
format
,
GLuint
clientVersion
)
{
{
DXGIFormatInfo
formatInfo
;
DXGIFormatInfo
formatInfo
;
if
(
GetDXGIFormatInfo
(
format
,
&
formatInfo
))
if
(
GetDXGIFormatInfo
(
format
,
clientVersion
,
&
formatInfo
))
{
{
return
formatInfo
.
mMipGenerationFunction
;
return
formatInfo
.
mMipGenerationFunction
;
}
}
...
@@ -712,10 +712,10 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint
...
@@ -712,10 +712,10 @@ LoadImageFunction GetImageLoadFunction(GLint internalFormat, GLenum type, GLuint
}
}
}
}
GLuint
GetFormatPixelBytes
(
DXGI_FORMAT
format
)
GLuint
GetFormatPixelBytes
(
DXGI_FORMAT
format
,
GLuint
clientVersion
)
{
{
DXGIFormatInfo
dxgiFormatInfo
;
DXGIFormatInfo
dxgiFormatInfo
;
if
(
GetDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
GetDXGIFormatInfo
(
format
,
clientVersion
,
&
dxgiFormatInfo
))
{
{
return
dxgiFormatInfo
.
mPixelBits
/
8
;
return
dxgiFormatInfo
.
mPixelBits
/
8
;
}
}
...
@@ -726,10 +726,10 @@ GLuint GetFormatPixelBytes(DXGI_FORMAT format)
...
@@ -726,10 +726,10 @@ GLuint GetFormatPixelBytes(DXGI_FORMAT format)
}
}
}
}
GLuint
GetBlockWidth
(
DXGI_FORMAT
format
)
GLuint
GetBlockWidth
(
DXGI_FORMAT
format
,
GLuint
clientVersion
)
{
{
DXGIFormatInfo
dxgiFormatInfo
;
DXGIFormatInfo
dxgiFormatInfo
;
if
(
GetDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
GetDXGIFormatInfo
(
format
,
clientVersion
,
&
dxgiFormatInfo
))
{
{
return
dxgiFormatInfo
.
mBlockWidth
;
return
dxgiFormatInfo
.
mBlockWidth
;
}
}
...
@@ -740,10 +740,10 @@ GLuint GetBlockWidth(DXGI_FORMAT format)
...
@@ -740,10 +740,10 @@ GLuint GetBlockWidth(DXGI_FORMAT format)
}
}
}
}
GLuint
GetBlockHeight
(
DXGI_FORMAT
format
)
GLuint
GetBlockHeight
(
DXGI_FORMAT
format
,
GLuint
clientVersion
)
{
{
DXGIFormatInfo
dxgiFormatInfo
;
DXGIFormatInfo
dxgiFormatInfo
;
if
(
GetDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
GetDXGIFormatInfo
(
format
,
clientVersion
,
&
dxgiFormatInfo
))
{
{
return
dxgiFormatInfo
.
mBlockHeight
;
return
dxgiFormatInfo
.
mBlockHeight
;
}
}
...
@@ -814,10 +814,10 @@ GLuint GetStencilOffset(DXGI_FORMAT format)
...
@@ -814,10 +814,10 @@ GLuint GetStencilOffset(DXGI_FORMAT format)
}
}
}
}
void
MakeValidSize
(
bool
isImage
,
DXGI_FORMAT
format
,
GLsizei
*
requestWidth
,
GLsizei
*
requestHeight
,
int
*
levelOffset
)
void
MakeValidSize
(
bool
isImage
,
DXGI_FORMAT
format
,
GL
uint
clientVersion
,
GL
sizei
*
requestWidth
,
GLsizei
*
requestHeight
,
int
*
levelOffset
)
{
{
DXGIFormatInfo
dxgiFormatInfo
;
DXGIFormatInfo
dxgiFormatInfo
;
if
(
GetDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
GetDXGIFormatInfo
(
format
,
clientVersion
,
&
dxgiFormatInfo
))
{
{
int
upsampleCount
=
0
;
int
upsampleCount
=
0
;
...
@@ -848,10 +848,10 @@ const DXGIFormatSet &GetAllUsedDXGIFormats()
...
@@ -848,10 +848,10 @@ const DXGIFormatSet &GetAllUsedDXGIFormats()
return
formatSet
;
return
formatSet
;
}
}
ColorReadFunction
GetColorReadFunction
(
DXGI_FORMAT
format
)
ColorReadFunction
GetColorReadFunction
(
DXGI_FORMAT
format
,
GLuint
clientVersion
)
{
{
DXGIFormatInfo
dxgiFormatInfo
;
DXGIFormatInfo
dxgiFormatInfo
;
if
(
GetDXGIFormatInfo
(
format
,
&
dxgiFormatInfo
))
if
(
GetDXGIFormatInfo
(
format
,
clientVersion
,
&
dxgiFormatInfo
))
{
{
return
dxgiFormatInfo
.
mColorReadFunction
;
return
dxgiFormatInfo
.
mColorReadFunction
;
}
}
...
@@ -1030,10 +1030,10 @@ DXGI_FORMAT GetRenderableFormat(GLint internalFormat, GLuint clientVersion)
...
@@ -1030,10 +1030,10 @@ DXGI_FORMAT GetRenderableFormat(GLint internalFormat, GLuint clientVersion)
namespace
d3d11_gl
namespace
d3d11_gl
{
{
GLint
GetInternalFormat
(
DXGI_FORMAT
format
)
GLint
GetInternalFormat
(
DXGI_FORMAT
format
,
GLuint
clientVersion
)
{
{
DXGIFormatInfo
formatInfo
;
DXGIFormatInfo
formatInfo
;
if
(
GetDXGIFormatInfo
(
format
,
&
formatInfo
))
if
(
GetDXGIFormatInfo
(
format
,
clientVersion
,
&
formatInfo
))
{
{
return
formatInfo
.
mInternalFormat
;
return
formatInfo
.
mInternalFormat
;
}
}
...
...
src/libGLESv2/renderer/formatutils11.h
View file @
d6cb2443
...
@@ -20,23 +20,23 @@ namespace d3d11
...
@@ -20,23 +20,23 @@ namespace d3d11
typedef
std
::
set
<
DXGI_FORMAT
>
DXGIFormatSet
;
typedef
std
::
set
<
DXGI_FORMAT
>
DXGIFormatSet
;
MipGenerationFunction
GetMipGenerationFunction
(
DXGI_FORMAT
format
);
MipGenerationFunction
GetMipGenerationFunction
(
DXGI_FORMAT
format
,
GLuint
clientVersion
);
LoadImageFunction
GetImageLoadFunction
(
GLint
internalFormat
,
GLenum
type
,
GLuint
clientVersion
);
LoadImageFunction
GetImageLoadFunction
(
GLint
internalFormat
,
GLenum
type
,
GLuint
clientVersion
);
GLuint
GetFormatPixelBytes
(
DXGI_FORMAT
format
);
GLuint
GetFormatPixelBytes
(
DXGI_FORMAT
format
,
GLuint
clientVersion
);
GLuint
GetBlockWidth
(
DXGI_FORMAT
format
);
GLuint
GetBlockWidth
(
DXGI_FORMAT
format
,
GLuint
clientVersion
);
GLuint
GetBlockHeight
(
DXGI_FORMAT
format
);
GLuint
GetBlockHeight
(
DXGI_FORMAT
format
,
GLuint
clientVersion
);
GLuint
GetDepthBits
(
DXGI_FORMAT
format
);
GLuint
GetDepthBits
(
DXGI_FORMAT
format
);
GLuint
GetDepthOffset
(
DXGI_FORMAT
format
);
GLuint
GetDepthOffset
(
DXGI_FORMAT
format
);
GLuint
GetStencilBits
(
DXGI_FORMAT
format
);
GLuint
GetStencilBits
(
DXGI_FORMAT
format
);
GLuint
GetStencilOffset
(
DXGI_FORMAT
format
);
GLuint
GetStencilOffset
(
DXGI_FORMAT
format
);
void
MakeValidSize
(
bool
isImage
,
DXGI_FORMAT
format
,
GLsizei
*
requestWidth
,
GLsizei
*
requestHeight
,
int
*
levelOffset
);
void
MakeValidSize
(
bool
isImage
,
DXGI_FORMAT
format
,
GL
uint
clientVersion
,
GL
sizei
*
requestWidth
,
GLsizei
*
requestHeight
,
int
*
levelOffset
);
const
DXGIFormatSet
&
GetAllUsedDXGIFormats
();
const
DXGIFormatSet
&
GetAllUsedDXGIFormats
();
ColorReadFunction
GetColorReadFunction
(
DXGI_FORMAT
format
);
ColorReadFunction
GetColorReadFunction
(
DXGI_FORMAT
format
,
GLuint
clientVersion
);
ColorCopyFunction
GetFastCopyFunction
(
DXGI_FORMAT
sourceFormat
,
GLenum
destFormat
,
GLenum
destType
,
GLuint
clientVersion
);
ColorCopyFunction
GetFastCopyFunction
(
DXGI_FORMAT
sourceFormat
,
GLenum
destFormat
,
GLenum
destType
,
GLuint
clientVersion
);
}
}
...
@@ -55,7 +55,7 @@ DXGI_FORMAT GetRenderableFormat(GLint internalFormat, GLuint clientVersion);
...
@@ -55,7 +55,7 @@ DXGI_FORMAT GetRenderableFormat(GLint internalFormat, GLuint clientVersion);
namespace
d3d11_gl
namespace
d3d11_gl
{
{
GLint
GetInternalFormat
(
DXGI_FORMAT
format
);
GLint
GetInternalFormat
(
DXGI_FORMAT
format
,
GLuint
clientVersion
);
}
}
...
...
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