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
a4dde815
Commit
a4dde815
authored
Aug 28, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Aug 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Improve set_matrix_array().
parent
97ef9f93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
39 deletions
+25
-39
shader.c
dlls/d3dx9_36/shader.c
+25
-39
No files found.
dlls/d3dx9_36/shader.c
View file @
a4dde815
...
...
@@ -1158,84 +1158,70 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev
UINT
count
,
D3DXPARAMETER_CLASS
class
,
D3DXPARAMETER_TYPE
type
,
UINT
rows
,
UINT
columns
)
{
struct
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
D3DXCONSTANT_DESC
desc
;
HRESULT
hr
;
UINT
registers_per_matrix
;
UINT
i
,
desc_count
=
1
;
UINT
num_rows
,
num_columns
;
UINT
row_offset
,
column_offset
;
struct
ctab_constant
*
c
=
get_valid_constant
(
This
,
constant
);
D3DXCONSTANT_DESC
*
desc
;
UINT
registers_per_matrix
,
num_rows
,
num_columns
,
i
;
UINT
row_offset
=
1
,
column_offset
=
1
;
const
DWORD
*
data_ptr
;
FLOAT
matrix
[
16
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
hr
=
ID3DXConstantTable_GetConstantDesc
(
iface
,
constant
,
&
desc
,
&
desc_count
);
if
(
FAILED
(
hr
))
if
(
!
c
)
{
TRACE
(
"ID3DXConstantTable_GetConstantDesc failed: %08x
\n
"
,
hr
);
WARN
(
"Invalid argument specified
\n
"
);
return
D3DERR_INVALIDCALL
;
}
desc
=
&
c
->
desc
;
if
(
desc
.
Class
==
D3DXPC_MATRIX_ROWS
||
desc
.
Class
==
D3DXPC_MATRIX_COLUMNS
)
if
(
desc
->
Class
==
D3DXPC_MATRIX_ROWS
||
desc
->
Class
==
D3DXPC_MATRIX_COLUMNS
||
desc
->
Class
==
D3DXPC_SCALAR
)
{
if
(
desc
.
Class
==
class
)
{
column_offset
=
1
;
row_offset
=
4
;
}
else
{
column_offset
=
4
;
row_offset
=
1
;
}
if
(
desc
->
Class
==
class
)
row_offset
=
4
;
else
column_offset
=
4
;
if
(
class
==
D3DXPC_MATRIX_ROWS
)
{
num_rows
=
min
(
desc
.
Rows
,
rows
);
num_columns
=
min
(
desc
.
Columns
,
columns
);
num_rows
=
min
(
desc
->
Rows
,
rows
);
num_columns
=
min
(
desc
->
Columns
,
columns
);
}
else
{
num_rows
=
min
(
desc
.
Columns
,
columns
);
num_columns
=
min
(
desc
.
Rows
,
rows
);
num_rows
=
min
(
desc
->
Columns
,
columns
);
num_columns
=
min
(
desc
->
Rows
,
rows
);
}
registers_per_matrix
=
(
desc
.
Class
==
D3DXPC_MATRIX_ROWS
)
?
desc
.
Rows
:
desc
.
Columns
;
}
else
if
(
desc
.
Class
==
D3DXPC_SCALAR
)
{
column_offset
=
1
;
row_offset
=
1
;
num_rows
=
min
(
desc
.
Rows
,
rows
);
num_columns
=
min
(
desc
.
Columns
,
columns
);
registers_per_matrix
=
1
;
registers_per_matrix
=
(
desc
->
Class
==
D3DXPC_MATRIX_COLUMNS
)
?
desc
->
Columns
:
desc
->
Rows
;
}
else
{
FIXME
(
"Unhandled variable class %s
\n
"
,
debug_d3dxparameter_class
(
desc
.
Class
));
FIXME
(
"Unhandled variable class %s
\n
"
,
debug_d3dxparameter_class
(
desc
->
Class
));
return
D3D_OK
;
}
switch
(
desc
.
RegisterSet
)
switch
(
desc
->
RegisterSet
)
{
case
D3DXRS_FLOAT4
:
data_ptr
=
data
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
registers_per_matrix
*
(
i
+
1
)
>
desc
.
RegisterCount
)
HRESULT
hr
;
if
(
registers_per_matrix
*
(
i
+
1
)
>
desc
->
RegisterCount
)
break
;
hr
=
set_float_matrix
(
matrix
,
&
desc
,
row_offset
,
column_offset
,
num_rows
,
num_columns
,
data_ptr
,
type
,
columns
);
hr
=
set_float_matrix
(
matrix
,
desc
,
row_offset
,
column_offset
,
num_rows
,
num_columns
,
data_ptr
,
type
,
columns
);
if
(
FAILED
(
hr
))
return
hr
;
set_float_shader_constant
(
This
,
device
,
desc
.
RegisterIndex
+
i
*
registers_per_matrix
,
matrix
,
registers_per_matrix
);
set_float_shader_constant
(
This
,
device
,
desc
->
RegisterIndex
+
i
*
registers_per_matrix
,
matrix
,
registers_per_matrix
);
data_ptr
+=
rows
*
columns
;
}
break
;
default:
FIXME
(
"Unhandled register set %s
\n
"
,
debug_d3dxparameter_registerset
(
desc
.
RegisterSet
));
FIXME
(
"Unhandled register set %s
\n
"
,
debug_d3dxparameter_registerset
(
desc
->
RegisterSet
));
return
E_NOTIMPL
;
}
...
...
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