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
e67920f1
Commit
e67920f1
authored
Aug 14, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Aug 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Introduce a helper function for setting float shader constants.
parent
c9f90256
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
shader.c
dlls/d3dx9_36/shader.c
+13
-14
No files found.
dlls/d3dx9_36/shader.c
View file @
e67920f1
...
...
@@ -672,6 +672,15 @@ static inline D3DXHANDLE handle_from_constant_index(UINT index)
return
(
D3DXHANDLE
)(
DWORD_PTR
)(
index
+
1
);
}
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
)
{
...
...
@@ -882,10 +891,7 @@ static HRESULT set_float_array(ID3DXConstantTable *iface, LPDIRECT3DDEVICE9 devi
FIXME
(
"Unhandled type passed to set_float_array
\n
"
);
return
D3DERR_INVALIDCALL
;
}
if
(
is_vertex_shader
(
This
->
desc
.
Version
))
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
desc
.
RegisterIndex
+
i
,
row
,
1
);
else
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
desc
.
RegisterIndex
+
i
,
row
,
1
);
set_float_shader_constant
(
This
,
device
,
desc
.
RegisterIndex
+
i
,
row
,
1
);
}
break
;
default:
...
...
@@ -1004,12 +1010,8 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetVectorArray(ID3DXConstantTable *
switch
(
desc
.
RegisterSet
)
{
case
D3DXRS_FLOAT4
:
if
(
is_vertex_shader
(
This
->
desc
.
Version
))
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
desc
.
RegisterIndex
,
(
float
*
)
vector
,
min
(
desc
.
RegisterCount
,
count
));
else
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
desc
.
RegisterIndex
,
(
float
*
)
vector
,
min
(
desc
.
RegisterCount
,
count
));
set_float_shader_constant
(
This
,
device
,
desc
.
RegisterIndex
,
(
float
*
)
vector
,
min
(
desc
.
RegisterCount
,
count
));
break
;
default:
FIXME
(
"Handle other register sets
\n
"
);
...
...
@@ -1060,10 +1062,7 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetMatrixArray(ID3DXConstantTable *
else
D3DXMatrixTranspose
(
&
temp
,
&
matrix
[
i
]);
if
(
is_vertex_shader
(
This
->
desc
.
Version
))
IDirect3DDevice9_SetVertexShaderConstantF
(
device
,
desc
.
RegisterIndex
+
i
*
4
,
&
temp
.
u
.
s
.
_11
,
4
);
else
IDirect3DDevice9_SetPixelShaderConstantF
(
device
,
desc
.
RegisterIndex
+
i
*
4
,
&
temp
.
u
.
s
.
_11
,
4
);
set_float_shader_constant
(
This
,
device
,
desc
.
RegisterIndex
+
i
*
4
,
&
temp
.
u
.
s
.
_11
,
4
);
}
break
;
default:
...
...
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