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
1099bb5e
Commit
1099bb5e
authored
Jul 29, 2013
by
Rico Schüller
Committed by
Alexandre Julliard
Jul 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Improve ID3DXConstantTable::SetDefaults().
parent
c76f6085
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
11 deletions
+42
-11
shader.c
dlls/d3dx9_36/shader.c
+42
-11
No files found.
dlls/d3dx9_36/shader.c
View file @
1099bb5e
...
...
@@ -750,15 +750,6 @@ static inline struct ctab_constant *get_valid_constant(struct ID3DXConstantTable
return
get_constant_by_name
(
table
,
NULL
,
handle
);
}
static
inline
void
set_float_shader_constant
(
struct
ID3DXConstantTableImpl
*
table
,
IDirect3DDevice9
*
device
,
UINT
register_index
,
const
FLOAT
*
data
,
UINT
count
)
{
if
(
is_vertex_shader
(
table
->
desc
.
Version
))
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
register_index
,
data
,
count
);
else
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
register_index
,
data
,
count
);
}
/*** IUnknown methods ***/
static
HRESULT
WINAPI
ID3DXConstantTableImpl_QueryInterface
(
ID3DXConstantTable
*
iface
,
REFIID
riid
,
void
**
out
)
{
...
...
@@ -1434,19 +1425,59 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetDefaults(struct ID3DXConstantTab
struct
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
UINT
i
;
TRACE
(
"
(%p)->(%p)
\n
"
,
This
,
device
);
TRACE
(
"
iface %p, device %p
\n
"
,
iface
,
device
);
if
(
!
device
)
{
WARN
(
"Invalid argument specified
\n
"
);
return
D3DERR_INVALIDCALL
;
}
for
(
i
=
0
;
i
<
This
->
desc
.
Constants
;
i
++
)
{
D3DXCONSTANT_DESC
*
desc
=
&
This
->
constants
[
i
].
desc
;
HRESULT
hr
;
if
(
!
desc
->
DefaultValue
)
continue
;
set_float_shader_constant
(
This
,
device
,
desc
->
RegisterIndex
,
desc
->
DefaultValue
,
desc
->
RegisterCount
);
switch
(
desc
->
RegisterSet
)
{
case
D3DXRS_BOOL
:
if
(
is_vertex_shader
(
This
->
desc
.
Version
))
hr
=
IDirect3DDevice9_SetVertexShaderConstantB
(
device
,
desc
->
RegisterIndex
,
desc
->
DefaultValue
,
desc
->
RegisterCount
);
else
hr
=
IDirect3DDevice9_SetPixelShaderConstantB
(
device
,
desc
->
RegisterIndex
,
desc
->
DefaultValue
,
desc
->
RegisterCount
);
break
;
case
D3DXRS_INT4
:
if
(
is_vertex_shader
(
This
->
desc
.
Version
))
hr
=
IDirect3DDevice9_SetVertexShaderConstantI
(
device
,
desc
->
RegisterIndex
,
desc
->
DefaultValue
,
desc
->
RegisterCount
);
else
hr
=
IDirect3DDevice9_SetPixelShaderConstantI
(
device
,
desc
->
RegisterIndex
,
desc
->
DefaultValue
,
desc
->
RegisterCount
);
break
;
case
D3DXRS_FLOAT4
:
if
(
is_vertex_shader
(
This
->
desc
.
Version
))
hr
=
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
desc
->
RegisterIndex
,
desc
->
DefaultValue
,
desc
->
RegisterCount
);
else
hr
=
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
desc
->
RegisterIndex
,
desc
->
DefaultValue
,
desc
->
RegisterCount
);
break
;
default:
FIXME
(
"Unhandled register set %s
\n
"
,
debug_d3dxparameter_registerset
(
desc
->
RegisterSet
));
hr
=
E_NOTIMPL
;
break
;
}
if
(
hr
!=
D3D_OK
)
return
hr
;
}
return
D3D_OK
;
...
...
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