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
079b6d4c
Commit
079b6d4c
authored
Oct 09, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Unify the shader state IDs.
parent
1f22246b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
32 deletions
+38
-32
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+0
-0
ati_fragment_shader.c
dlls/wined3d/ati_fragment_shader.c
+2
-2
cs.c
dlls/wined3d/cs.c
+4
-4
glsl_shader.c
dlls/wined3d/glsl_shader.c
+0
-0
nvidia_texture_shader.c
dlls/wined3d/nvidia_texture_shader.c
+2
-2
state.c
dlls/wined3d/state.c
+8
-8
utils.c
dlls/wined3d/utils.c
+17
-6
wined3d_private.h
dlls/wined3d/wined3d_private.h
+5
-10
No files found.
dlls/wined3d/arb_program_shader.c
View file @
079b6d4c
This diff is collapsed.
Click to expand it.
dlls/wined3d/ati_fragment_shader.c
View file @
079b6d4c
...
...
@@ -922,7 +922,7 @@ static void set_bumpmat(struct wined3d_context *context, const struct wined3d_st
static
void
textransform
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
if
(
!
isStateDirty
(
context
,
STATE_
PIXELSHADER
))
if
(
!
isStateDirty
(
context
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
)
))
set_tex_op_atifs
(
context
,
state
,
state_id
);
}
...
...
@@ -1081,7 +1081,7 @@ static const struct StateEntryTemplate atifs_fragmentstate_template[] = {
{
STATE_TEXTURESTAGE
(
5
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
{
STATE_TEXTURESTAGE
(
5
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
textransform
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
6
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
{
STATE_TEXTURESTAGE
(
6
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
textransform
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
),
textransform
},
WINED3D_GL_EXT_NONE
},
{
STATE_
PIXELSHADER
,
{
STATE_PIXELSHADER
,
atifs_apply_pixelshader
},
WINED3D_GL_EXT_NONE
},
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
atifs_apply_pixelshader
},
WINED3D_GL_EXT_NONE
},
{
0
/* Terminate */
,
{
0
,
0
},
WINED3D_GL_EXT_NONE
},
};
...
...
dlls/wined3d/cs.c
View file @
079b6d4c
...
...
@@ -509,7 +509,7 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data)
op
->
texture
->
sampler
=
op
->
stage
;
if
(
!
prev
||
op
->
texture
->
target
!=
prev
->
target
)
device_invalidate_state
(
cs
->
device
,
STATE_
PIXELSHADER
);
device_invalidate_state
(
cs
->
device
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
)
);
if
(
!
prev
&&
op
->
stage
<
d3d_info
->
limits
.
ffp_blend_stages
)
{
...
...
@@ -568,7 +568,7 @@ static void wined3d_cs_exec_set_vertex_shader(struct wined3d_cs *cs, const void
const
struct
wined3d_cs_set_shader
*
op
=
data
;
cs
->
state
.
vertex_shader
=
op
->
shader
;
device_invalidate_state
(
cs
->
device
,
STATE_
VSHADER
);
device_invalidate_state
(
cs
->
device
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_VERTEX
)
);
}
void
wined3d_cs_emit_set_vertex_shader
(
struct
wined3d_cs
*
cs
,
struct
wined3d_shader
*
shader
)
...
...
@@ -587,7 +587,7 @@ static void wined3d_cs_exec_set_geometry_shader(struct wined3d_cs *cs, const voi
const
struct
wined3d_cs_set_shader
*
op
=
data
;
cs
->
state
.
geometry_shader
=
op
->
shader
;
device_invalidate_state
(
cs
->
device
,
STATE_
GEOMETRY_SHADER
);
device_invalidate_state
(
cs
->
device
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_GEOMETRY
)
);
}
void
wined3d_cs_emit_set_geometry_shader
(
struct
wined3d_cs
*
cs
,
struct
wined3d_shader
*
shader
)
...
...
@@ -606,7 +606,7 @@ static void wined3d_cs_exec_set_pixel_shader(struct wined3d_cs *cs, const void *
const
struct
wined3d_cs_set_shader
*
op
=
data
;
cs
->
state
.
pixel_shader
=
op
->
shader
;
device_invalidate_state
(
cs
->
device
,
STATE_
PIXELSHADER
);
device_invalidate_state
(
cs
->
device
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
)
);
}
void
wined3d_cs_emit_set_pixel_shader
(
struct
wined3d_cs
*
cs
,
struct
wined3d_shader
*
shader
)
...
...
dlls/wined3d/glsl_shader.c
View file @
079b6d4c
This diff is collapsed.
Click to expand it.
dlls/wined3d/nvidia_texture_shader.c
View file @
079b6d4c
...
...
@@ -861,8 +861,8 @@ static const struct StateEntryTemplate nvrc_fragmentstate_template[] =
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_COLOR_ARG0
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_COLOR_OP
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_ALPHA_ARG0
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_ALPHA_OP
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_RESULT_ARG
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_COLOR_OP
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_
PIXELSHADER
,
{
STATE_PIXELSHADER
,
apply_pixelshader
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
{
STATE_
PIXELSHADER
,
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
apply_pixelshader
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
nvrc_texfactor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
state_fogcolor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
state_fogdensity
},
WINED3D_GL_EXT_NONE
},
...
...
dlls/wined3d/state.c
View file @
079b6d4c
...
...
@@ -5092,15 +5092,15 @@ const struct StateEntryTemplate misc_state_template[] = {
{
STATE_BASEVERTEXINDEX
,
{
STATE_BASEVERTEXINDEX
,
state_nop
,
},
ARB_DRAW_ELEMENTS_BASE_VERTEX
},
{
STATE_BASEVERTEXINDEX
,
{
STATE_STREAMSRC
,
NULL
,
},
WINED3D_GL_EXT_NONE
},
{
STATE_FRAMEBUFFER
,
{
STATE_FRAMEBUFFER
,
context_state_fb
},
WINED3D_GL_EXT_NONE
},
{
STATE_
PIXELSHADER
,
{
STATE_PIXELSHADER
,
context_state_drawbuf
},
WINED3D_GL_EXT_NONE
},
{
STATE_
GEOMETRY_SHADER
,
{
STATE_GEOMETRY_SHADER
,
state_geometry_shader
},
WINED3D_GL_EXT_NONE
},
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
context_state_drawbuf
},
WINED3D_GL_EXT_NONE
},
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_GEOMETRY
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_GEOMETRY
),
state_geometry_shader
},
WINED3D_GL_EXT_NONE
},
{
0
/* Terminate */
,
{
0
,
0
},
WINED3D_GL_EXT_NONE
},
};
const
struct
StateEntryTemplate
vp_ffp_states
[]
=
{
{
STATE_VDECL
,
{
STATE_VDECL
,
vertexdeclaration
},
WINED3D_GL_EXT_NONE
},
{
STATE_
VSHADER
,
{
STATE_VDECL
,
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_VERTEX
),
{
STATE_VDECL
,
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_MATERIAL
,
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
{
STATE_RENDER
(
WINED3D_RS_SPECULARENABLE
),
state_specularenable
},
WINED3D_GL_EXT_NONE
},
/* Clip planes */
...
...
@@ -5578,8 +5578,8 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = {
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_ALPHA_ARG0
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_ALPHA_OP
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_RESULT_ARG
),
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_COLOR_OP
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_TEXTURESTAGE
(
7
,
WINED3D_TSS_CONSTANT
),
{
0
/* As long as we don't support D3DTA_CONSTANT */
,
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_
PIXELSHADER
,
{
STATE_PIXELSHADER
,
apply_pixelshader
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
{
STATE_
PIXELSHADER
,
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
{
STATE_SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
apply_pixelshader
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_SRGBWRITEENABLE
),
{
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
{
STATE_RENDER
(
WINED3D_RS_TEXTUREFACTOR
),
state_texfactor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
{
STATE_RENDER
(
WINED3D_RS_FOGCOLOR
),
state_fogcolor
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
{
STATE_RENDER
(
WINED3D_RS_FOGDENSITY
),
state_fogdensity
},
WINED3D_GL_EXT_NONE
},
...
...
@@ -5828,9 +5828,9 @@ static void validate_state_table(struct StateEntry *state_table)
STATE_VDECL
,
STATE_STREAMSRC
,
STATE_INDEXBUFFER
,
STATE_
VSHADER
,
STATE_
GEOMETRY_SHADER
,
STATE_
PIXELSHADER
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_VERTEX
)
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_GEOMETRY
)
,
STATE_
SHADER
(
WINED3D_SHADER_TYPE_PIXEL
)
,
STATE_VIEWPORT
,
STATE_LIGHT_TYPE
,
STATE_SCISSORRECT
,
...
...
dlls/wined3d/utils.c
View file @
079b6d4c
...
...
@@ -2626,6 +2626,21 @@ const char *debug_d3dtstype(enum wined3d_transform_state tstype)
}
}
static
const
char
*
debug_shader_type
(
enum
wined3d_shader_type
type
)
{
switch
(
type
)
{
#define WINED3D_TO_STR(type) case type: return #type
WINED3D_TO_STR
(
WINED3D_SHADER_TYPE_PIXEL
);
WINED3D_TO_STR
(
WINED3D_SHADER_TYPE_VERTEX
);
WINED3D_TO_STR
(
WINED3D_SHADER_TYPE_GEOMETRY
);
#undef WINED3D_TO_STR
default:
FIXME
(
"Unrecognized shader type %#x.
\n
"
,
type
);
return
"unrecognized"
;
}
}
const
char
*
debug_d3dstate
(
DWORD
state
)
{
if
(
STATE_IS_RENDER
(
state
))
...
...
@@ -2639,8 +2654,8 @@ const char *debug_d3dstate(DWORD state)
}
if
(
STATE_IS_SAMPLER
(
state
))
return
wine_dbg_sprintf
(
"STATE_SAMPLER(%#x)"
,
state
-
STATE_SAMPLER
(
0
));
if
(
STATE_IS_
PIXEL
SHADER
(
state
))
return
"STATE_PIXELSHADER"
;
if
(
STATE_IS_SHADER
(
state
))
return
wine_dbg_sprintf
(
"STATE_SHADER(%s)"
,
debug_shader_type
(
state
-
STATE_SHADER
(
0
)))
;
if
(
STATE_IS_TRANSFORM
(
state
))
return
wine_dbg_sprintf
(
"STATE_TRANSFORM(%s)"
,
debug_d3dtstype
(
state
-
STATE_TRANSFORM
(
0
)));
if
(
STATE_IS_STREAMSRC
(
state
))
...
...
@@ -2649,10 +2664,6 @@ const char *debug_d3dstate(DWORD state)
return
"STATE_INDEXBUFFER"
;
if
(
STATE_IS_VDECL
(
state
))
return
"STATE_VDECL"
;
if
(
STATE_IS_VSHADER
(
state
))
return
"STATE_VSHADER"
;
if
(
STATE_IS_GEOMETRY_SHADER
(
state
))
return
"STATE_GEOMETRY_SHADER"
;
if
(
STATE_IS_VIEWPORT
(
state
))
return
"STATE_VIEWPORT"
;
if
(
STATE_IS_LIGHT_TYPE
(
state
))
...
...
dlls/wined3d/wined3d_private.h
View file @
079b6d4c
...
...
@@ -542,6 +542,7 @@ enum wined3d_shader_type
WINED3D_SHADER_TYPE_PIXEL
,
WINED3D_SHADER_TYPE_VERTEX
,
WINED3D_SHADER_TYPE_GEOMETRY
,
WINED3D_SHADER_TYPE_COUNT
,
};
struct
wined3d_shader_version
...
...
@@ -954,10 +955,10 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
#define STATE_SAMPLER(num) (STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num))
#define STATE_IS_SAMPLER(num) ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(MAX_COMBINED_SAMPLERS - 1))
#define STATE_
PIXELSHADER (STATE_SAMPLER(MAX_COMBINED_SAMPLERS - 1) + 1
)
#define STATE_IS_
PIXELSHADER(a) ((a) == STATE_PIXELSHADER
)
#define STATE_
SHADER(a) (STATE_SAMPLER(MAX_COMBINED_SAMPLERS) + (a)
)
#define STATE_IS_
SHADER(a) ((a) >= STATE_SHADER(0) && (a) < STATE_SHADER(WINED3D_SHADER_TYPE_COUNT)
)
#define STATE_TRANSFORM(a) (STATE_
PIXELSHADER + (a)
)
#define STATE_TRANSFORM(a) (STATE_
SHADER(WINED3D_SHADER_TYPE_COUNT) + (a) - 1
)
#define STATE_IS_TRANSFORM(a) ((a) >= STATE_TRANSFORM(1) && (a) <= STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(255)))
#define STATE_STREAMSRC (STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(255)) + 1)
...
...
@@ -968,13 +969,7 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) DECLSPEC_HIDDEN;
#define STATE_VDECL (STATE_INDEXBUFFER + 1)
#define STATE_IS_VDECL(a) ((a) == STATE_VDECL)
#define STATE_VSHADER (STATE_VDECL + 1)
#define STATE_IS_VSHADER(a) ((a) == STATE_VSHADER)
#define STATE_GEOMETRY_SHADER (STATE_VSHADER + 1)
#define STATE_IS_GEOMETRY_SHADER(a) ((a) == STATE_GEOMETRY_SHADER)
#define STATE_VIEWPORT (STATE_GEOMETRY_SHADER + 1)
#define STATE_VIEWPORT (STATE_VDECL + 1)
#define STATE_IS_VIEWPORT(a) ((a) == STATE_VIEWPORT)
#define STATE_LIGHT_TYPE (STATE_VIEWPORT + 1)
...
...
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