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
0c72464a
Commit
0c72464a
authored
Oct 24, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Oct 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use the native constant limit for fitting private constants.
parent
9ee65081
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+18
-3
No files found.
dlls/wined3d/arb_program_shader.c
View file @
0c72464a
...
@@ -629,13 +629,13 @@ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const s
...
@@ -629,13 +629,13 @@ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const s
*/
*/
if
(
pshader
)
if
(
pshader
)
{
{
max_constantsF
=
gl_info
->
max_ps_arb_
constantsF
;
max_constantsF
=
gl_info
->
max_ps_arb_
native_constants
;
}
}
else
else
{
{
if
(
This
->
baseShader
.
reg_maps
.
usesrelconstF
)
{
if
(
This
->
baseShader
.
reg_maps
.
usesrelconstF
)
{
DWORD
highest_constf
=
0
,
clip_limit
;
DWORD
highest_constf
=
0
,
clip_limit
;
max_constantsF
=
gl_info
->
max_vs_arb_
constantsF
-
reserved_vs_const
(
iface
,
gl_info
);
max_constantsF
=
gl_info
->
max_vs_arb_
native_constants
-
reserved_vs_const
(
iface
,
gl_info
);
max_constantsF
-=
count_bits
(
This
->
baseShader
.
reg_maps
.
integer_constants
);
max_constantsF
-=
count_bits
(
This
->
baseShader
.
reg_maps
.
integer_constants
);
for
(
i
=
0
;
i
<
This
->
baseShader
.
limits
.
constant_float
;
i
++
)
for
(
i
=
0
;
i
<
This
->
baseShader
.
limits
.
constant_float
;
i
++
)
...
@@ -665,7 +665,7 @@ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const s
...
@@ -665,7 +665,7 @@ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const s
{
{
if
(
ctx
->
target_version
>=
NV2
)
*
num_clipplanes
=
gl_info
->
max_clipplanes
;
if
(
ctx
->
target_version
>=
NV2
)
*
num_clipplanes
=
gl_info
->
max_clipplanes
;
else
*
num_clipplanes
=
min
(
gl_info
->
max_clipplanes
,
4
);
else
*
num_clipplanes
=
min
(
gl_info
->
max_clipplanes
,
4
);
max_constantsF
=
gl_info
->
max_vs_arb_
constantsF
;
max_constantsF
=
gl_info
->
max_vs_arb_
native_constants
;
}
}
}
}
...
@@ -698,6 +698,21 @@ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const s
...
@@ -698,6 +698,21 @@ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const s
}
}
}
}
/* After subtracting privately used constants from the hardware limit(they are loaded as
* local constants), make sure the shader doesn't violate the env constant limit
*/
if
(
pshader
)
{
max_constantsF
=
min
(
max_constantsF
,
gl_info
->
max_ps_arb_constantsF
);
}
else
{
max_constantsF
=
min
(
max_constantsF
,
gl_info
->
max_vs_arb_constantsF
);
}
/* Avoid declaring more constants than needed */
max_constantsF
=
min
(
max_constantsF
,
This
->
baseShader
.
limits
.
constant_float
);
/* we use the array-based constants array if the local constants are marked for loading,
/* we use the array-based constants array if the local constants are marked for loading,
* because then we use indirect addressing, or when the local constant list is empty,
* because then we use indirect addressing, or when the local constant list is empty,
* because then we don't know if we're using indirect addressing or not. If we're hardcoding
* because then we don't know if we're using indirect addressing or not. If we're hardcoding
...
...
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