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
3d3369a7
Commit
3d3369a7
authored
Sep 09, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Oct 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: d3d ignores the sign of the input value in the log instruction.
parent
6dc11616
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+21
-0
pixelshader.c
dlls/wined3d/pixelshader.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/glsl_shader.c
View file @
3d3369a7
...
...
@@ -1346,6 +1346,27 @@ void shader_glsl_pow(SHADER_OPCODE_ARG *arg) {
}
}
/* Process the WINED3DSIO_LOG instruction in GLSL (dst = log2(|src0|))
* Src0 is a scalar. Note that D3D uses the absolute of src0, while
* GLSL uses the value as-is. */
void
shader_glsl_log
(
SHADER_OPCODE_ARG
*
arg
)
{
SHADER_BUFFER
*
buffer
=
arg
->
buffer
;
glsl_src_param_t
src0_param
;
DWORD
dst_write_mask
;
size_t
dst_size
;
dst_write_mask
=
shader_glsl_append_dst
(
buffer
,
arg
);
dst_size
=
shader_glsl_get_write_mask_size
(
dst_write_mask
);
shader_glsl_add_src_param
(
arg
,
arg
->
src
[
0
],
arg
->
src_addr
[
0
],
WINED3DSP_WRITEMASK_0
,
&
src0_param
);
if
(
dst_size
>
1
)
{
shader_addline
(
buffer
,
"vec%d(log2(abs(%s))));
\n
"
,
dst_size
,
src0_param
.
param_str
);
}
else
{
shader_addline
(
buffer
,
"log2(abs(%s)));
\n
"
,
src0_param
.
param_str
);
}
}
/* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */
void
shader_glsl_map2gl
(
SHADER_OPCODE_ARG
*
arg
)
{
CONST
SHADER_OPCODE
*
curOpcode
=
arg
->
opcode
;
...
...
dlls/wined3d/pixelshader.c
View file @
3d3369a7
...
...
@@ -167,7 +167,7 @@ CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
{
WINED3DSIO_SGE
,
"sge"
,
"SGE"
,
1
,
3
,
pshader_hw_map2gl
,
shader_glsl_compare
,
0
,
0
},
{
WINED3DSIO_ABS
,
"abs"
,
"ABS"
,
1
,
2
,
pshader_hw_map2gl
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_EXP
,
"exp"
,
"EX2"
,
1
,
2
,
pshader_hw_map2gl
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_LOG
,
"log"
,
"LG2"
,
1
,
2
,
pshader_hw_map2gl
,
shader_glsl_
map2gl
,
0
,
0
},
{
WINED3DSIO_LOG
,
"log"
,
"LG2"
,
1
,
2
,
pshader_hw_map2gl
,
shader_glsl_
log
,
0
,
0
},
{
WINED3DSIO_EXPP
,
"expp"
,
"EXP"
,
1
,
2
,
pshader_hw_map2gl
,
shader_glsl_expp
,
0
,
0
},
{
WINED3DSIO_LOGP
,
"logp"
,
"LOG"
,
1
,
2
,
pshader_hw_map2gl
,
shader_glsl_map2gl
,
0
,
0
},
{
WINED3DSIO_DST
,
"dst"
,
"DST"
,
1
,
3
,
pshader_hw_map2gl
,
shader_glsl_dst
,
0
,
0
},
...
...
dlls/wined3d/wined3d_private.h
View file @
3d3369a7
...
...
@@ -1839,6 +1839,7 @@ extern void shader_glsl_call(SHADER_OPCODE_ARG* arg);
extern
void
shader_glsl_callnz
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_label
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_pow
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_log
(
SHADER_OPCODE_ARG
*
arg
);
extern
void
shader_glsl_texldl
(
SHADER_OPCODE_ARG
*
arg
);
/** GLSL Pixel Shader Prototypes */
...
...
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