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
28170f04
Commit
28170f04
authored
May 04, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement environment bump mapping with GL_ATI_envmap_bumpmap.
parent
99283401
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
116 additions
and
9 deletions
+116
-9
device.c
dlls/ddraw/device.c
+37
-0
directx.c
dlls/wined3d/directx.c
+22
-5
state.c
dlls/wined3d/state.c
+13
-0
utils.c
dlls/wined3d/utils.c
+40
-0
wined3d_gl.h
include/wine/wined3d_gl.h
+4
-4
No files found.
dlls/ddraw/device.c
View file @
28170f04
...
...
@@ -1119,6 +1119,16 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
WINED3DFMT_DXT5
,
};
WINED3DFORMAT
BumpFormatList
[]
=
{
WINED3DFMT_V8U8
,
WINED3DFMT_L6V5U5
,
WINED3DFMT_X8L8V8U8
,
WINED3DFMT_Q8W8V8U8
,
WINED3DFMT_V16U16
,
WINED3DFMT_W11V11U10
,
WINED3DFMT_A2W10V10U10
};
TRACE
(
"(%p)->(%p,%p): Relay
\n
"
,
This
,
Callback
,
Arg
);
if
(
!
Callback
)
...
...
@@ -1150,6 +1160,33 @@ IDirect3DDeviceImpl_7_EnumTextureFormats(IDirect3DDevice7 *iface,
}
}
}
for
(
i
=
0
;
i
<
sizeof
(
BumpFormatList
)
/
sizeof
(
WINED3DFORMAT
);
i
++
)
{
hr
=
IWineD3D_CheckDeviceFormat
(
This
->
ddraw
->
wineD3D
,
0
/* Adapter */
,
0
/* DeviceType */
,
0
/* AdapterFormat */
,
WINED3DUSAGE_QUERY_LEGACYBUMPMAP
,
0
/* ResourceType */
,
BumpFormatList
[
i
]);
if
(
hr
==
D3D_OK
)
{
DDPIXELFORMAT
pformat
;
memset
(
&
pformat
,
0
,
sizeof
(
pformat
));
pformat
.
dwSize
=
sizeof
(
pformat
);
PixelFormat_WineD3DtoDD
(
&
pformat
,
BumpFormatList
[
i
]);
TRACE
(
"Enumerating WineD3DFormat %d
\n
"
,
BumpFormatList
[
i
]);
hr
=
Callback
(
&
pformat
,
Arg
);
if
(
hr
!=
DDENUMRET_OK
)
{
TRACE
(
"Format enumeration cancelled by application
\n
"
);
return
D3D_OK
;
}
}
}
TRACE
(
"End of enumeration
\n
"
);
return
D3D_OK
;
}
...
...
dlls/wined3d/directx.c
View file @
28170f04
...
...
@@ -1679,6 +1679,20 @@ static HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapt
TRACE_
(
d3d_caps
)(
"[FAILED]
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
}
else
if
(
Usage
&
WINED3DUSAGE_QUERY_LEGACYBUMPMAP
)
{
if
(
GL_SUPPORT
(
ATI_ENVMAP_BUMPMAP
))
{
switch
(
CheckFormat
)
{
case
WINED3DFMT_V8U8
:
TRACE_
(
d3d_caps
)(
"[OK]
\n
"
);
return
WINED3D_OK
;
default:
TRACE_
(
d3d_caps
)(
"[FAILED]
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
/* TODO: GL_NV_TEXTURE_SHADER */
}
TRACE_
(
d3d_caps
)(
"[FAILED]
\n
"
);
return
WINED3DERR_NOTAVAILABLE
;
}
if
(
GL_SUPPORT
(
EXT_TEXTURE_COMPRESSION_S3TC
))
{
...
...
@@ -2209,12 +2223,15 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
WINED3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA
;
}
if
(
GL_SUPPORT
(
ATI_ENVMAP_BUMPMAP
))
{
*
pCaps
->
TextureOpCaps
|=
WINED3DTEXOPCAPS_BUMPENVMAP
;
}
else
if
(
GL_SUPPORT
(
NV_TEXTURE_SHADER
))
{
/* TODO: environment bump mapping support with GL_NV_texture_shader */
}
#if 0
*pCaps->TextureOpCaps |= WINED3DTEXOPCAPS_BUMPENVMAP;
/* FIXME: Add
WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
WINED3DTEXOPCAPS_PREMODULATE */
/* FIXME: Add
*pCaps->TextureOpCaps |= WINED3DTEXOPCAPS_BUMPENVMAPLUMINANCE
WINED3DTEXOPCAPS_PREMODULATE */
#endif
*
pCaps
->
MaxTextureBlendStages
=
GL_LIMITS
(
texture_stages
);
...
...
dlls/wined3d/state.c
View file @
28170f04
...
...
@@ -2164,6 +2164,19 @@ static void tex_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
shaderconstant
(
STATE_PIXELSHADERCONSTANT
,
stateblock
,
context
);
}
}
if
(
GL_SUPPORT
(
ATI_ENVMAP_BUMPMAP
))
{
if
(
stage
>=
GL_LIMITS
(
texture_stages
))
{
WARN
(
"Bump env matrix of unsupported stage set
\n
"
);
}
else
if
(
GL_SUPPORT
(
ARB_MULTITEXTURE
))
{
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
stage
));
checkGLcall
(
"GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + stage))"
);
}
GL_EXTCALL
(
glTexBumpParameterfvATI
(
GL_BUMP_ROT_MATRIX_ATI
,
(
float
*
)
&
(
stateblock
->
textureState
[
stage
][
WINED3DTSS_BUMPENVMAT00
])));
checkGLcall
(
"glTexBumpParameterfvATI"
);
}
/* TODO: GL_NV_texture_shader */
}
static
void
transform_world
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
WineD3DContext
*
context
)
{
...
...
dlls/wined3d/utils.c
View file @
28170f04
...
...
@@ -2168,6 +2168,46 @@ void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTEXTUREOP
}
else
Handled
=
FALSE
;
break
;
case
WINED3DTOP_BUMPENVMAPLUMINANCE
:
if
(
GL_SUPPORT
(
ATI_ENVMAP_BUMPMAP
))
{
/* Some apps use BUMPENVMAPLUMINANCE instead of D3DTOP_BUMPENVMAP, although
* they check for the non-luminance cap flag. Well, give them what they asked
* for :-)
*/
WARN
(
"Application uses WINED3DTOP_BUMPENVMAPLUMINANCE
\n
"
);
}
else
{
Handled
=
FALSE
;
break
;
}
/* Fall through */
case
WINED3DTOP_BUMPENVMAP
:
if
(
GL_SUPPORT
(
ATI_ENVMAP_BUMPMAP
))
{
TRACE
(
"Using ati bumpmap on stage %d, target %d
\n
"
,
Stage
,
Stage
+
1
);
glTexEnvi
(
GL_TEXTURE_ENV
,
comb_target
,
GL_BUMP_ENVMAP_ATI
);
checkGLcall
(
"glTexEnvi(GL_TEXTURE_ENV, comb_target, GL_BUMP_ENVMAP_ATI)"
);
glTexEnvi
(
GL_TEXTURE_ENV
,
GL_BUMP_TARGET_ATI
,
GL_TEXTURE0_ARB
+
Stage
+
1
);
checkGLcall
(
"glTexEnvi(GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0_ARB + Stage + 1)"
);
glTexEnvi
(
GL_TEXTURE_ENV
,
src0_target
,
src3
);
checkGLcall
(
"GL_TEXTURE_ENV, src0_target, src3"
);
glTexEnvi
(
GL_TEXTURE_ENV
,
opr0_target
,
opr3
);
checkGLcall
(
"GL_TEXTURE_ENV, opr0_target, opr3"
);
glTexEnvi
(
GL_TEXTURE_ENV
,
src1_target
,
src1
);
checkGLcall
(
"GL_TEXTURE_ENV, src0_target, src1"
);
glTexEnvi
(
GL_TEXTURE_ENV
,
opr1_target
,
opr1
);
checkGLcall
(
"GL_TEXTURE_ENV, opr1_target, opr1"
);
glTexEnvi
(
GL_TEXTURE_ENV
,
src2_target
,
src2
);
checkGLcall
(
"GL_TEXTURE_ENV, src0_target, src1"
);
glTexEnvi
(
GL_TEXTURE_ENV
,
opr2_target
,
opr2
);
checkGLcall
(
"GL_TEXTURE_ENV, opr2_target, opr2"
);
Handled
=
TRUE
;
}
else
{
/* If GL_NV_TEXTURE_SHADER is supported insted the GL_NV_register_combiner path
* will be taken instead
*/
Handled
=
FALSE
;
}
break
;
default:
Handled
=
FALSE
;
}
...
...
include/wine/wined3d_gl.h
View file @
28170f04
...
...
@@ -1192,10 +1192,10 @@ typedef void (APIENTRY * PGLFNFINISHOBJECTAPPLEPROC) (GLenum, GLuint);
#define GL_BUMP_ENVMAP_ATI 0x877B
#define GL_BUMP_TARGET_ATI 0x877C
#endif
typedef
void
(
APIENTRY
*
PGLFNTEXBUMPPARAMETERIVATIPROC
)
(
GLenum
,
GL
uint
);
typedef
void
(
APIENTRY
*
PGLFNTEXBUMPPARAMETERFVATIPROC
)
(
GLenum
,
GL
uint
);
typedef
void
(
APIENTRY
*
PGLFNGETTEXBUMPPARAMETERIVATIPROC
)
(
GLenum
,
GL
uint
);
typedef
void
(
APIENTRY
*
PGLFNGETTEXBUMPPARAMETERFVATIPROC
)
(
GLenum
,
GL
uint
);
typedef
void
(
APIENTRY
*
PGLFNTEXBUMPPARAMETERIVATIPROC
)
(
GLenum
,
GL
int
*
);
typedef
void
(
APIENTRY
*
PGLFNTEXBUMPPARAMETERFVATIPROC
)
(
GLenum
,
GL
float
*
);
typedef
void
(
APIENTRY
*
PGLFNGETTEXBUMPPARAMETERIVATIPROC
)
(
GLenum
,
GL
int
*
);
typedef
void
(
APIENTRY
*
PGLFNGETTEXBUMPPARAMETERFVATIPROC
)
(
GLenum
,
GL
float
*
);
/* GL_VERSION_2_0 */
#ifndef GL_VERSION_2_0
...
...
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