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
219ca7c2
Commit
219ca7c2
authored
Aug 05, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Aug 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix D3DCOLOR swizzling in shaders.
parent
ef87a40c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
vertexshader.c
dlls/wined3d/vertexshader.c
+24
-6
No files found.
dlls/wined3d/vertexshader.c
View file @
219ca7c2
...
...
@@ -661,13 +661,31 @@ BOOL vshader_input_is_color(
IWineD3DVertexShaderImpl
*
This
=
(
IWineD3DVertexShaderImpl
*
)
iface
;
DWORD
usage_token
=
This
->
semantics_in
[
regnum
].
usage
;
DWORD
usage
=
(
usage_token
&
D3DSP_DCL_USAGE_MASK
)
>>
D3DSP_DCL_USAGE_SHIFT
;
DWORD
usage_idx
=
(
usage_token
&
D3DSP_DCL_USAGEINDEX_MASK
)
>>
D3DSP_DCL_USAGEINDEX_SHIFT
;
/* FIXME: D3D8 shader: the semantics token is not the way to
* determine color info, since it is just a fake map to shader inputs */
if
(
This
->
vertexDeclaration
!=
NULL
)
return
FALSE
;
else
return
usage
==
D3DDECLUSAGE_COLOR
;
IWineD3DVertexDeclarationImpl
*
vertexDeclaration
=
NULL
;
if
(
This
->
vertexDeclaration
)
{
/* D3D8 declaration */
vertexDeclaration
=
(
IWineD3DVertexDeclarationImpl
*
)
This
->
vertexDeclaration
;
}
else
{
/* D3D9 declaration */
vertexDeclaration
=
(
IWineD3DVertexDeclarationImpl
*
)((
IWineD3DDeviceImpl
*
)
This
->
wineD3DDevice
)
->
stateBlock
->
vertexDecl
;
}
if
(
vertexDeclaration
)
{
int
i
;
/* Find the declaration element that matches our register, then check
* if it has D3DCOLOR as it's type. This works for both d3d8 and d3d9. */
for
(
i
=
0
;
i
<
vertexDeclaration
->
declarationWNumElements
-
1
;
++
i
)
{
WINED3DVERTEXELEMENT
*
element
=
vertexDeclaration
->
pDeclarationWine
+
i
;
if
((
element
->
Usage
==
usage
&&
element
->
UsageIndex
==
usage_idx
))
{
return
element
->
Type
==
WINED3DDECLTYPE_D3DCOLOR
;
}
}
}
ERR
(
"Either no vertexdeclaration present, or register not matched. This should never happen.
\n
"
);
return
FALSE
;
}
/** Generate a vertex shader string using either GL_VERTEX_PROGRAM_ARB
...
...
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