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
94da4fc4
Commit
94da4fc4
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 D3DXFillCubeTextureTX().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
1908d0b3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
54 deletions
+34
-54
shader.c
dlls/d3dx9_36/shader.c
+33
-0
texture.c
dlls/d3dx9_36/tests/texture.c
+1
-48
texture.c
dlls/d3dx9_36/texture.c
+0
-6
No files found.
dlls/d3dx9_36/shader.c
View file @
94da4fc4
...
...
@@ -2694,6 +2694,30 @@ void WINAPI texture_shader_fill_2d(D3DXVECTOR4 *out, const D3DXVECTOR2 *texcoord
d3dx_evaluate_parameter
(
shader
->
eval
,
&
param
,
out
);
}
void
WINAPI
texture_shader_fill_3d
(
D3DXVECTOR4
*
out
,
const
D3DXVECTOR3
*
texcoord
,
const
D3DXVECTOR3
*
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
++
)
=
texcoord
->
z
;
*
(
inputs
++
)
=
0
.
0
f
;
*
(
inputs
++
)
=
texelsize
->
x
;
*
(
inputs
++
)
=
texelsize
->
y
;
*
(
inputs
++
)
=
texelsize
->
z
;
*
(
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
);
...
...
@@ -2703,6 +2727,15 @@ HRESULT WINAPI D3DXFillTextureTX(struct IDirect3DTexture9 *texture, ID3DXTexture
return
D3DXFillTexture
(
texture
,
texture_shader_fill_2d
,
shader
);
}
HRESULT
WINAPI
D3DXFillCubeTextureTX
(
struct
IDirect3DCubeTexture9
*
cube
,
ID3DXTextureShader
*
texture_shader
)
{
struct
d3dx9_texture_shader
*
shader
=
unsafe_impl_from_ID3DXTextureShader
(
texture_shader
);
TRACE
(
"cube %p, texture_shader %p.
\n
"
,
cube
,
texture_shader
);
return
D3DXFillCubeTexture
(
cube
,
texture_shader_fill_3d
,
shader
);
}
static
unsigned
int
get_instr_length
(
const
DWORD
*
byte_code
,
unsigned
int
major
,
unsigned
int
minor
)
{
DWORD
opcode
=
*
byte_code
&
0xffff
;
...
...
dlls/d3dx9_36/tests/texture.c
View file @
94da4fc4
...
...
@@ -2595,55 +2595,8 @@ float4 main(float3 pos : POSITION, float3 size : PSIZE) : COLOR
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
D3DXFillCubeTextureTX
(
cube_texture
,
tx
);
todo_wine
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#lx.
\n
"
,
hr
);
for
(
z
=
0
;
z
<
6
;
++
z
)
{
static
const
char
*
const
mapping
[
6
][
3
]
=
{
{
"-x"
,
"-y"
,
"1"
},
{
"+x"
,
"-y"
,
"0"
},
{
"+y"
,
"1"
,
"+x"
},
{
"-y"
,
"0"
,
"+x"
},
{
"1"
,
"-y"
,
"+x"
},
{
"0"
,
"-y"
,
"-x"
},
};
hr
=
IDirect3DCubeTexture9_LockRect
(
cube_texture
,
z
,
0
,
&
lr
,
NULL
,
D3DLOCK_READONLY
);
ok
(
SUCCEEDED
(
hr
),
"Locking texture failed, hr %#lx.
\n
"
,
hr
);
data
=
lr
.
pBits
;
for
(
y
=
0
;
y
<
256
;
++
y
)
{
for
(
x
=
0
;
x
<
256
;
++
x
)
{
unsigned
int
color
=
data
[
y
*
lr
.
Pitch
/
sizeof
(
*
data
)
+
x
];
unsigned
int
expected
=
0xff000000
;
unsigned
int
i
;
for
(
i
=
0
;
i
<
3
;
++
i
)
{
int
component
;
if
(
mapping
[
z
][
i
][
0
]
==
'0'
)
component
=
0
;
else
if
(
mapping
[
z
][
i
][
0
]
==
'1'
)
component
=
255
;
else
component
=
mapping
[
z
][
i
][
1
]
==
'x'
?
x
*
2
-
255
:
y
*
2
-
255
;
if
(
mapping
[
z
][
i
][
0
]
==
'-'
)
component
=
-
component
;
expected
|=
max
(
component
,
0
)
<<
i
*
8
;
}
todo_wine
ok
(
compare_color
(
color
,
expected
,
1
),
"Unexpected color %08x at (%u, %u, %u).
\n
"
,
color
,
x
,
y
,
z
);
}
}
hr
=
IDirect3DCubeTexture9_UnlockRect
(
cube_texture
,
z
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Unlocking texture failed, hr %#lx.
\n
"
,
hr
);
}
compare_cube_texture
(
cube_texture
,
fillfunc_cube_coord
,
1
);
IDirect3DCubeTexture9_Release
(
cube_texture
);
if
(
!
(
caps
.
TextureCaps
&
D3DPTEXTURECAPS_VOLUMEMAP
)
||
caps
.
MaxVolumeExtent
<
64
)
...
...
dlls/d3dx9_36/texture.c
View file @
94da4fc4
...
...
@@ -1723,12 +1723,6 @@ HRESULT WINAPI D3DXFillCubeTexture(struct IDirect3DCubeTexture9 *texture, LPD3DX
return
D3D_OK
;
}
HRESULT
WINAPI
D3DXFillCubeTextureTX
(
struct
IDirect3DCubeTexture9
*
texture
,
ID3DXTextureShader
*
texture_shader
)
{
FIXME
(
"texture %p, texture_shader %p stub.
\n
"
,
texture
,
texture_shader
);
return
E_NOTIMPL
;
}
HRESULT
WINAPI
D3DXFillVolumeTexture
(
struct
IDirect3DVolumeTexture9
*
texture
,
LPD3DXFILL3D
function
,
void
*
funcdata
)
{
DWORD
miplevels
;
...
...
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