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
3fdcce18
Commit
3fdcce18
authored
Jun 21, 2011
by
Travis Athougies
Committed by
Alexandre Julliard
Jun 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Implemented ID3DXConstantTable_SetFloatArray and ID3DXConstantTable_SetFloat.
parent
ab612bc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
7 deletions
+59
-7
shader.c
dlls/d3dx9_36/shader.c
+59
-7
No files found.
dlls/d3dx9_36/shader.c
View file @
3fdcce18
/*
/*
* Copyright 2008 Luis Busquets
* Copyright 2008 Luis Busquets
* Copyright 2009 Matteo Bruni
* Copyright 2009 Matteo Bruni
* Copyright 2011 Travis Athougies
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -630,6 +631,11 @@ static inline ID3DXConstantTableImpl *impl_from_ID3DXConstantTable(ID3DXConstant
...
@@ -630,6 +631,11 @@ static inline ID3DXConstantTableImpl *impl_from_ID3DXConstantTable(ID3DXConstant
return
CONTAINING_RECORD
(
iface
,
ID3DXConstantTableImpl
,
ID3DXConstantTable_iface
);
return
CONTAINING_RECORD
(
iface
,
ID3DXConstantTableImpl
,
ID3DXConstantTable_iface
);
}
}
static
inline
int
is_vertex_shader
(
DWORD
version
)
{
return
(
version
&
0xFFFF0000
)
==
0xFFFE0000
;
}
/*** IUnknown methods ***/
/*** IUnknown methods ***/
static
HRESULT
WINAPI
ID3DXConstantTableImpl_QueryInterface
(
ID3DXConstantTable
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
static
HRESULT
WINAPI
ID3DXConstantTableImpl_QueryInterface
(
ID3DXConstantTable
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
{
{
...
@@ -801,6 +807,52 @@ static D3DXHANDLE WINAPI ID3DXConstantTableImpl_GetConstantElement(ID3DXConstant
...
@@ -801,6 +807,52 @@ static D3DXHANDLE WINAPI ID3DXConstantTableImpl_GetConstantElement(ID3DXConstant
return
NULL
;
return
NULL
;
}
}
static
HRESULT
set_float_array
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
D3DXHANDLE
constant
,
const
void
*
data
,
UINT
count
,
D3DXPARAMETER_TYPE
type
)
{
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
D3DXCONSTANT_DESC
desc
;
HRESULT
hr
;
UINT
i
,
desc_count
=
1
;
float
row
[
4
]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
hr
=
ID3DXConstantTable_GetConstantDesc
(
iface
,
constant
,
&
desc
,
&
desc_count
);
if
(
FAILED
(
hr
))
{
TRACE
(
"ID3DXConstantTable_GetConstantDesc failed: %08x"
,
hr
);
return
D3DERR_INVALIDCALL
;
}
switch
(
desc
.
RegisterSet
)
{
case
D3DXRS_FLOAT4
:
for
(
i
=
0
;
i
<
count
&&
i
<
desc
.
RegisterCount
;
i
++
)
{
/* We need the for loop since each IDirect3DDevice9_Set*ShaderConstantF expects a float4 */
switch
(
type
)
{
case
D3DXPT_FLOAT
:
row
[
0
]
=
((
float
*
)
data
)[
i
];
break
;
default:
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
);
}
break
;
default:
FIXME
(
"Handle other register sets
\n
"
);
return
E_NOTIMPL
;
}
return
D3D_OK
;
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetDefaults
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
)
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetDefaults
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
)
{
{
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
...
@@ -859,24 +911,24 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetIntArray(ID3DXConstantTable* ifa
...
@@ -859,24 +911,24 @@ static HRESULT WINAPI ID3DXConstantTableImpl_SetIntArray(ID3DXConstantTable* ifa
return
E_NOTIMPL
;
return
E_NOTIMPL
;
}
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetFloat
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetFloat
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
D3DXHANDLE
constant
,
FLOAT
f
)
D3DXHANDLE
constant
,
FLOAT
f
)
{
{
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
FIXME
(
"(%p)->(%p, %p, %f): stub
\n
"
,
This
,
device
,
constant
,
f
);
TRACE
(
"(%p)->(%p, %p, %f)
\n
"
,
This
,
device
,
constant
,
f
);
return
E_NOTIMPL
;
return
ID3DXConstantTable_SetFloatArray
(
iface
,
device
,
constant
,
&
f
,
1
)
;
}
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetFloatArray
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetFloatArray
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
D3DXHANDLE
constant
,
CONST
FLOAT
*
f
,
UINT
count
)
D3DXHANDLE
constant
,
CONST
FLOAT
*
f
,
UINT
count
)
{
{
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
ID3DXConstantTableImpl
*
This
=
impl_from_ID3DXConstantTable
(
iface
);
FIXME
(
"(%p)->(%p, %p, %p, %d): stub
\n
"
,
This
,
device
,
constant
,
f
,
count
);
TRACE
(
"(%p)->(%p, %p, %p, %d)
\n
"
,
This
,
device
,
constant
,
f
,
count
);
return
E_NOTIMPL
;
return
set_float_array
(
iface
,
device
,
constant
,
f
,
count
,
D3DXPT_FLOAT
)
;
}
}
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetVector
(
ID3DXConstantTable
*
iface
,
LPDIRECT3DDEVICE9
device
,
static
HRESULT
WINAPI
ID3DXConstantTableImpl_SetVector
(
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