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
6e970c5d
Commit
6e970c5d
authored
Apr 09, 2009
by
Tobias Jakobi
Committed by
Alexandre Julliard
Apr 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: glsl: Enable load_np2fixup_constants.
parent
9b067a6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
23 deletions
+42
-23
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+6
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+33
-19
state.c
dlls/wined3d/state.c
+3
-4
No files found.
dlls/wined3d/arb_program_shader.c
View file @
6e970c5d
...
...
@@ -670,6 +670,12 @@ static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD
}
else
{
tex_type
=
"2D"
;
}
if
(
shader_is_pshader_version
(
ins
->
reg_maps
->
shader_version
))
{
const
IWineD3DPixelShaderImpl
*
const
ps
=
(
const
IWineD3DPixelShaderImpl
*
)
This
;
if
(
ps
->
cur_args
->
texrect_fixup
&
(
1
<<
sampler_idx
))
{
FIXME
(
"NP2 texcoord fixup is currently not implemented in ARB mode (use GLSL instead)."
);
}
}
break
;
case
WINED3DSTT_VOLUME
:
...
...
dlls/wined3d/glsl_shader.c
View file @
6e970c5d
...
...
@@ -489,7 +489,39 @@ static void shader_glsl_load_np2fixup_constants(
IWineD3DDevice
*
device
,
char
usePixelShader
,
char
useVertexShader
)
{
/* not implemented */
const
IWineD3DDeviceImpl
*
deviceImpl
=
(
const
IWineD3DDeviceImpl
*
)
device
;
const
struct
glsl_shader_prog_link
*
prog
=
((
struct
shader_glsl_priv
*
)(
deviceImpl
->
shader_priv
))
->
glsl_program
;
if
(
!
prog
)
{
/* No GLSL program set - nothing to do. */
return
;
}
if
(
!
usePixelShader
)
{
/* NP2 texcoord fixup is (currently) only done for pixelshaders. */
return
;
}
if
(
prog
->
ps_args
.
texrect_fixup
)
{
UINT
i
;
UINT
fixup
=
prog
->
ps_args
.
texrect_fixup
;
const
WineD3D_GL_Info
*
gl_info
=
&
deviceImpl
->
adapter
->
gl_info
;
const
IWineD3DStateBlockImpl
*
stateBlock
=
(
const
IWineD3DStateBlockImpl
*
)
deviceImpl
->
stateBlock
;
for
(
i
=
0
;
fixup
;
fixup
>>=
1
,
++
i
)
{
if
(
-
1
!=
prog
->
rectFixup_location
[
i
])
{
const
IWineD3DBaseTextureImpl
*
const
tex
=
(
const
IWineD3DBaseTextureImpl
*
)
stateBlock
->
textures
[
i
];
if
(
!
tex
)
{
FIXME
(
"Non-existant texture is flagged for NP2 texcoord fixup
\n
"
);
continue
;
}
else
{
const
float
tex_dim
[
2
]
=
{
tex
->
baseTexture
.
pow2Matrix
[
0
],
tex
->
baseTexture
.
pow2Matrix
[
5
]};
GL_EXTCALL
(
glUniform2fvARB
(
prog
->
rectFixup_location
[
i
],
1
,
tex_dim
));
}
}
}
}
}
/**
...
...
@@ -598,24 +630,6 @@ static void shader_glsl_load_constants(
}
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
ycorrection_location
,
1
,
correction_params
));
}
/* Constant loading for texture rect coord fixup. */
if
(
prog
->
ps_args
.
texrect_fixup
)
{
UINT
fixup
=
prog
->
ps_args
.
texrect_fixup
;
for
(
i
=
0
;
fixup
;
fixup
>>=
1
,
++
i
)
{
if
(
-
1
!=
prog
->
rectFixup_location
[
i
])
{
const
IWineD3DBaseTextureImpl
*
const
tex
=
(
const
IWineD3DBaseTextureImpl
*
)
stateBlock
->
textures
[
i
];
if
(
!
tex
)
{
FIXME
(
"Non-existant texture is flagged for NP2 texcoord fixup
\n
"
);
continue
;
}
else
{
const
float
tex_dim
[
2
]
=
{
tex
->
baseTexture
.
pow2Matrix
[
0
],
tex
->
baseTexture
.
pow2Matrix
[
5
]};
GL_EXTCALL
(
glUniform2fvARB
(
prog
->
rectFixup_location
[
i
],
1
,
tex_dim
));
}
}
}
}
}
if
(
priv
->
next_constant_version
==
UINT_MAX
)
...
...
dlls/wined3d/state.c
View file @
6e970c5d
...
...
@@ -3367,11 +3367,10 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
/* Trigger shader constant reloading (for NP2 texcoord fixup)
* Only do this if pshaders are used (note: fixup is currently only implemented in GLSL). */
if
(
!
tex_impl
->
baseTexture
.
pow2Matrix_identity
&&
use_ps
(
stateblock
)
)
{
if
(
!
tex_impl
->
baseTexture
.
pow2Matrix_identity
)
{
IWineD3DDeviceImpl
*
d3ddevice
=
stateblock
->
wineD3DDevice
;
/* FIXME: add something like shader_load_rectfixup_consts to the backend to only reload the
* constants that are used for the fixup (and not the other ones too) */
d3ddevice
->
shader_backend
->
shader_load_constants
((
IWineD3DDevice
*
)
d3ddevice
,
use_ps
(
stateblock
),
use_vs
(
stateblock
));
d3ddevice
->
shader_backend
->
shader_load_np2fixup_constants
(
(
IWineD3DDevice
*
)
d3ddevice
,
use_ps
(
stateblock
),
use_vs
(
stateblock
));
}
}
else
if
(
mapped_stage
<
GL_LIMITS
(
textures
))
{
if
(
sampler
<
stateblock
->
lowest_disabled_stage
)
{
...
...
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