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
36884639
Commit
36884639
authored
May 31, 2012
by
daniel@transgaming.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor texture usage logic to helper function
Trac #20875 Signed-off-by: Nicolas Capens git-svn-id:
https://angleproject.googlecode.com/svn/trunk@1107
736b8ea6-26fd-11df-bfd4-992fa37f6226
parent
1d2d3c46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
Texture.cpp
src/libGLESv2/Texture.cpp
+15
-2
No files found.
src/libGLESv2/Texture.cpp
View file @
36884639
...
...
@@ -95,6 +95,17 @@ static bool IsTextureFormatRenderable(D3DFORMAT format)
return
false
;
}
static
inline
DWORD
GetTextureUsage
(
bool
rendertarget
,
D3DFORMAT
fmt
)
{
DWORD
usage
=
0
;
if
(
rendertarget
)
{
usage
|=
D3DUSAGE_RENDERTARGET
;
}
return
usage
;
}
Image
::
Image
()
{
mWidth
=
0
;
...
...
@@ -1677,7 +1688,8 @@ TextureStorage2D::TextureStorage2D(int levels, D3DFORMAT format, int width, int
if
(
width
>
0
&&
height
>
0
)
{
IDirect3DDevice9
*
device
=
getDevice
();
HRESULT
result
=
device
->
CreateTexture
(
width
,
height
,
levels
,
isRenderTarget
()
?
D3DUSAGE_RENDERTARGET
:
0
,
format
,
getPool
(),
&
mTexture
,
NULL
);
DWORD
usage
=
GetTextureUsage
(
isRenderTarget
(),
format
);
HRESULT
result
=
device
->
CreateTexture
(
width
,
height
,
levels
,
usage
,
format
,
getPool
(),
&
mTexture
,
NULL
);
if
(
FAILED
(
result
))
{
...
...
@@ -2368,7 +2380,8 @@ TextureStorageCubeMap::TextureStorageCubeMap(int levels, D3DFORMAT format, int s
if
(
size
>
0
)
{
IDirect3DDevice9
*
device
=
getDevice
();
HRESULT
result
=
device
->
CreateCubeTexture
(
size
,
levels
,
isRenderTarget
()
?
D3DUSAGE_RENDERTARGET
:
0
,
format
,
getPool
(),
&
mTexture
,
NULL
);
DWORD
usage
=
GetTextureUsage
(
isRenderTarget
(),
format
);
HRESULT
result
=
device
->
CreateCubeTexture
(
size
,
levels
,
usage
,
format
,
getPool
(),
&
mTexture
,
NULL
);
if
(
FAILED
(
result
))
{
...
...
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