Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
c2b6cbf0
Commit
c2b6cbf0
authored
Oct 26, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Refuse to create volumes and volume textures if not supported.
parent
45ebea1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
17 deletions
+24
-17
device.c
dlls/wined3d/device.c
+10
-0
volume.c
dlls/wined3d/volume.c
+14
-17
No files found.
dlls/wined3d/device.c
View file @
c2b6cbf0
...
...
@@ -952,6 +952,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
UINT
tmpH
;
UINT
tmpD
;
const
GlPixelFormatDesc
*
glDesc
;
getFormatDescEntry
(
Format
,
&
GLINFO_LOCATION
,
&
glDesc
);
/* TODO: It should only be possible to create textures for formats
...
...
@@ -960,6 +961,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
WARN
(
"(%p) : Texture cannot be created with a format of WINED3DFMT_UNKNOWN
\n
"
,
This
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
!
GL_SUPPORT
(
EXT_TEXTURE3D
))
{
WARN
(
"(%p) : Texture cannot be created - no volume texture support
\n
"
,
This
);
return
WINED3DERR_INVALIDCALL
;
}
D3DCREATERESOURCEOBJECTINSTANCE
(
object
,
VolumeTexture
,
WINED3DRTYPE_VOLUMETEXTURE
,
0
);
D3DINITIALIZEBASETEXTURE
(
object
->
baseTexture
);
...
...
@@ -1041,6 +1046,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolume(IWineD3DDevice *iface,
IWineD3DVolumeImpl
*
object
;
/** NOTE: impl ref allowed since this is a create function **/
const
StaticPixelFormatDesc
*
formatDesc
=
getFormatDescEntry
(
Format
,
NULL
,
NULL
);
if
(
!
GL_SUPPORT
(
EXT_TEXTURE3D
))
{
WARN
(
"(%p) : Volume cannot be created - no volume texture support
\n
"
,
This
);
return
WINED3DERR_INVALIDCALL
;
}
D3DCREATERESOURCEOBJECTINSTANCE
(
object
,
Volume
,
WINED3DRTYPE_VOLUME
,
((
Width
*
formatDesc
->
bpp
)
*
Height
*
Depth
))
TRACE
(
"(%p) : W(%d) H(%d) D(%d), Usage(%d), Fmt(%u,%s), Pool(%s)
\n
"
,
This
,
Width
,
Height
,
...
...
dlls/wined3d/volume.c
View file @
c2b6cbf0
...
...
@@ -270,9 +270,18 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int
TRACE
(
"(%p) : level %u, format %s (0x%08x)
\n
"
,
This
,
gl_level
,
debug_d3dformat
(
format
),
format
);
if
(
GL_SUPPORT
(
EXT_TEXTURE3D
))
{
TRACE
(
"Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p
\n
"
,
GL_TEXTURE_3D
,
TRACE
(
"Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p
\n
"
,
GL_TEXTURE_3D
,
gl_level
,
glDesc
->
glInternal
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
This
->
currentDesc
.
Depth
,
0
,
glDesc
->
glFormat
,
glDesc
->
glType
,
This
->
resource
.
allocatedMemory
);
GL_EXTCALL
(
glTexImage3DEXT
(
GL_TEXTURE_3D
,
gl_level
,
glDesc
->
glInternal
,
This
->
currentDesc
.
Width
,
...
...
@@ -281,20 +290,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int
0
,
glDesc
->
glFormat
,
glDesc
->
glType
,
This
->
resource
.
allocatedMemory
);
GL_EXTCALL
(
glTexImage3DEXT
(
GL_TEXTURE_3D
,
gl_level
,
glDesc
->
glInternal
,
This
->
currentDesc
.
Width
,
This
->
currentDesc
.
Height
,
This
->
currentDesc
.
Depth
,
0
,
glDesc
->
glFormat
,
glDesc
->
glType
,
This
->
resource
.
allocatedMemory
));
checkGLcall
(
"glTexImage3D"
);
}
else
WARN
(
"This OpenGL implementation doesn't support 3D textures
\n
"
);
This
->
resource
.
allocatedMemory
));
checkGLcall
(
"glTexImage3D"
);
/* When adding code releasing This->resource.allocatedMemory to save data keep in mind that
* GL_UNPACK_CLIENT_STORAGE_APPLE is enabled by default if supported(GL_APPLE_client_storage).
...
...
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