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
545dc012
Commit
545dc012
authored
Oct 01, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Pass a wined3d_state structure to nvts_activate_dimensions().
parent
4dcd56f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
23 deletions
+24
-23
nvidia_texture_shader.c
dlls/wined3d/nvidia_texture_shader.c
+24
-23
No files found.
dlls/wined3d/nvidia_texture_shader.c
View file @
545dc012
...
...
@@ -30,12 +30,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
/* GL locking for state handlers is done by the caller. */
static
void
nvts_activate_dimensions
(
DWORD
stage
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
nvts_activate_dimensions
(
const
struct
wined3d_state
*
state
,
DWORD
stage
,
struct
wined3d_context
*
context
)
{
BOOL
bumpmap
=
FALSE
;
if
(
stage
>
0
&&
(
state
block
->
state
.
texture_states
[
stage
-
1
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAPLUMINANCE
||
state
block
->
state
.
texture_states
[
stage
-
1
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAP
))
if
(
stage
>
0
&&
(
state
->
texture_states
[
stage
-
1
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAPLUMINANCE
||
state
->
texture_states
[
stage
-
1
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAP
))
{
bumpmap
=
TRUE
;
context
->
texShaderBumpMap
|=
(
1
<<
stage
);
...
...
@@ -43,9 +43,9 @@ static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateb
context
->
texShaderBumpMap
&=
~
(
1
<<
stage
);
}
if
(
state
block
->
state
.
textures
[
stage
])
if
(
state
->
textures
[
stage
])
{
switch
(
state
block
->
state
.
textures
[
stage
]
->
baseTexture
.
target
)
switch
(
state
->
textures
[
stage
]
->
baseTexture
.
target
)
{
case
GL_TEXTURE_2D
:
glTexEnvi
(
GL_TEXTURE_SHADER_NV
,
GL_SHADER_OPERATION_NV
,
bumpmap
?
GL_OFFSET_TEXTURE_2D_NV
:
GL_TEXTURE_2D
);
...
...
@@ -482,16 +482,16 @@ static void nvrc_colorop(DWORD state_id, IWineD3DStateBlockImpl *stateblock, str
checkGLcall
(
"glActiveTextureARB"
);
}
if
(
state
block
->
state
.
lowest_disabled_stage
>
0
)
if
(
state
->
lowest_disabled_stage
>
0
)
{
glEnable
(
GL_REGISTER_COMBINERS_NV
);
GL_EXTCALL
(
glCombinerParameteriNV
(
GL_NUM_GENERAL_COMBINERS_NV
,
state
block
->
state
.
lowest_disabled_stage
));
GL_EXTCALL
(
glCombinerParameteriNV
(
GL_NUM_GENERAL_COMBINERS_NV
,
state
->
lowest_disabled_stage
));
}
else
{
glDisable
(
GL_REGISTER_COMBINERS_NV
);
}
if
(
stage
>=
state
block
->
state
.
lowest_disabled_stage
)
if
(
stage
>=
state
->
lowest_disabled_stage
)
{
TRACE
(
"Stage disabled
\n
"
);
if
(
mapped_stage
!=
WINED3D_UNMAPPED_STAGE
)
...
...
@@ -529,57 +529,58 @@ static void nvrc_colorop(DWORD state_id, IWineD3DStateBlockImpl *stateblock, str
{
if
(
gl_info
->
supported
[
NV_TEXTURE_SHADER2
])
{
nvts_activate_dimensions
(
sta
ge
,
stateblock
,
context
);
nvts_activate_dimensions
(
sta
te
,
stage
,
context
);
}
else
{
texture_activate_dimensions
(
state
block
->
state
.
textures
[
stage
],
gl_info
);
texture_activate_dimensions
(
state
->
textures
[
stage
],
gl_info
);
}
}
}
/* Set the texture combiners */
set_tex_op_nvrc
(
gl_info
,
&
stateblock
->
state
,
FALSE
,
stage
,
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_COLOROP
],
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_COLORARG1
],
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_COLORARG2
],
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_COLORARG0
],
set_tex_op_nvrc
(
gl_info
,
state
,
FALSE
,
stage
,
state
->
texture_states
[
stage
][
WINED3DTSS_COLOROP
],
state
->
texture_states
[
stage
][
WINED3DTSS_COLORARG1
],
state
->
texture_states
[
stage
][
WINED3DTSS_COLORARG2
],
state
->
texture_states
[
stage
][
WINED3DTSS_COLORARG0
],
mapped_stage
,
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_RESULTARG
]);
state
->
texture_states
[
stage
][
WINED3DTSS_RESULTARG
]);
/* In register combiners bump mapping is done in the stage AFTER the one that has the bump map operation set,
* thus the texture shader may have to be updated
*/
if
(
gl_info
->
supported
[
NV_TEXTURE_SHADER2
])
{
BOOL
usesBump
=
(
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAPLUMINANCE
||
state
block
->
state
.
texture_states
[
stage
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAP
);
BOOL
usesBump
=
(
state
->
texture_states
[
stage
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAPLUMINANCE
||
state
->
texture_states
[
stage
][
WINED3DTSS_COLOROP
]
==
WINED3DTOP_BUMPENVMAP
);
BOOL
usedBump
=
!!
(
context
->
texShaderBumpMap
&
1
<<
(
stage
+
1
));
if
(
usesBump
!=
usedBump
)
{
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
mapped_stage
+
1
));
checkGLcall
(
"glActiveTextureARB"
);
nvts_activate_dimensions
(
sta
ge
+
1
,
stateblock
,
context
);
nvts_activate_dimensions
(
sta
te
,
stage
+
1
,
context
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
+
mapped_stage
));
checkGLcall
(
"glActiveTextureARB"
);
}
}
}
static
void
nvts_texdim
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
static
void
nvts_texdim
(
DWORD
state
_id
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
DWORD
sampler
=
state
-
STATE_SAMPLER
(
0
);
DWORD
sampler
=
state
_id
-
STATE_SAMPLER
(
0
);
DWORD
mapped_stage
=
stateblock
->
device
->
texUnitMap
[
sampler
];
const
struct
wined3d_state
*
state
=
&
stateblock
->
state
;
/* No need to enable / disable anything here for unused samplers. The tex_colorop
* handler takes care. Also no action is needed with pixel shaders, or if tex_colorop
* will take care of this business
*/
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
||
mapped_stage
>=
context
->
gl_info
->
limits
.
textures
)
return
;
if
(
sampler
>=
state
block
->
state
.
lowest_disabled_stage
)
return
;
if
(
sampler
>=
state
->
lowest_disabled_stage
)
return
;
if
(
isStateDirty
(
context
,
STATE_TEXTURESTAGE
(
sampler
,
WINED3DTSS_COLOROP
)))
return
;
nvts_activate_dimensions
(
s
ampler
,
stateblock
,
context
);
nvts_activate_dimensions
(
s
tate
,
sampler
,
context
);
}
static
void
nvts_bumpenvmat
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
...
...
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