Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
899c8cdb
Commit
899c8cdb
authored
Jul 07, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
Jul 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Create fake input semantics for d3d8 shaders.
Use them to remove the need for loading arrays in two different places.
parent
5b3c500e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
13 deletions
+38
-13
drawprim.c
dlls/wined3d/drawprim.c
+0
-13
vertexshader.c
dlls/wined3d/vertexshader.c
+38
-0
No files found.
dlls/wined3d/drawprim.c
View file @
899c8cdb
...
@@ -451,19 +451,6 @@ void primitiveDeclarationConvertToStridedData(
...
@@ -451,19 +451,6 @@ void primitiveDeclarationConvertToStridedData(
TRACE
(
"Offset %d Stream %d UsageIndex %d
\n
"
,
element
->
Offset
,
element
->
Stream
,
element
->
UsageIndex
);
TRACE
(
"Offset %d Stream %d UsageIndex %d
\n
"
,
element
->
Offset
,
element
->
Stream
,
element
->
UsageIndex
);
if
(
useVertexShaderFunction
&&
reg
!=
-
1
&&
(
data
||
streamVBO
)
)
{
WINED3DGLTYPE
glType
=
glTypeLookup
[
element
->
Type
];
TRACE
(
"(%p) : Set vertex attrib pointer: reg 0x%08x, d3d type 0x%08x, stride 0x%08lx, data %p)
\n
"
,
This
,
reg
,
element
->
Type
,
stride
,
data
);
GL_EXTCALL
(
glBindBufferARB
(
GL_ARRAY_BUFFER_ARB
,
streamVBO
));
checkGLcall
(
"glBindBufferARB"
);
GL_EXTCALL
(
glVertexAttribPointerARB
(
reg
,
glType
.
size
,
glType
.
glType
,
glType
.
normalized
,
stride
,
data
));
checkGLcall
(
"glVertexAttribPointerARB"
);
GL_EXTCALL
(
glEnableVertexAttribArrayARB
(
reg
));
checkGLcall
(
"glEnableVertexAttribArrayARB"
);
}
if
(
useVertexShaderFunction
)
if
(
useVertexShaderFunction
)
stride_used
=
vshader_get_input
(
This
->
stateBlock
->
vertexShader
,
stride_used
=
vshader_get_input
(
This
->
stateBlock
->
vertexShader
,
element
->
Usage
,
element
->
UsageIndex
,
&
idx
);
element
->
Usage
,
element
->
UsageIndex
,
&
idx
);
...
...
dlls/wined3d/vertexshader.c
View file @
899c8cdb
...
@@ -609,6 +609,28 @@ static void vshader_set_limits(
...
@@ -609,6 +609,28 @@ static void vshader_set_limits(
}
}
}
}
/* This is an internal function,
* used to create fake semantics for shaders
* that don't have them - d3d8 shaders where the declaration
* stores the register for each input
*/
static
void
vshader_set_input
(
IWineD3DVertexShaderImpl
*
This
,
unsigned
int
regnum
,
BYTE
usage
,
BYTE
usage_idx
)
{
/* Fake usage: set reserved bit, usage, usage_idx */
DWORD
usage_token
=
(
0x1
<<
31
)
|
(
usage
<<
D3DSP_DCL_USAGE_SHIFT
)
|
(
usage_idx
<<
D3DSP_DCL_USAGEINDEX_SHIFT
);
/* Fake register; set reserved bit, regnum, type: input, wmask: all */
DWORD
reg_token
=
(
0x1
<<
31
)
|
D3DSP_WRITEMASK_ALL
|
(
D3DSPR_INPUT
<<
D3DSP_REGTYPE_SHIFT
)
|
regnum
;
This
->
semantics_in
[
regnum
].
usage
=
usage_token
;
This
->
semantics_in
[
regnum
].
reg
=
reg_token
;
}
BOOL
vshader_get_input
(
BOOL
vshader_get_input
(
IWineD3DVertexShader
*
iface
,
IWineD3DVertexShader
*
iface
,
BYTE
usage_req
,
BYTE
usage_idx_req
,
BYTE
usage_req
,
BYTE
usage_idx_req
,
...
@@ -637,6 +659,12 @@ BOOL vshader_input_is_color(
...
@@ -637,6 +659,12 @@ BOOL vshader_input_is_color(
IWineD3DVertexShaderImpl
*
This
=
(
IWineD3DVertexShaderImpl
*
)
iface
;
IWineD3DVertexShaderImpl
*
This
=
(
IWineD3DVertexShaderImpl
*
)
iface
;
DWORD
usage_token
=
This
->
semantics_in
[
regnum
].
usage
;
DWORD
usage_token
=
This
->
semantics_in
[
regnum
].
usage
;
DWORD
usage
=
(
usage_token
&
D3DSP_DCL_USAGE_MASK
)
>>
D3DSP_DCL_USAGE_SHIFT
;
DWORD
usage
=
(
usage_token
&
D3DSP_DCL_USAGE_MASK
)
>>
D3DSP_DCL_USAGE_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
;
return
usage
==
D3DDECLUSAGE_COLOR
;
}
}
...
@@ -1077,6 +1105,16 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader
...
@@ -1077,6 +1105,16 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader
shader_trace_init
((
IWineD3DBaseShader
*
)
This
,
pFunction
);
shader_trace_init
((
IWineD3DBaseShader
*
)
This
,
pFunction
);
vshader_set_limits
(
This
);
vshader_set_limits
(
This
);
/* Preload semantics for d3d8 shaders */
if
(
This
->
vertexDeclaration
)
{
IWineD3DVertexDeclarationImpl
*
vdecl
=
(
IWineD3DVertexDeclarationImpl
*
)
This
->
vertexDeclaration
;
int
i
;
for
(
i
=
0
;
i
<
vdecl
->
declarationWNumElements
-
1
;
++
i
)
{
WINED3DVERTEXELEMENT
*
element
=
vdecl
->
pDeclarationWine
+
i
;
vshader_set_input
(
This
,
element
->
Reg
,
element
->
Usage
,
element
->
UsageIndex
);
}
}
/* Second pass: figure out registers used, semantics, etc.. */
/* Second pass: figure out registers used, semantics, etc.. */
memset
(
&
reg_maps
,
0
,
sizeof
(
shader_reg_maps
));
memset
(
&
reg_maps
,
0
,
sizeof
(
shader_reg_maps
));
shader_get_registers_used
((
IWineD3DBaseShader
*
)
This
,
&
reg_maps
,
shader_get_registers_used
((
IWineD3DBaseShader
*
)
This
,
&
reg_maps
,
...
...
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