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
0c2514bd
Commit
0c2514bd
authored
Apr 09, 2009
by
Tobias Jakobi
Committed by
Alexandre Julliard
Apr 13, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rename some NP2 fixup variables and update comments.
parent
9657e814
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
26 deletions
+26
-26
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+21
-21
pixelshader.c
dlls/wined3d/pixelshader.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
No files found.
dlls/wined3d/arb_program_shader.c
View file @
0c2514bd
...
@@ -672,7 +672,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
...
@@ -672,7 +672,7 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
}
}
if
(
shader_is_pshader_version
(
ins
->
reg_maps
->
shader_version
))
{
if
(
shader_is_pshader_version
(
ins
->
reg_maps
->
shader_version
))
{
const
IWineD3DPixelShaderImpl
*
const
ps
=
(
const
IWineD3DPixelShaderImpl
*
)
This
;
const
IWineD3DPixelShaderImpl
*
const
ps
=
(
const
IWineD3DPixelShaderImpl
*
)
This
;
if
(
ps
->
cur_args
->
texrect
_fixup
&
(
1
<<
sampler_idx
))
{
if
(
ps
->
cur_args
->
np2
_fixup
&
(
1
<<
sampler_idx
))
{
FIXME
(
"NP2 texcoord fixup is currently not implemented in ARB mode (use GLSL instead).
\n
"
);
FIXME
(
"NP2 texcoord fixup is currently not implemented in ARB mode (use GLSL instead).
\n
"
);
}
}
}
}
...
...
dlls/wined3d/glsl_shader.c
View file @
0c2514bd
...
@@ -100,7 +100,7 @@ struct glsl_shader_prog_link {
...
@@ -100,7 +100,7 @@ struct glsl_shader_prog_link {
GLint
vuniformI_locations
[
MAX_CONST_I
];
GLint
vuniformI_locations
[
MAX_CONST_I
];
GLint
puniformI_locations
[
MAX_CONST_I
];
GLint
puniformI_locations
[
MAX_CONST_I
];
GLint
posFixup_location
;
GLint
posFixup_location
;
GLint
rect
Fixup_location
[
MAX_FRAGMENT_SAMPLERS
];
GLint
np2
Fixup_location
[
MAX_FRAGMENT_SAMPLERS
];
GLint
bumpenvmat_location
[
MAX_TEXTURES
];
GLint
bumpenvmat_location
[
MAX_TEXTURES
];
GLint
luminancescale_location
[
MAX_TEXTURES
];
GLint
luminancescale_location
[
MAX_TEXTURES
];
GLint
luminanceoffset_location
[
MAX_TEXTURES
];
GLint
luminanceoffset_location
[
MAX_TEXTURES
];
...
@@ -503,21 +503,21 @@ static void shader_glsl_load_np2fixup_constants(
...
@@ -503,21 +503,21 @@ static void shader_glsl_load_np2fixup_constants(
return
;
return
;
}
}
if
(
prog
->
ps_args
.
texrect
_fixup
)
{
if
(
prog
->
ps_args
.
np2
_fixup
)
{
UINT
i
;
UINT
i
;
UINT
fixup
=
prog
->
ps_args
.
texrect
_fixup
;
UINT
fixup
=
prog
->
ps_args
.
np2
_fixup
;
const
WineD3D_GL_Info
*
gl_info
=
&
deviceImpl
->
adapter
->
gl_info
;
const
WineD3D_GL_Info
*
gl_info
=
&
deviceImpl
->
adapter
->
gl_info
;
const
IWineD3DStateBlockImpl
*
stateBlock
=
(
const
IWineD3DStateBlockImpl
*
)
deviceImpl
->
stateBlock
;
const
IWineD3DStateBlockImpl
*
stateBlock
=
(
const
IWineD3DStateBlockImpl
*
)
deviceImpl
->
stateBlock
;
for
(
i
=
0
;
fixup
;
fixup
>>=
1
,
++
i
)
{
for
(
i
=
0
;
fixup
;
fixup
>>=
1
,
++
i
)
{
if
(
-
1
!=
prog
->
rect
Fixup_location
[
i
])
{
if
(
-
1
!=
prog
->
np2
Fixup_location
[
i
])
{
const
IWineD3DBaseTextureImpl
*
const
tex
=
(
const
IWineD3DBaseTextureImpl
*
)
stateBlock
->
textures
[
i
];
const
IWineD3DBaseTextureImpl
*
const
tex
=
(
const
IWineD3DBaseTextureImpl
*
)
stateBlock
->
textures
[
i
];
if
(
!
tex
)
{
if
(
!
tex
)
{
FIXME
(
"Non-existant texture is flagged for NP2 texcoord fixup
\n
"
);
FIXME
(
"Non-existant texture is flagged for NP2 texcoord fixup
\n
"
);
continue
;
continue
;
}
else
{
}
else
{
const
float
tex_dim
[
2
]
=
{
tex
->
baseTexture
.
pow2Matrix
[
0
],
tex
->
baseTexture
.
pow2Matrix
[
5
]};
const
float
tex_dim
[
2
]
=
{
tex
->
baseTexture
.
pow2Matrix
[
0
],
tex
->
baseTexture
.
pow2Matrix
[
5
]};
GL_EXTCALL
(
glUniform2fvARB
(
prog
->
rect
Fixup_location
[
i
],
1
,
tex_dim
));
GL_EXTCALL
(
glUniform2fvARB
(
prog
->
np2
Fixup_location
[
i
],
1
,
tex_dim
));
}
}
}
}
}
}
...
@@ -825,12 +825,12 @@ static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const s
...
@@ -825,12 +825,12 @@ static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const s
shader_addline
(
buffer
,
"uniform sampler2D %csampler%u;
\n
"
,
prefix
,
i
);
shader_addline
(
buffer
,
"uniform sampler2D %csampler%u;
\n
"
,
prefix
,
i
);
}
}
if
(
ps_args
->
texrect
_fixup
&
(
1
<<
i
))
{
if
(
ps_args
->
np2
_fixup
&
(
1
<<
i
))
{
/* RECT textures in OpenGL use texcoords in the range [0,width]x[0,height]
/*
NP2/
RECT textures in OpenGL use texcoords in the range [0,width]x[0,height]
* while D3D has them in the (normalized) [0,1]x[0,1] range.
* while D3D has them in the (normalized) [0,1]x[0,1] range.
* sampler
Rect
Fixup stores texture dimensions and is updated through
* sampler
NP2
Fixup stores texture dimensions and is updated through
* shader_glsl_load_constants when the sampler changes. */
* shader_glsl_load_
np2fixup_
constants when the sampler changes. */
shader_addline
(
buffer
,
"uniform vec2 %csampler
Rect
Fixup%u;
\n
"
,
prefix
,
i
);
shader_addline
(
buffer
,
"uniform vec2 %csampler
NP2
Fixup%u;
\n
"
,
prefix
,
i
);
}
}
break
;
break
;
case
WINED3DSTT_CUBE
:
case
WINED3DSTT_CUBE
:
...
@@ -1549,7 +1549,7 @@ static void PRINTF_ATTR(6, 7) shader_glsl_gen_sample_code(const struct wined3d_s
...
@@ -1549,7 +1549,7 @@ static void PRINTF_ATTR(6, 7) shader_glsl_gen_sample_code(const struct wined3d_s
const
char
*
sampler_base
;
const
char
*
sampler_base
;
char
dst_swizzle
[
6
];
char
dst_swizzle
[
6
];
struct
color_fixup_desc
fixup
;
struct
color_fixup_desc
fixup
;
BOOL
rect
_fixup
=
FALSE
;
BOOL
np2
_fixup
=
FALSE
;
va_list
args
;
va_list
args
;
shader_glsl_get_swizzle
(
swizzle
,
FALSE
,
ins
->
dst
[
0
].
write_mask
,
dst_swizzle
);
shader_glsl_get_swizzle
(
swizzle
,
FALSE
,
ins
->
dst
[
0
].
write_mask
,
dst_swizzle
);
...
@@ -1560,11 +1560,11 @@ static void PRINTF_ATTR(6, 7) shader_glsl_gen_sample_code(const struct wined3d_s
...
@@ -1560,11 +1560,11 @@ static void PRINTF_ATTR(6, 7) shader_glsl_gen_sample_code(const struct wined3d_s
fixup
=
This
->
cur_args
->
color_fixup
[
sampler
];
fixup
=
This
->
cur_args
->
color_fixup
[
sampler
];
sampler_base
=
"Psampler"
;
sampler_base
=
"Psampler"
;
if
(
This
->
cur_args
->
texrect
_fixup
&
(
1
<<
sampler
))
{
if
(
This
->
cur_args
->
np2
_fixup
&
(
1
<<
sampler
))
{
if
(
bias
)
{
if
(
bias
)
{
FIXME
(
"Biased sampling from
RECT
textures is unsupported
\n
"
);
FIXME
(
"Biased sampling from
NP2
textures is unsupported
\n
"
);
}
else
{
}
else
{
rect
_fixup
=
TRUE
;
np2
_fixup
=
TRUE
;
}
}
}
}
}
else
{
}
else
{
...
@@ -1583,8 +1583,8 @@ static void PRINTF_ATTR(6, 7) shader_glsl_gen_sample_code(const struct wined3d_s
...
@@ -1583,8 +1583,8 @@ static void PRINTF_ATTR(6, 7) shader_glsl_gen_sample_code(const struct wined3d_s
if
(
bias
)
{
if
(
bias
)
{
shader_addline
(
ins
->
buffer
,
", %s)%s);
\n
"
,
bias
,
dst_swizzle
);
shader_addline
(
ins
->
buffer
,
", %s)%s);
\n
"
,
bias
,
dst_swizzle
);
}
else
{
}
else
{
if
(
rect
_fixup
)
{
if
(
np2
_fixup
)
{
shader_addline
(
ins
->
buffer
,
" * Psampler
Rect
Fixup%u)%s);
\n
"
,
sampler
,
dst_swizzle
);
shader_addline
(
ins
->
buffer
,
" * Psampler
NP2
Fixup%u)%s);
\n
"
,
sampler
,
dst_swizzle
);
}
else
{
}
else
{
shader_addline
(
ins
->
buffer
,
")%s);
\n
"
,
dst_swizzle
);
shader_addline
(
ins
->
buffer
,
")%s);
\n
"
,
dst_swizzle
);
}
}
...
@@ -3595,14 +3595,14 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use
...
@@ -3595,14 +3595,14 @@ static void set_glsl_shader_program(IWineD3DDevice *iface, BOOL use_ps, BOOL use
}
}
}
}
if
(
use_ps
&&
ps_compile_args
.
texrect
_fixup
)
{
if
(
use_ps
&&
ps_compile_args
.
np2
_fixup
)
{
char
name
[
32
];
char
name
[
32
];
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
++
i
)
{
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
++
i
)
{
if
(
ps_compile_args
.
texrect
_fixup
&
(
1
<<
i
))
{
if
(
ps_compile_args
.
np2
_fixup
&
(
1
<<
i
))
{
sprintf
(
name
,
"Psampler
Rect
Fixup%u"
,
i
);
sprintf
(
name
,
"Psampler
NP2
Fixup%u"
,
i
);
entry
->
rect
Fixup_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
entry
->
np2
Fixup_location
[
i
]
=
GL_EXTCALL
(
glGetUniformLocationARB
(
programId
,
name
));
}
else
{
}
else
{
entry
->
rect
Fixup_location
[
i
]
=
-
1
;
entry
->
np2
Fixup_location
[
i
]
=
-
1
;
}
}
}
}
}
}
...
...
dlls/wined3d/pixelshader.c
View file @
0c2514bd
...
@@ -460,7 +460,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
...
@@ -460,7 +460,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
memset
(
args
,
0
,
sizeof
(
*
args
));
/* FIXME: Make sure all bits are set */
memset
(
args
,
0
,
sizeof
(
*
args
));
/* FIXME: Make sure all bits are set */
args
->
srgb_correction
=
stateblock
->
renderState
[
WINED3DRS_SRGBWRITEENABLE
]
?
1
:
0
;
args
->
srgb_correction
=
stateblock
->
renderState
[
WINED3DRS_SRGBWRITEENABLE
]
?
1
:
0
;
args
->
texrect
_fixup
=
0
;
args
->
np2
_fixup
=
0
;
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
i
++
)
{
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
i
++
)
{
if
(
shader
->
baseShader
.
reg_maps
.
samplers
[
i
]
==
0
)
continue
;
if
(
shader
->
baseShader
.
reg_maps
.
samplers
[
i
]
==
0
)
continue
;
...
@@ -473,7 +473,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
...
@@ -473,7 +473,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
/* Flag samplers that need NP2 texcoord fixup. */
/* Flag samplers that need NP2 texcoord fixup. */
if
(
!
tex
->
baseTexture
.
pow2Matrix_identity
)
{
if
(
!
tex
->
baseTexture
.
pow2Matrix_identity
)
{
args
->
texrect
_fixup
|=
(
1
<<
i
);
args
->
np2
_fixup
|=
(
1
<<
i
);
}
}
}
}
if
(
shader
->
baseShader
.
reg_maps
.
shader_version
>=
WINED3DPS_VERSION
(
3
,
0
))
if
(
shader
->
baseShader
.
reg_maps
.
shader_version
>=
WINED3DPS_VERSION
(
3
,
0
))
...
...
dlls/wined3d/wined3d_private.h
View file @
0c2514bd
...
@@ -538,8 +538,8 @@ struct ps_compile_args {
...
@@ -538,8 +538,8 @@ struct ps_compile_args {
/* Projected textures(ps 1.0-1.3) */
/* Projected textures(ps 1.0-1.3) */
/* Texture types(2D, Cube, 3D) in ps 1.x */
/* Texture types(2D, Cube, 3D) in ps 1.x */
BOOL
srgb_correction
;
BOOL
srgb_correction
;
WORD
texrect
_fixup
;
WORD
np2
_fixup
;
/* Bitmap for
texture rect
coord fixups (16 samplers max currently).
/* Bitmap for
NP2 tex
coord fixups (16 samplers max currently).
D3D9 has a limit of 16 samplers and the fixup is superfluous
D3D9 has a limit of 16 samplers and the fixup is superfluous
in D3D10 (unconditional NP2 support mandatory). */
in D3D10 (unconditional NP2 support mandatory). */
};
};
...
...
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