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
b081cbaf
Commit
b081cbaf
authored
Jun 20, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Emulate tracking of multiple material properties.
parent
35ee1e96
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
2 deletions
+78
-2
drawprim.c
dlls/wined3d/drawprim.c
+55
-2
state.c
dlls/wined3d/state.c
+21
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/drawprim.c
View file @
b081cbaf
...
...
@@ -510,6 +510,19 @@ static void drawStridedSlow(IWineD3DDevice *iface, WineDirect3DVertexStridedData
D3DCOLOR_B_G
(
diffuseColor
),
D3DCOLOR_B_B
(
diffuseColor
),
D3DCOLOR_B_A
(
diffuseColor
)));
if
(
This
->
activeContext
->
num_untracked_materials
)
{
unsigned
char
i
;
float
color
[
4
];
color
[
0
]
=
D3DCOLOR_B_R
(
diffuseColor
)
/
255
.
0
;
color
[
1
]
=
D3DCOLOR_B_G
(
diffuseColor
)
/
255
.
0
;
color
[
2
]
=
D3DCOLOR_B_B
(
diffuseColor
)
/
255
.
0
;
color
[
3
]
=
D3DCOLOR_B_A
(
diffuseColor
)
/
255
.
0
;
for
(
i
=
0
;
i
<
This
->
activeContext
->
num_untracked_materials
;
i
++
)
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
This
->
activeContext
->
untracked_materials
[
i
],
color
);
}
}
}
/* Specular ------------------------------- */
...
...
@@ -1030,15 +1043,55 @@ void drawPrimitive(IWineD3DDevice *iface,
{
GLenum
glPrimType
;
BOOL
emulation
=
FALSE
;
WineDirect3DVertexStridedData
*
strided
=
&
This
->
strided_streams
;
WineDirect3DVertexStridedData
stridedlcl
;
/* Ok, Work out which primitive is requested and how many vertexes that
will be */
UINT
calculatedNumberOfindices
=
primitiveToGl
(
PrimitiveType
,
NumPrimitives
,
&
glPrimType
);
if
(
numberOfVertices
==
0
)
numberOfVertices
=
calculatedNumberOfindices
;
if
(
This
->
useDrawStridedSlow
)
{
if
(
!
This
->
strided_streams
.
u
.
s
.
position_transformed
&&
!
use_vs
(
This
))
{
if
(
This
->
activeContext
->
num_untracked_materials
&&
This
->
stateBlock
->
renderState
[
WINED3DRS_LIGHTING
])
{
IWineD3DVertexBufferImpl
*
vb
;
FIXME
(
"Using software emulation because not all material properties could be tracked
\n
"
);
emulation
=
TRUE
;
strided
=
&
stridedlcl
;
memcpy
(
&
stridedlcl
,
&
This
->
strided_streams
,
sizeof
(
stridedlcl
));
#define FIXVBO(type) \
if(stridedlcl.u.s.type.VBO) { \
vb = (IWineD3DVertexBufferImpl *) This->stateBlock->streamSource[stridedlcl.u.s.type.streamNo]; \
stridedlcl.u.s.type.VBO = 0; \
stridedlcl.u.s.type.lpData = (BYTE *) ((unsigned long) stridedlcl.u.s.type.lpData + (unsigned long) vb->resource.allocatedMemory); \
}
FIXVBO
(
position
);
FIXVBO
(
blendWeights
);
FIXVBO
(
blendMatrixIndices
);
FIXVBO
(
normal
);
FIXVBO
(
pSize
);
FIXVBO
(
diffuse
);
FIXVBO
(
specular
);
for
(
i
=
0
;
i
<
WINED3DDP_MAXTEXCOORD
;
i
++
)
FIXVBO
(
texCoords
[
i
]);
FIXVBO
(
position2
);
FIXVBO
(
normal2
);
FIXVBO
(
tangent
);
FIXVBO
(
binormal
);
FIXVBO
(
tessFactor
);
FIXVBO
(
fog
);
FIXVBO
(
depth
);
FIXVBO
(
sample
);
#undef FIXVBO
}
}
if
(
This
->
useDrawStridedSlow
||
emulation
)
{
/* Immediate mode drawing */
drawStridedSlow
(
iface
,
&
This
->
strided_streams
,
calculatedNumberOfindices
,
drawStridedSlow
(
iface
,
strided
,
calculatedNumberOfindices
,
glPrimType
,
idxData
,
idxSize
,
minIndex
,
StartIdx
,
StartVertexIndex
);
}
else
if
(
This
->
instancedDraw
)
{
/* Instancing emulation with mixing immediate mode and arrays */
...
...
dlls/wined3d/state.c
View file @
b081cbaf
...
...
@@ -980,6 +980,7 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
isDiffuseSupplied
=
diffuse
->
lpData
||
diffuse
->
VBO
;
context
->
num_untracked_materials
=
0
;
if
(
isDiffuseSupplied
&&
stateblock
->
renderState
[
WINED3DRS_COLORVERTEX
])
{
TRACE
(
"diff %d, amb %d, emis %d, spec %d
\n
"
,
stateblock
->
renderState
[
WINED3DRS_DIFFUSEMATERIALSOURCE
],
...
...
@@ -993,10 +994,30 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
}
else
{
Parm
=
GL_DIFFUSE
;
}
if
(
stateblock
->
renderState
[
WINED3DRS_EMISSIVEMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
context
->
untracked_materials
[
context
->
num_untracked_materials
]
=
GL_EMISSION
;
context
->
num_untracked_materials
++
;
}
if
(
stateblock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
context
->
untracked_materials
[
context
->
num_untracked_materials
]
=
GL_SPECULAR
;
context
->
num_untracked_materials
++
;
}
}
else
if
(
stateblock
->
renderState
[
WINED3DRS_AMBIENTMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
Parm
=
GL_AMBIENT
;
if
(
stateblock
->
renderState
[
WINED3DRS_EMISSIVEMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
context
->
untracked_materials
[
context
->
num_untracked_materials
]
=
GL_EMISSION
;
context
->
num_untracked_materials
++
;
}
if
(
stateblock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
context
->
untracked_materials
[
context
->
num_untracked_materials
]
=
GL_SPECULAR
;
context
->
num_untracked_materials
++
;
}
}
else
if
(
stateblock
->
renderState
[
WINED3DRS_EMISSIVEMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
Parm
=
GL_EMISSION
;
if
(
stateblock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
context
->
untracked_materials
[
context
->
num_untracked_materials
]
=
GL_SPECULAR
;
context
->
num_untracked_materials
++
;
}
}
else
if
(
stateblock
->
renderState
[
WINED3DRS_SPECULARMATERIALSOURCE
]
==
WINED3DMCS_COLOR1
)
{
Parm
=
GL_SPECULAR
;
}
...
...
dlls/wined3d/wined3d_private.h
View file @
b081cbaf
...
...
@@ -507,6 +507,8 @@ struct WineD3DContext {
BOOL
namedArraysLoaded
,
numberedArraysLoaded
;
BOOL
lastWasPow2Texture
[
MAX_TEXTURES
];
GLenum
tracking_parm
;
/* Which source is tracking current colour */
unsigned
char
num_untracked_materials
;
GLenum
untracked_materials
[
2
];
BOOL
last_was_blit
,
last_was_ckey
;
char
texShaderBumpMap
;
...
...
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