Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
c343fb1c
Commit
c343fb1c
authored
Mar 30, 2007
by
Felix Nawothnig
Committed by
Alexandre Julliard
Apr 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make CreateCubeTexture fail when not supported.
parent
f73d7d07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
0 deletions
+59
-0
texture.c
dlls/d3d8/tests/texture.c
+27
-0
texture.c
dlls/d3d9/tests/texture.c
+27
-0
device.c
dlls/wined3d/device.c
+5
-0
No files found.
dlls/d3d8/tests/texture.c
View file @
c343fb1c
...
...
@@ -101,6 +101,32 @@ static void test_texture_stage_states(IDirect3DDevice8 *device_ptr, int num_stag
}
}
static
void
test_cube_texture_from_pool
(
IDirect3DDevice8
*
device_ptr
,
DWORD
caps
,
D3DPOOL
pool
,
BOOL
need_cap
)
{
IDirect3DCubeTexture8
*
texture_ptr
=
NULL
;
HRESULT
hr
;
hr
=
IDirect3DDevice8_CreateCubeTexture
(
device_ptr
,
512
,
1
,
0
,
D3DFMT_X8R8G8B8
,
pool
,
&
texture_ptr
);
trace
(
"pool=%d hr=0x%.8x
\n
"
,
pool
,
hr
);
if
((
caps
&
D3DPTEXTURECAPS_CUBEMAP
)
||
!
need_cap
)
ok
(
SUCCEEDED
(
hr
),
"hr=0x%.8x
\n
"
,
hr
);
else
ok
(
hr
==
D3DERR_INVALIDCALL
,
"hr=0x%.8x
\n
"
,
hr
);
if
(
texture_ptr
)
IDirect3DCubeTexture8_Release
(
texture_ptr
);
}
static
void
test_cube_textures
(
IDirect3DDevice8
*
device_ptr
,
DWORD
caps
)
{
trace
(
"texture caps: 0x%.8x
\n
"
,
caps
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_DEFAULT
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_MANAGED
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_SYSTEMMEM
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_SCRATCH
,
FALSE
);
}
START_TEST
(
texture
)
{
D3DCAPS8
caps
;
...
...
@@ -120,4 +146,5 @@ START_TEST(texture)
IDirect3DDevice8_GetDeviceCaps
(
device_ptr
,
&
caps
);
test_texture_stage_states
(
device_ptr
,
caps
.
MaxTextureBlendStages
);
test_cube_textures
(
device_ptr
,
caps
.
TextureCaps
);
}
dlls/d3d9/tests/texture.c
View file @
c343fb1c
...
...
@@ -100,6 +100,32 @@ static void test_texture_stage_states(IDirect3DDevice9 *device_ptr, int num_stag
}
}
static
void
test_cube_texture_from_pool
(
IDirect3DDevice9
*
device_ptr
,
DWORD
caps
,
D3DPOOL
pool
,
BOOL
need_cap
)
{
IDirect3DCubeTexture9
*
texture_ptr
=
NULL
;
HRESULT
hr
;
hr
=
IDirect3DDevice9_CreateCubeTexture
(
device_ptr
,
512
,
1
,
0
,
D3DFMT_X8R8G8B8
,
pool
,
&
texture_ptr
,
NULL
);
trace
(
"pool=%d hr=0x%.8x
\n
"
,
pool
,
hr
);
if
((
caps
&
D3DPTEXTURECAPS_CUBEMAP
)
||
!
need_cap
)
ok
(
SUCCEEDED
(
hr
),
"hr=0x%.8x
\n
"
,
hr
);
else
ok
(
hr
==
D3DERR_INVALIDCALL
,
"hr=0x%.8x
\n
"
,
hr
);
if
(
texture_ptr
)
IDirect3DCubeTexture9_Release
(
texture_ptr
);
}
static
void
test_cube_textures
(
IDirect3DDevice9
*
device_ptr
,
DWORD
caps
)
{
trace
(
"texture caps: 0x%.8x
\n
"
,
caps
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_DEFAULT
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_MANAGED
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_SYSTEMMEM
,
TRUE
);
test_cube_texture_from_pool
(
device_ptr
,
caps
,
D3DPOOL_SCRATCH
,
FALSE
);
}
START_TEST
(
texture
)
{
D3DCAPS9
caps
;
...
...
@@ -119,4 +145,5 @@ START_TEST(texture)
IDirect3DDevice9_GetDeviceCaps
(
device_ptr
,
&
caps
);
test_texture_stage_states
(
device_ptr
,
caps
.
MaxTextureBlendStages
);
test_cube_textures
(
device_ptr
,
caps
.
TextureCaps
);
}
dlls/wined3d/device.c
View file @
c343fb1c
...
...
@@ -999,6 +999,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface
return
WINED3DERR_INVALIDCALL
;
}
if
(
!
GL_SUPPORT
(
ARB_TEXTURE_CUBE_MAP
)
&&
Pool
!=
WINED3DPOOL_SCRATCH
)
{
WARN
(
"(%p) : Tried to create not supported cube texture
\n
"
,
This
);
return
WINED3DERR_INVALIDCALL
;
}
D3DCREATERESOURCEOBJECTINSTANCE
(
object
,
CubeTexture
,
WINED3DRTYPE_CUBETEXTURE
,
0
);
D3DINITIALIZEBASETEXTURE
(
object
->
baseTexture
);
...
...
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