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
edbd09fb
Commit
edbd09fb
authored
Aug 21, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 21, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement ID3DXConstantTable::SetMatrixTransposeArray.
parent
aaac25dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
37 deletions
+71
-37
shader.c
dlls/d3dx9_36/shader.c
+71
-37
No files found.
dlls/d3dx9_36/shader.c
View file @
edbd09fb
...
...
@@ -961,15 +961,47 @@ static HRESULT set_vector_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev
return
D3D_OK
;
}
static
HRESULT
set_float_matrix
(
FLOAT
*
matrix
,
const
D3DXCONSTANT_DESC
*
desc
,
UINT
row_offset
,
UINT
column_offset
,
UINT
rows
,
UINT
columns
,
const
void
*
data
,
D3DXPARAMETER_TYPE
type
,
UINT
src_columns
)
{
UINT
i
,
j
;
switch
(
type
)
{
case
D3DXPT_FLOAT
:
for
(
i
=
0
;
i
<
rows
;
i
++
)
{
for
(
j
=
0
;
j
<
columns
;
j
++
)
matrix
[
i
*
row_offset
+
j
*
column_offset
]
=
((
FLOAT
*
)
data
)[
i
*
src_columns
+
j
];
}
break
;
case
D3DXPT_INT
:
for
(
i
=
0
;
i
<
rows
;
i
++
)
{
for
(
j
=
0
;
j
<
columns
;
j
++
)
matrix
[
i
*
row_offset
+
j
*
column_offset
]
=
((
INT
*
)
data
)[
i
*
src_columns
+
j
];
}
break
;
default:
FIXME
(
"Unhandled type %#x"
,
type
);
return
D3DERR_INVALIDCALL
;
}
return
D3D_OK
;
}
static
HRESULT
set_matrix_array
(
ID3DXConstantTable
*
iface
,
IDirect3DDevice9
*
device
,
D3DXHANDLE
constant
,
const
void
*
data
,
UINT
count
,
D3DXPARAMETER_TYPE
type
,
UINT
rows
,
UINT
columns
)
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
,
j
,
k
,
desc_count
=
1
;
UINT
i
,
desc_count
=
1
;
UINT
num_rows
,
num_columns
;
UINT
row_offset
,
column_offset
;
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
,
...
...
@@ -982,22 +1014,38 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev
return
D3DERR_INVALIDCALL
;
}
if
(
desc
.
Class
==
D3DXPC_MATRIX_COLUMNS
)
{
column_offset
=
4
;
row_offset
=
1
;
registers_per_matrix
=
desc
.
Columns
;
}
else
if
(
desc
.
Class
==
D3DXPC_MATRIX_ROWS
)
if
(
desc
.
Class
==
D3DXPC_MATRIX_ROWS
||
desc
.
Class
==
D3DXPC_MATRIX_COLUMNS
)
{
column_offset
=
1
;
row_offset
=
4
;
registers_per_matrix
=
desc
.
Rows
;
if
(
desc
.
Class
==
class
)
{
column_offset
=
1
;
row_offset
=
4
;
}
else
{
column_offset
=
4
;
row_offset
=
1
;
}
if
(
class
==
D3DXPC_MATRIX_ROWS
)
{
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
);
}
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
;
}
else
...
...
@@ -1009,33 +1057,18 @@ static HRESULT set_matrix_array(ID3DXConstantTable *iface, IDirect3DDevice9 *dev
switch
(
desc
.
RegisterSet
)
{
case
D3DXRS_FLOAT4
:
data_ptr
=
data
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
registers_per_matrix
*
(
i
+
1
)
>
desc
.
RegisterCount
)
break
;
switch
(
type
)
{
case
D3DXPT_FLOAT
:
for
(
j
=
0
;
j
<
min
(
desc
.
Rows
,
rows
);
j
++
)
{
for
(
k
=
0
;
k
<
min
(
desc
.
Columns
,
columns
);
k
++
)
matrix
[
j
*
row_offset
+
k
*
column_offset
]
=
((
float
*
)
data
)[
i
*
rows
*
columns
+
j
*
columns
+
k
];
}
break
;
case
D3DXPT_INT
:
for
(
j
=
0
;
j
<
min
(
desc
.
Rows
,
rows
);
j
++
)
{
for
(
k
=
0
;
k
<
min
(
desc
.
Columns
,
columns
);
k
++
)
matrix
[
j
*
row_offset
+
k
*
column_offset
]
=
(
float
)((
int
*
)
data
)[
i
*
rows
*
columns
+
j
*
columns
+
k
];
}
break
;
default:
FIXME
(
"Unhandled type %#x"
,
type
);
return
D3DERR_INVALIDCALL
;
}
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
);
data_ptr
+=
rows
*
columns
;
}
break
;
default:
...
...
@@ -1097,7 +1130,8 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetValue(ID3DXConstantTable *iface,
return
set_vector_array
(
iface
,
device
,
constant
,
data
,
elements
,
desc
.
Type
);
case
D3DXPC_MATRIX_ROWS
:
case
D3DXPC_MATRIX_COLUMNS
:
return
set_matrix_array
(
iface
,
device
,
constant
,
data
,
elements
,
desc
.
Type
,
desc
.
Rows
,
desc
.
Columns
);
return
set_matrix_array
(
iface
,
device
,
constant
,
data
,
elements
,
D3DXPC_MATRIX_ROWS
,
desc
.
Type
,
desc
.
Rows
,
desc
.
Columns
);
default:
FIXME
(
"Unhandled parameter class %#x"
,
desc
.
Class
);
return
D3DERR_INVALIDCALL
;
...
...
@@ -1190,7 +1224,7 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrix(ID3DXConstantTable *iface
TRACE
(
"(%p)->(%p, %p, %p)
\n
"
,
This
,
device
,
constant
,
matrix
);
return
set_matrix_array
(
iface
,
device
,
constant
,
matrix
,
1
,
D3DXPT_FLOAT
,
4
,
4
);
return
set_matrix_array
(
iface
,
device
,
constant
,
matrix
,
1
,
D3DXP
C_MATRIX_ROWS
,
D3DXP
T_FLOAT
,
4
,
4
);
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetMatrixArray
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
...
...
@@ -1200,7 +1234,7 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixArray(ID3DXConstantTable *
TRACE
(
"(%p)->(%p, %p, %p, %d)
\n
"
,
This
,
device
,
constant
,
matrix
,
count
);
return
set_matrix_array
(
iface
,
device
,
constant
,
matrix
,
count
,
D3DXPT_FLOAT
,
4
,
4
);
return
set_matrix_array
(
iface
,
device
,
constant
,
matrix
,
count
,
D3DXP
C_MATRIX_ROWS
,
D3DXP
T_FLOAT
,
4
,
4
);
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetMatrixPointerArray
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
...
...
@@ -1228,9 +1262,9 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixTransposeArray(ID3DXConsta
{
struct
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
FIXME
(
"(%p)->(%p, %p, %p, %d): stub
\n
"
,
This
,
device
,
constant
,
matrix
,
count
);
TRACE
(
"(%p)->(%p, %p, %p, %d)
\n
"
,
This
,
device
,
constant
,
matrix
,
count
);
return
E_NOTIMPL
;
return
set_matrix_array
(
iface
,
device
,
constant
,
matrix
,
count
,
D3DXPC_MATRIX_COLUMNS
,
D3DXPT_FLOAT
,
4
,
4
)
;
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetMatrixTransposePointerArray
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
...
...
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