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
13efdc6a
Commit
13efdc6a
authored
Nov 13, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Introduce a "state" variable in shader_glsl_load_constants().
parent
a44401af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
glsl_shader.c
dlls/wined3d/glsl_shader.c
+13
-12
No files found.
dlls/wined3d/glsl_shader.c
View file @
13efdc6a
...
@@ -714,6 +714,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
...
@@ -714,6 +714,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
struct
wined3d_device
*
device
=
context
->
swapchain
->
device
;
struct
wined3d_stateblock
*
stateBlock
=
device
->
stateBlock
;
struct
wined3d_stateblock
*
stateBlock
=
device
->
stateBlock
;
const
struct
wined3d_state
*
state
=
&
stateBlock
->
state
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
struct
shader_glsl_priv
*
priv
=
device
->
shader_priv
;
float
position_fixup
[
4
];
float
position_fixup
[
4
];
...
@@ -731,40 +732,40 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
...
@@ -731,40 +732,40 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
if
(
useVertexShader
)
if
(
useVertexShader
)
{
{
const
struct
wined3d_shader
*
vshader
=
state
Block
->
state
.
vertex_shader
;
const
struct
wined3d_shader
*
vshader
=
state
->
vertex_shader
;
/* Load DirectX 9 float constants/uniforms for vertex shader */
/* Load DirectX 9 float constants/uniforms for vertex shader */
shader_glsl_load_constantsF
(
vshader
,
gl_info
,
state
Block
->
state
.
vs_consts_f
,
shader_glsl_load_constantsF
(
vshader
,
gl_info
,
state
->
vs_consts_f
,
prog
->
vuniformF_locations
,
&
priv
->
vconst_heap
,
priv
->
stack
,
constant_version
);
prog
->
vuniformF_locations
,
&
priv
->
vconst_heap
,
priv
->
stack
,
constant_version
);
/* Load DirectX 9 integer constants/uniforms for vertex shader */
/* Load DirectX 9 integer constants/uniforms for vertex shader */
shader_glsl_load_constantsI
(
vshader
,
gl_info
,
prog
->
vuniformI_locations
,
state
Block
->
state
.
vs_consts_i
,
shader_glsl_load_constantsI
(
vshader
,
gl_info
,
prog
->
vuniformI_locations
,
state
->
vs_consts_i
,
stateBlock
->
changed
.
vertexShaderConstantsI
&
vshader
->
reg_maps
.
integer_constants
);
stateBlock
->
changed
.
vertexShaderConstantsI
&
vshader
->
reg_maps
.
integer_constants
);
/* Load DirectX 9 boolean constants/uniforms for vertex shader */
/* Load DirectX 9 boolean constants/uniforms for vertex shader */
shader_glsl_load_constantsB
(
vshader
,
gl_info
,
programId
,
state
Block
->
state
.
vs_consts_b
,
shader_glsl_load_constantsB
(
vshader
,
gl_info
,
programId
,
state
->
vs_consts_b
,
stateBlock
->
changed
.
vertexShaderConstantsB
&
vshader
->
reg_maps
.
boolean_constants
);
stateBlock
->
changed
.
vertexShaderConstantsB
&
vshader
->
reg_maps
.
boolean_constants
);
/* Upload the position fixup params */
/* Upload the position fixup params */
shader_get_position_fixup
(
context
,
&
stateBlock
->
state
,
position_fixup
);
shader_get_position_fixup
(
context
,
state
,
position_fixup
);
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
posFixup_location
,
1
,
position_fixup
));
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
posFixup_location
,
1
,
position_fixup
));
checkGLcall
(
"glUniform4fvARB"
);
checkGLcall
(
"glUniform4fvARB"
);
}
}
if
(
usePixelShader
)
if
(
usePixelShader
)
{
{
const
struct
wined3d_shader
*
pshader
=
state
Block
->
state
.
pixel_shader
;
const
struct
wined3d_shader
*
pshader
=
state
->
pixel_shader
;
/* Load DirectX 9 float constants/uniforms for pixel shader */
/* Load DirectX 9 float constants/uniforms for pixel shader */
shader_glsl_load_constantsF
(
pshader
,
gl_info
,
state
Block
->
state
.
ps_consts_f
,
shader_glsl_load_constantsF
(
pshader
,
gl_info
,
state
->
ps_consts_f
,
prog
->
puniformF_locations
,
&
priv
->
pconst_heap
,
priv
->
stack
,
constant_version
);
prog
->
puniformF_locations
,
&
priv
->
pconst_heap
,
priv
->
stack
,
constant_version
);
/* Load DirectX 9 integer constants/uniforms for pixel shader */
/* Load DirectX 9 integer constants/uniforms for pixel shader */
shader_glsl_load_constantsI
(
pshader
,
gl_info
,
prog
->
puniformI_locations
,
state
Block
->
state
.
ps_consts_i
,
shader_glsl_load_constantsI
(
pshader
,
gl_info
,
prog
->
puniformI_locations
,
state
->
ps_consts_i
,
stateBlock
->
changed
.
pixelShaderConstantsI
&
pshader
->
reg_maps
.
integer_constants
);
stateBlock
->
changed
.
pixelShaderConstantsI
&
pshader
->
reg_maps
.
integer_constants
);
/* Load DirectX 9 boolean constants/uniforms for pixel shader */
/* Load DirectX 9 boolean constants/uniforms for pixel shader */
shader_glsl_load_constantsB
(
pshader
,
gl_info
,
programId
,
state
Block
->
state
.
ps_consts_b
,
shader_glsl_load_constantsB
(
pshader
,
gl_info
,
programId
,
state
->
ps_consts_b
,
stateBlock
->
changed
.
pixelShaderConstantsB
&
pshader
->
reg_maps
.
boolean_constants
);
stateBlock
->
changed
.
pixelShaderConstantsB
&
pshader
->
reg_maps
.
boolean_constants
);
/* Upload the environment bump map matrix if needed. The needsbumpmat member specifies the texture stage to load the matrix from.
/* Upload the environment bump map matrix if needed. The needsbumpmat member specifies the texture stage to load the matrix from.
...
@@ -775,7 +776,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
...
@@ -775,7 +776,7 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
if
(
prog
->
bumpenvmat_location
[
i
]
==
-
1
)
continue
;
if
(
prog
->
bumpenvmat_location
[
i
]
==
-
1
)
continue
;
data
=
(
const
float
*
)
&
state
Block
->
state
.
texture_states
[
i
][
WINED3DTSS_BUMPENVMAT00
];
data
=
(
const
float
*
)
&
state
->
texture_states
[
i
][
WINED3DTSS_BUMPENVMAT00
];
GL_EXTCALL
(
glUniformMatrix2fvARB
(
prog
->
bumpenvmat_location
[
i
],
1
,
0
,
data
));
GL_EXTCALL
(
glUniformMatrix2fvARB
(
prog
->
bumpenvmat_location
[
i
],
1
,
0
,
data
));
checkGLcall
(
"glUniformMatrix2fvARB"
);
checkGLcall
(
"glUniformMatrix2fvARB"
);
...
@@ -784,8 +785,8 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
...
@@ -784,8 +785,8 @@ static void shader_glsl_load_constants(const struct wined3d_context *context,
* needsbumpmat check. */
* needsbumpmat check. */
if
(
prog
->
luminancescale_location
[
i
]
!=
-
1
)
if
(
prog
->
luminancescale_location
[
i
]
!=
-
1
)
{
{
const
GLfloat
*
scale
=
(
const
GLfloat
*
)
&
state
Block
->
state
.
texture_states
[
i
][
WINED3DTSS_BUMPENVLSCALE
];
const
GLfloat
*
scale
=
(
const
GLfloat
*
)
&
state
->
texture_states
[
i
][
WINED3DTSS_BUMPENVLSCALE
];
const
GLfloat
*
offset
=
(
const
GLfloat
*
)
&
state
Block
->
state
.
texture_states
[
i
][
WINED3DTSS_BUMPENVLOFFSET
];
const
GLfloat
*
offset
=
(
const
GLfloat
*
)
&
state
->
texture_states
[
i
][
WINED3DTSS_BUMPENVLOFFSET
];
GL_EXTCALL
(
glUniform1fvARB
(
prog
->
luminancescale_location
[
i
],
1
,
scale
));
GL_EXTCALL
(
glUniform1fvARB
(
prog
->
luminancescale_location
[
i
],
1
,
scale
));
checkGLcall
(
"glUniform1fvARB"
);
checkGLcall
(
"glUniform1fvARB"
);
...
...
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