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
9d0e17e9
Commit
9d0e17e9
authored
Apr 25, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Either set SM3 for both vertex and fragment shaders or for neither.
parent
f63a84be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
31 deletions
+25
-31
glsl_shader.c
dlls/wined3d/glsl_shader.c
+25
-31
No files found.
dlls/wined3d/glsl_shader.c
View file @
9d0e17e9
...
...
@@ -4924,39 +4924,29 @@ static BOOL shader_glsl_dirty_const(void)
static
void
shader_glsl_get_caps
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
shader_caps
*
pCaps
)
{
/* Nvidia Geforce6/7 or Ati R4xx/R5xx cards with GLSL support, support VS 3.0 but older Nvidia/Ati
* models with GLSL support only support 2.0. In case of nvidia we can detect VS 2.0 support based
* on the version of NV_vertex_program.
* For Ati cards there's no way using glsl (it abstracts the lowlevel info away) and also not
* using ARB_vertex_program. It is safe to assume that when a card supports pixel shader 2.0 it
* supports vertex shader 2.0 too and the way around. We can detect ps2.0 using the maximum number
* of native instructions, so use that here. For more info see the pixel shader versioning code below.
*/
if
((
gl_info
->
supported
[
NV_VERTEX_PROGRAM2
]
&&
!
gl_info
->
supported
[
NV_VERTEX_PROGRAM3
])
||
gl_info
->
limits
.
arb_ps_instructions
<=
512
)
pCaps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
2
,
0
);
else
/* NVIDIA GeForce 6 / 7 or ATI R4xx / R5xx cards with GLSL support
* support SM3, but older NVIDIA / ATI models with GLSL support only
* support SM2. In case of NVIDIA we can detect SM3 support based on the
* version of NV_vertex_program / NV_fragment_program. For other cards we
* try to detect SM3 based on the maximum number of native fragment
* program instructions. PS2.0 requires at least 96 instructions, 2.0a/b
* goes up to 512. Assume that if the number of instructions is 512 or
* less we have to do with SM2 hardware. NOTE: SM3 requires 512 or more
* instructions but ATI and NVIDIA offer more than that (1024 vs 4096) on
* their most basic SM3 hardware. */
if
((
gl_info
->
supported
[
NV_VERTEX_PROGRAM3
]
&&
gl_info
->
supported
[
NV_FRAGMENT_PROGRAM2
])
||
gl_info
->
limits
.
arb_ps_instructions
>
512
)
{
pCaps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
3
,
0
);
TRACE_
(
d3d_caps
)(
"Hardware vertex shader version %d.%d enabled (GLSL)
\n
"
,
(
pCaps
->
VertexShaderVersion
>>
8
)
&
0xff
,
pCaps
->
VertexShaderVersion
&
0xff
);
pCaps
->
MaxVertexShaderConst
=
gl_info
->
limits
.
glsl_vs_float_constants
;
/* Older DX9-class videocards (GeforceFX / Radeon >9500/X*00) only support pixel shader 2.0/2.0a/2.0b.
* In OpenGL the extensions related to GLSL abstract lowlevel GL info away which is needed
* to distinguish between 2.0 and 3.0 (and 2.0a/2.0b). In case of Nvidia we use their fragment
* program extensions. On other hardware including ATI GL_ARB_fragment_program offers the info
* in max native instructions. Intel and others also offer the info in this extension but they
* don't support GLSL (at least on Windows).
*
* PS2.0 requires at least 96 instructions, 2.0a/2.0b go up to 512. Assume that if the number
* of instructions is 512 or less we have to do with ps2.0 hardware.
* NOTE: ps3.0 hardware requires 512 or more instructions but ati and nvidia offer 'enough' (1024 vs 4096) on their most basic ps3.0 hardware.
*/
if
((
gl_info
->
supported
[
NV_FRAGMENT_PROGRAM
]
&&
!
gl_info
->
supported
[
NV_FRAGMENT_PROGRAM2
])
||
gl_info
->
limits
.
arb_ps_instructions
<=
512
)
pCaps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
2
,
0
);
else
pCaps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
3
,
0
);
}
else
{
pCaps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
2
,
0
);
pCaps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
2
,
0
);
}
pCaps
->
MaxVertexShaderConst
=
gl_info
->
limits
.
glsl_vs_float_constants
;
pCaps
->
MaxPixelShaderConst
=
gl_info
->
limits
.
glsl_ps_float_constants
;
/* FIXME: The following line is card dependent. -8.0 to 8.0 is the
...
...
@@ -4972,9 +4962,13 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s
* offer a way to query this.
*/
pCaps
->
PixelShader1xMaxValue
=
8
.
0
;
TRACE_
(
d3d_caps
)(
"Hardware pixel shader version %d.%d enabled (GLSL)
\n
"
,
(
pCaps
->
PixelShaderVersion
>>
8
)
&
0xff
,
pCaps
->
PixelShaderVersion
&
0xff
);
pCaps
->
VSClipping
=
TRUE
;
TRACE_
(
d3d_caps
)(
"Hardware vertex shader version %u.%u enabled (GLSL).
\n
"
,
(
pCaps
->
VertexShaderVersion
>>
8
)
&
0xff
,
pCaps
->
VertexShaderVersion
&
0xff
);
TRACE_
(
d3d_caps
)(
"Hardware pixel shader version %u.%u enabled (GLSL).
\n
"
,
(
pCaps
->
PixelShaderVersion
>>
8
)
&
0xff
,
pCaps
->
PixelShaderVersion
&
0xff
);
}
static
BOOL
shader_glsl_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
...
...
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