Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0680b175
Commit
0680b175
authored
Apr 13, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Store ps 1.4 texture types in ps_compile_args.
parent
547be26d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
27 deletions
+56
-27
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+1
-2
shader.c
dlls/wined3d/shader.c
+40
-21
wined3d_private.h
dlls/wined3d/wined3d_private.h
+14
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
0680b175
...
...
@@ -4354,7 +4354,7 @@ static struct arb_ps_compiled_shader *find_arb_pshader(struct wined3d_shader *sh
shader_data
->
gl_shaders
[
shader_data
->
num_gl_shaders
].
args
=
*
args
;
pixelshader_update_samplers
(
&
shader
->
reg_maps
,
device
->
stateBlock
->
state
.
textur
es
);
pixelshader_update_samplers
(
shader
,
args
->
super
.
tex_typ
es
);
if
(
!
shader_buffer_init
(
&
buffer
))
{
...
...
dlls/wined3d/glsl_shader.c
View file @
0680b175
...
...
@@ -4627,7 +4627,6 @@ static GLhandleARB find_glsl_pshader(const struct wined3d_context *context,
struct
wined3d_shader_buffer
*
buffer
,
struct
wined3d_shader
*
shader
,
const
struct
ps_compile_args
*
args
,
const
struct
ps_np2fixup_info
**
np2fixup_info
)
{
struct
wined3d_state
*
state
=
&
shader
->
device
->
stateBlock
->
state
;
struct
glsl_ps_compiled_shader
*
gl_shaders
,
*
new_array
;
struct
glsl_shader_private
*
shader_data
;
struct
ps_np2fixup_info
*
np2fixup
;
...
...
@@ -4690,7 +4689,7 @@ static GLhandleARB find_glsl_pshader(const struct wined3d_context *context,
memset
(
np2fixup
,
0
,
sizeof
(
*
np2fixup
));
*
np2fixup_info
=
args
->
np2_fixup
?
np2fixup
:
NULL
;
pixelshader_update_samplers
(
&
shader
->
reg_maps
,
state
->
textur
es
);
pixelshader_update_samplers
(
shader
,
args
->
tex_typ
es
);
shader_buffer_clear
(
buffer
);
ret
=
shader_glsl_generate_pshader
(
context
,
buffer
,
shader
,
args
,
np2fixup
);
...
...
dlls/wined3d/shader.c
View file @
0680b175
...
...
@@ -2062,6 +2062,39 @@ void find_ps_compile_args(const struct wined3d_state *state,
}
}
}
if
(
shader
->
reg_maps
.
shader_version
.
major
==
1
&&
shader
->
reg_maps
.
shader_version
.
minor
<=
4
)
{
for
(
i
=
0
;
i
<
shader
->
limits
.
sampler
;
++
i
)
{
const
struct
wined3d_texture
*
texture
=
state
->
textures
[
i
];
if
(
!
shader
->
reg_maps
.
sampler_type
[
i
])
continue
;
/* Treat unbound textures as 2D. The dummy texture will provide
* the proper sample value. The tex_types bitmap defaults to
* 2D because of the memset. */
if
(
!
texture
)
continue
;
switch
(
texture
->
target
)
{
/* RECT textures are distinguished from 2D textures via np2_fixup */
case
GL_TEXTURE_RECTANGLE_ARB
:
case
GL_TEXTURE_2D
:
break
;
case
GL_TEXTURE_3D
:
args
->
tex_types
|=
WINED3D_SHADER_TEX_3D
<<
i
*
WINED3D_PSARGS_TEXTYPE_SHIFT
;
break
;
case
GL_TEXTURE_CUBE_MAP_ARB
:
args
->
tex_types
|=
WINED3D_SHADER_TEX_CUBE
<<
i
*
WINED3D_PSARGS_TEXTYPE_SHIFT
;
break
;
}
}
}
for
(
i
=
0
;
i
<
MAX_FRAGMENT_SAMPLERS
;
++
i
)
{
...
...
@@ -2274,46 +2307,32 @@ static HRESULT pixelshader_init(struct wined3d_shader *shader, struct wined3d_de
return
WINED3D_OK
;
}
void
pixelshader_update_samplers
(
struct
wined3d_shader
_reg_maps
*
reg_maps
,
struct
wined3d_texture
*
const
*
textur
es
)
void
pixelshader_update_samplers
(
struct
wined3d_shader
*
shader
,
WORD
tex_typ
es
)
{
struct
wined3d_shader_reg_maps
*
reg_maps
=
&
shader
->
reg_maps
;
enum
wined3d_sampler_texture_type
*
sampler_type
=
reg_maps
->
sampler_type
;
unsigned
int
i
;
if
(
reg_maps
->
shader_version
.
major
!=
1
)
return
;
for
(
i
=
0
;
i
<
max
(
MAX_FRAGMENT_SAMPLERS
,
MAX_VERTEX_SAMPLERS
)
;
++
i
)
for
(
i
=
0
;
i
<
shader
->
limits
.
sampler
;
++
i
)
{
/* We don't sample from this sampler. */
if
(
!
sampler_type
[
i
])
continue
;
if
(
!
textures
[
i
]
)
switch
((
tex_types
>>
i
*
WINED3D_PSARGS_TEXTYPE_SHIFT
)
&
WINED3D_PSARGS_TEXTYPE_MASK
)
{
WARN
(
"No texture bound to sampler %u, using 2D.
\n
"
,
i
);
sampler_type
[
i
]
=
WINED3DSTT_2D
;
continue
;
}
switch
(
textures
[
i
]
->
target
)
{
case
GL_TEXTURE_RECTANGLE_ARB
:
case
GL_TEXTURE_2D
:
/* We have to select between texture rectangles and 2D
* textures later because 2.0 and 3.0 shaders only have
* WINED3DSTT_2D as well. */
case
WINED3D_SHADER_TEX_2D
:
sampler_type
[
i
]
=
WINED3DSTT_2D
;
break
;
case
GL_TEXTURE
_3D
:
case
WINED3D_SHADER_TEX
_3D
:
sampler_type
[
i
]
=
WINED3DSTT_VOLUME
;
break
;
case
GL_TEXTURE_CUBE_MAP_ARB
:
case
WINED3D_SHADER_TEX_CUBE
:
sampler_type
[
i
]
=
WINED3DSTT_CUBE
;
break
;
default:
FIXME
(
"Unrecognized texture type %#x, using 2D.
\n
"
,
textures
[
i
]
->
target
);
sampler_type
[
i
]
=
WINED3DSTT_2D
;
}
}
}
...
...
dlls/wined3d/wined3d_private.h
View file @
0680b175
...
...
@@ -746,13 +746,25 @@ enum fogmode {
#define WINED3D_PSARGS_PROJECTED (1 << 3)
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT 4
#define WINED3D_PSARGS_TEXTRANSFORM_MASK 0xf
#define WINED3D_PSARGS_TEXTYPE_SHIFT 2
#define WINED3D_PSARGS_TEXTYPE_MASK 0x3
/* Similar to tex_types, except that it doesn't have 1d textures
* (can't be bound), rect textures (handled via np2_fixup) and
* none / unknown (treated as 2d and handled via dummy textures). */
enum
wined3d_shader_tex_types
{
WINED3D_SHADER_TEX_2D
=
0
,
WINED3D_SHADER_TEX_3D
=
1
,
WINED3D_SHADER_TEX_CUBE
=
2
,
};
struct
ps_compile_args
{
struct
color_fixup_desc
color_fixup
[
MAX_FRAGMENT_SAMPLERS
];
enum
vertexprocessing_mode
vp_mode
;
enum
fogmode
fog
;
WORD
tex_transform
;
/* ps 1.0-1.3, 4 textures */
/* Texture types(2D, Cube, 3D) in ps 1.x
*/
WORD
tex_types
;
/* ps 1.0 - 1.4, 6 textures
*/
WORD
srgb_correction
;
WORD
np2_fixup
;
/* Bitmap for NP2 texcoord fixups (16 samplers max currently).
...
...
@@ -2635,8 +2647,7 @@ struct wined3d_shader
}
u
;
};
void
pixelshader_update_samplers
(
struct
wined3d_shader_reg_maps
*
reg_maps
,
struct
wined3d_texture
*
const
*
textures
)
DECLSPEC_HIDDEN
;
void
pixelshader_update_samplers
(
struct
wined3d_shader
*
shader
,
WORD
tex_types
)
DECLSPEC_HIDDEN
;
void
find_ps_compile_args
(
const
struct
wined3d_state
*
state
,
const
struct
wined3d_shader
*
shader
,
struct
ps_compile_args
*
args
)
DECLSPEC_HIDDEN
;
...
...
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