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
ac651a70
Commit
ac651a70
authored
Nov 27, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Nov 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix the texm3x3tex instruction to sample properly.
parent
e7122e9a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
19 deletions
+10
-19
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+4
-2
glsl_shader.c
dlls/wined3d/glsl_shader.c
+6
-17
No files found.
dlls/wined3d/arb_program_shader.c
View file @
ac651a70
...
...
@@ -781,13 +781,15 @@ void pshader_hw_texm3x3tex(SHADER_OPCODE_ARG* arg) {
DWORD
reg
=
arg
->
dst
&
WINED3DSP_REGNUM_MASK
;
SHADER_BUFFER
*
buffer
=
arg
->
buffer
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
char
dst_str
[
8
];
char
src0_name
[
50
];
pshader_gen_input_modifier_line
(
buffer
,
arg
->
src
[
0
],
0
,
src0_name
);
shader_addline
(
buffer
,
"DP3 TMP.z, T%u, %s;
\n
"
,
reg
,
src0_name
);
/* Cubemap textures will be more used than 3D ones. */
shader_addline
(
buffer
,
"TEX T%u, TMP, texture[%u], CUBE;
\n
"
,
reg
,
reg
);
/* Sample the texture using the calculated coordinates */
sprintf
(
dst_str
,
"T%u"
,
reg
);
shader_hw_sample
(
arg
,
reg
,
dst_str
,
"TMP"
);
current_state
->
current_row
=
0
;
}
...
...
dlls/wined3d/glsl_shader.c
View file @
ac651a70
...
...
@@ -1560,33 +1560,22 @@ void pshader_glsl_texm3x2tex(SHADER_OPCODE_ARG* arg) {
}
/** Process the WINED3DSIO_TEXM3X3TEX instruction in GLSL
* Perform the 3rd row of a 3x3 matrix multiply, then sample the texture using the calculate coordinates */
* Perform the 3rd row of a 3x3 matrix multiply, then sample the texture using the calculate
d
coordinates */
void
pshader_glsl_texm3x3tex
(
SHADER_OPCODE_ARG
*
arg
)
{
char
dst_str
[
8
];
char
src0_str
[
100
];
char
src0_name
[
50
];
char
src0_mask
[
6
];
char
dimensions
[
5
];
DWORD
reg
=
arg
->
dst
&
WINED3DSP_REGNUM_MASK
;
DWORD
src0_regnum
=
arg
->
src
[
0
]
&
WINED3DSP_REGNUM_MASK
;
DWORD
stype
=
arg
->
reg_maps
->
samplers
[
src0_regnum
]
&
WINED3DSP_TEXTURETYPE_MASK
;
IWineD3DPixelShaderImpl
*
This
=
(
IWineD3DPixelShaderImpl
*
)
arg
->
shader
;
SHADER_PARSE_STATE
*
current_state
=
&
This
->
baseShader
.
parse_state
;
switch
(
stype
)
{
case
WINED3DSTT_2D
:
strcpy
(
dimensions
,
"2D"
);
break
;
case
WINED3DSTT_CUBE
:
strcpy
(
dimensions
,
"Cube"
);
break
;
case
WINED3DSTT_VOLUME
:
strcpy
(
dimensions
,
"3D"
);
break
;
default:
strcpy
(
dimensions
,
""
);
FIXME
(
"Unrecognized sampler type: %#x
\n
"
,
stype
);
break
;
}
shader_glsl_add_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
TRUE
,
src0_name
,
src0_mask
,
src0_str
);
shader_addline
(
arg
->
buffer
,
"tmp0.z = dot(vec3(T%u), vec3(%s));
\n
"
,
reg
,
src0_str
);
shader_addline
(
arg
->
buffer
,
"T%u = texture%s(Psampler%u, tmp0.%s);
\n
"
,
reg
,
dimensions
,
reg
,
(
stype
==
WINED3DSTT_2D
)
?
"xy"
:
"xyz"
);
/* Sample the texture using the calculated coordinates */
sprintf
(
dst_str
,
"T%u"
,
reg
);
shader_glsl_sample
(
arg
,
reg
,
dst_str
,
"tmp0"
);
current_state
->
current_row
=
0
;
}
...
...
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