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
4916cd54
Commit
4916cd54
authored
Nov 27, 2008
by
Stefan Dösinger
Committed by
Alexandre Julliard
Dec 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't load INT and BOOL constants needlessly.
parent
a2089abd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
8 deletions
+25
-8
baseshader.c
dlls/wined3d/baseshader.c
+8
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+16
-8
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/baseshader.c
View file @
4916cd54
...
@@ -349,6 +349,8 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m
...
@@ -349,6 +349,8 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m
max_loop_depth
=
cur_loop_depth
;
max_loop_depth
=
cur_loop_depth
;
pToken
+=
curOpcode
->
num_params
;
pToken
+=
curOpcode
->
num_params
;
/* Rep and Loop always use an integer constant for the control parameters */
This
->
baseShader
.
uses_int_consts
=
TRUE
;
}
else
if
(
WINED3DSIO_ENDLOOP
==
curOpcode
->
opcode
||
}
else
if
(
WINED3DSIO_ENDLOOP
==
curOpcode
->
opcode
||
WINED3DSIO_ENDREP
==
curOpcode
->
opcode
)
{
WINED3DSIO_ENDREP
==
curOpcode
->
opcode
)
{
cur_loop_depth
--
;
cur_loop_depth
--
;
...
@@ -494,6 +496,12 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m
...
@@ -494,6 +496,12 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m
reg_maps
->
usesrelconstF
=
TRUE
;
reg_maps
->
usesrelconstF
=
TRUE
;
}
}
}
}
else
if
(
WINED3DSPR_CONSTINT
==
regtype
)
{
This
->
baseShader
.
uses_int_consts
=
TRUE
;
}
else
if
(
WINED3DSPR_CONSTBOOL
==
regtype
)
{
This
->
baseShader
.
uses_bool_consts
=
TRUE
;
}
/* WINED3DSPR_TEXCRDOUT is the same as WINED3DSPR_OUTPUT. _OUTPUT can be > MAX_REG_TEXCRD and is used
/* WINED3DSPR_TEXCRDOUT is the same as WINED3DSPR_OUTPUT. _OUTPUT can be > MAX_REG_TEXCRD and is used
* in >= 3.0 shaders. Filter 3.0 shaders to prevent overflows, and also filter pixel shaders because TECRDOUT
* in >= 3.0 shaders. Filter 3.0 shaders to prevent overflows, and also filter pixel shaders because TECRDOUT
...
...
dlls/wined3d/glsl_shader.c
View file @
4916cd54
...
@@ -418,12 +418,16 @@ static void shader_glsl_load_constants(
...
@@ -418,12 +418,16 @@ static void shader_glsl_load_constants(
stateBlock
->
vertexShaderConstantF
,
constant_locations
,
constant_list
);
stateBlock
->
vertexShaderConstantF
,
constant_locations
,
constant_list
);
/* 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
,
if
(
vshader
->
baseShader
.
uses_int_consts
)
{
stateBlock
->
vertexShaderConstantI
,
stateBlock
->
changed
.
vertexShaderConstantsI
);
shader_glsl_load_constantsI
(
vshader
,
gl_info
,
prog
->
vuniformI_locations
,
stateBlock
->
vertexShaderConstantI
,
stateBlock
->
changed
.
vertexShaderConstantsI
);
}
/* 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
,
if
(
vshader
->
baseShader
.
uses_bool_consts
)
{
stateBlock
->
vertexShaderConstantB
,
stateBlock
->
changed
.
vertexShaderConstantsB
);
shader_glsl_load_constantsB
(
vshader
,
gl_info
,
programId
,
stateBlock
->
vertexShaderConstantB
,
stateBlock
->
changed
.
vertexShaderConstantsB
);
}
/* Upload the position fixup params */
/* Upload the position fixup params */
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
posFixup_location
,
1
,
&
deviceImpl
->
posFixup
[
0
]));
GL_EXTCALL
(
glUniform4fvARB
(
prog
->
posFixup_location
,
1
,
&
deviceImpl
->
posFixup
[
0
]));
...
@@ -442,12 +446,16 @@ static void shader_glsl_load_constants(
...
@@ -442,12 +446,16 @@ static void shader_glsl_load_constants(
stateBlock
->
pixelShaderConstantF
,
constant_locations
,
constant_list
);
stateBlock
->
pixelShaderConstantF
,
constant_locations
,
constant_list
);
/* 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
,
if
(
pshader
->
baseShader
.
uses_int_consts
)
{
stateBlock
->
pixelShaderConstantI
,
stateBlock
->
changed
.
pixelShaderConstantsI
);
shader_glsl_load_constantsI
(
pshader
,
gl_info
,
prog
->
puniformI_locations
,
stateBlock
->
pixelShaderConstantI
,
stateBlock
->
changed
.
pixelShaderConstantsI
);
}
/* 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
,
if
(
pshader
->
baseShader
.
uses_bool_consts
)
{
stateBlock
->
pixelShaderConstantB
,
stateBlock
->
changed
.
pixelShaderConstantsB
);
shader_glsl_load_constantsB
(
pshader
,
gl_info
,
programId
,
stateBlock
->
pixelShaderConstantB
,
stateBlock
->
changed
.
pixelShaderConstantsB
);
}
/* 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.
* It can't be 0 for a valid texbem instruction.
* It can't be 0 for a valid texbem instruction.
...
...
dlls/wined3d/wined3d_private.h
View file @
4916cd54
...
@@ -2194,6 +2194,7 @@ typedef struct IWineD3DBaseShaderClass
...
@@ -2194,6 +2194,7 @@ typedef struct IWineD3DBaseShaderClass
BOOL
is_compiled
;
BOOL
is_compiled
;
UINT
cur_loop_depth
,
cur_loop_regno
;
UINT
cur_loop_depth
,
cur_loop_regno
;
BOOL
load_local_constsF
;
BOOL
load_local_constsF
;
BOOL
uses_bool_consts
,
uses_int_consts
;
/* Type of shader backend */
/* Type of shader backend */
int
shader_mode
;
int
shader_mode
;
...
...
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