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
86bc7dd1
Commit
86bc7dd1
authored
Dec 03, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Partially implement D3DXFillTextureTX().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
bd2a787d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
11 deletions
+50
-11
preshader.c
dlls/d3dx9_36/preshader.c
+7
-3
shader.c
dlls/d3dx9_36/shader.c
+43
-0
texture.c
dlls/d3dx9_36/tests/texture.c
+0
-2
texture.c
dlls/d3dx9_36/texture.c
+0
-6
No files found.
dlls/d3dx9_36/preshader.c
View file @
86bc7dd1
...
@@ -1728,16 +1728,20 @@ HRESULT d3dx_evaluate_parameter(struct d3dx_param_eval *peval, const struct d3dx
...
@@ -1728,16 +1728,20 @@ HRESULT d3dx_evaluate_parameter(struct d3dx_param_eval *peval, const struct d3dx
HRESULT
hr
;
HRESULT
hr
;
unsigned
int
i
;
unsigned
int
i
;
unsigned
int
elements
,
elements_param
,
elements_table
;
unsigned
int
elements
,
elements_param
,
elements_table
;
BOOL
is_dirty
;
float
*
oc
;
float
*
oc
;
TRACE
(
"peval %p, param %p, param_value %p.
\n
"
,
peval
,
param
,
param_value
);
TRACE
(
"peval %p, param %p, param_value %p.
\n
"
,
peval
,
param
,
param_value
);
if
(
is_const_tab_input_dirty
(
&
peval
->
pres
.
inputs
,
ULONG64_MAX
))
if
(
(
is_dirty
=
is_const_tab_input_dirty
(
&
peval
->
pres
.
inputs
,
ULONG64_MAX
)
))
{
{
set_constants
(
&
peval
->
pres
.
regs
,
&
peval
->
pres
.
inputs
,
set_constants
(
&
peval
->
pres
.
regs
,
&
peval
->
pres
.
inputs
,
next_update_version
(
peval
->
version_counter
),
next_update_version
(
peval
->
version_counter
),
NULL
,
NULL
,
NULL
,
NULL
,
peval
->
param_type
,
FALSE
,
FALSE
);
peval
->
param_type
,
FALSE
,
FALSE
);
}
if
(
is_dirty
||
peval
->
pres
.
regs
.
table_sizes
[
PRES_REGTAB_INPUT
])
{
if
(
FAILED
(
hr
=
execute_preshader
(
&
peval
->
pres
)))
if
(
FAILED
(
hr
=
execute_preshader
(
&
peval
->
pres
)))
return
hr
;
return
hr
;
}
}
...
...
dlls/d3dx9_36/shader.c
View file @
86bc7dd1
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
#include <assert.h>
#include "d3dx9_private.h"
#include "d3dx9_private.h"
#include "d3dcommon.h"
#include "d3dcommon.h"
...
@@ -2615,6 +2616,15 @@ static const struct ID3DXTextureShaderVtbl d3dx9_texture_shader_vtbl =
...
@@ -2615,6 +2616,15 @@ static const struct ID3DXTextureShaderVtbl d3dx9_texture_shader_vtbl =
d3dx9_texture_shader_SetMatrixTransposePointerArray
d3dx9_texture_shader_SetMatrixTransposePointerArray
};
};
static
inline
struct
d3dx9_texture_shader
*
unsafe_impl_from_ID3DXTextureShader
(
ID3DXTextureShader
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3dx9_texture_shader_vtbl
);
return
impl_from_ID3DXTextureShader
(
iface
);
}
HRESULT
WINAPI
D3DXCreateTextureShader
(
const
DWORD
*
function
,
ID3DXTextureShader
**
texture_shader
)
HRESULT
WINAPI
D3DXCreateTextureShader
(
const
DWORD
*
function
,
ID3DXTextureShader
**
texture_shader
)
{
{
struct
d3dx9_texture_shader
*
object
;
struct
d3dx9_texture_shader
*
object
;
...
@@ -2660,6 +2670,39 @@ HRESULT WINAPI D3DXCreateTextureShader(const DWORD *function, ID3DXTextureShader
...
@@ -2660,6 +2670,39 @@ HRESULT WINAPI D3DXCreateTextureShader(const DWORD *function, ID3DXTextureShader
return
D3D_OK
;
return
D3D_OK
;
}
}
void
WINAPI
texture_shader_fill_2d
(
D3DXVECTOR4
*
out
,
const
D3DXVECTOR2
*
texcoord
,
const
D3DXVECTOR2
*
texelsize
,
void
*
data
)
{
struct
d3dx9_texture_shader
*
shader
=
data
;
struct
d3dx_parameter
param
=
{
0
};
float
*
inputs
;
inputs
=
(
float
*
)
shader
->
eval
->
pres
.
regs
.
tables
[
PRES_REGTAB_INPUT
];
*
(
inputs
++
)
=
texcoord
->
x
;
*
(
inputs
++
)
=
texcoord
->
y
;
*
(
inputs
++
)
=
0
.
0
f
;
*
(
inputs
++
)
=
0
.
0
f
;
*
(
inputs
++
)
=
texelsize
->
x
;
*
(
inputs
++
)
=
texelsize
->
y
;
*
(
inputs
++
)
=
0
.
0
f
;
*
(
inputs
++
)
=
0
.
0
f
;
param
.
type
=
D3DXPT_FLOAT
;
param
.
bytes
=
4
*
sizeof
(
float
);
d3dx_evaluate_parameter
(
shader
->
eval
,
&
param
,
out
);
}
HRESULT
WINAPI
D3DXFillTextureTX
(
struct
IDirect3DTexture9
*
texture
,
ID3DXTextureShader
*
texture_shader
)
{
struct
d3dx9_texture_shader
*
shader
=
unsafe_impl_from_ID3DXTextureShader
(
texture_shader
);
TRACE
(
"texture %p, texture_shader %p.
\n
"
,
texture
,
texture_shader
);
return
D3DXFillTexture
(
texture
,
texture_shader_fill_2d
,
shader
);
}
static
unsigned
int
get_instr_length
(
const
DWORD
*
byte_code
,
unsigned
int
major
,
unsigned
int
minor
)
static
unsigned
int
get_instr_length
(
const
DWORD
*
byte_code
,
unsigned
int
major
,
unsigned
int
minor
)
{
{
DWORD
opcode
=
*
byte_code
&
0xffff
;
DWORD
opcode
=
*
byte_code
&
0xffff
;
...
...
dlls/d3dx9_36/tests/texture.c
View file @
86bc7dd1
...
@@ -2527,7 +2527,6 @@ float4 main(float3 pos : POSITION, float3 size : PSIZE) : COLOR
...
@@ -2527,7 +2527,6 @@ float4 main(float3 pos : POSITION, float3 size : PSIZE) : COLOR
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
D3DXFillTextureTX
(
texture
,
tx
);
hr
=
D3DXFillTextureTX
(
texture
,
tx
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IDirect3DTexture9_LockRect
(
texture
,
0
,
&
lr
,
NULL
,
D3DLOCK_READONLY
);
hr
=
IDirect3DTexture9_LockRect
(
texture
,
0
,
&
lr
,
NULL
,
D3DLOCK_READONLY
);
...
@@ -2541,7 +2540,6 @@ float4 main(float3 pos : POSITION, float3 size : PSIZE) : COLOR
...
@@ -2541,7 +2540,6 @@ float4 main(float3 pos : POSITION, float3 size : PSIZE) : COLOR
/* The third position coordinate is apparently undefined for 2D textures. */
/* The third position coordinate is apparently undefined for 2D textures. */
unsigned
int
color
=
data
[
y
*
lr
.
Pitch
/
sizeof
(
*
data
)
+
x
]
&
0xffffff00
;
unsigned
int
color
=
data
[
y
*
lr
.
Pitch
/
sizeof
(
*
data
)
+
x
]
&
0xffffff00
;
todo_wine
ok
(
compare_color
(
color
,
expected
,
1
),
"Unexpected color %08x at (%u, %u).
\n
"
,
color
,
x
,
y
);
ok
(
compare_color
(
color
,
expected
,
1
),
"Unexpected color %08x at (%u, %u).
\n
"
,
color
,
x
,
y
);
}
}
}
}
...
...
dlls/d3dx9_36/texture.c
View file @
86bc7dd1
...
@@ -1382,12 +1382,6 @@ HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D f
...
@@ -1382,12 +1382,6 @@ HRESULT WINAPI D3DXFillTexture(struct IDirect3DTexture9 *texture, LPD3DXFILL2D f
return
D3D_OK
;
return
D3D_OK
;
}
}
HRESULT
WINAPI
D3DXFillTextureTX
(
struct
IDirect3DTexture9
*
texture
,
ID3DXTextureShader
*
texture_shader
)
{
FIXME
(
"texture %p, texture_shader %p stub.
\n
"
,
texture
,
texture_shader
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
D3DXCreateCubeTextureFromFileInMemoryEx
(
IDirect3DDevice9
*
device
,
const
void
*
src_data
,
HRESULT
WINAPI
D3DXCreateCubeTextureFromFileInMemoryEx
(
IDirect3DDevice9
*
device
,
const
void
*
src_data
,
UINT
src_data_size
,
UINT
size
,
UINT
mip_levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
,
UINT
src_data_size
,
UINT
size
,
UINT
mip_levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
,
DWORD
filter
,
DWORD
mip_filter
,
D3DCOLOR
color_key
,
D3DXIMAGE_INFO
*
src_info
,
DWORD
filter
,
DWORD
mip_filter
,
D3DCOLOR
color_key
,
D3DXIMAGE_INFO
*
src_info
,
...
...
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