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
7254f5e6
Commit
7254f5e6
authored
Oct 25, 2011
by
Matteo Bruni
Committed by
Alexandre Julliard
Oct 26, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Return only the shader major version.
parent
6e6a9176
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
28 deletions
+42
-28
directx.c
dlls/d3d8/directx.c
+6
-4
directx.c
dlls/d3d9/directx.c
+15
-3
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+6
-6
directx.c
dlls/wined3d/directx.c
+7
-7
glsl_shader.c
dlls/wined3d/glsl_shader.c
+8
-8
No files found.
dlls/d3d8/directx.c
View file @
7254f5e6
...
...
@@ -296,12 +296,14 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(IDirect3D8 *iface, U
void
fixup_caps
(
WINED3DCAPS
*
caps
)
{
/* D3D8 doesn't support SM 2.0 or higher, so clamp to 1.x */
if
(
caps
->
PixelShaderVersion
>
D3DPS_VERSION
(
1
,
4
))
{
if
(
caps
->
PixelShaderVersion
)
caps
->
PixelShaderVersion
=
D3DPS_VERSION
(
1
,
4
);
}
if
(
caps
->
VertexShaderVersion
>
D3DVS_VERSION
(
1
,
1
))
{
else
caps
->
PixelShaderVersion
=
D3DPS_VERSION
(
0
,
0
);
if
(
caps
->
VertexShaderVersion
)
caps
->
VertexShaderVersion
=
D3DVS_VERSION
(
1
,
1
);
}
else
caps
->
VertexShaderVersion
=
D3DVS_VERSION
(
0
,
0
);
caps
->
MaxVertexShaderConst
=
min
(
D3D8_MAX_VERTEX_SHADER_CONSTANTF
,
caps
->
MaxVertexShaderConst
);
caps
->
StencilCaps
&=
~
WINED3DSTENCILCAPS_TWOSIDED
;
...
...
dlls/d3d9/directx.c
View file @
7254f5e6
...
...
@@ -325,7 +325,8 @@ static HRESULT WINAPI IDirect3D9Impl_CheckDeviceFormatConversion(IDirect3D9Ex *i
void
filter_caps
(
D3DCAPS9
*
pCaps
)
{
DWORD
ps_minor_version
[]
=
{
0
,
4
,
0
,
0
};
DWORD
vs_minor_version
[]
=
{
0
,
1
,
0
,
0
};
DWORD
textureFilterCaps
=
D3DPTFILTERCAPS_MINFPOINT
|
D3DPTFILTERCAPS_MINFLINEAR
|
D3DPTFILTERCAPS_MINFANISOTROPIC
|
D3DPTFILTERCAPS_MINFPYRAMIDALQUAD
|
D3DPTFILTERCAPS_MINFGAUSSIANQUAD
|
...
...
@@ -382,10 +383,21 @@ void filter_caps(D3DCAPS9* pCaps)
pCaps
->
MaxVertexShaderConst
=
min
(
D3D9_MAX_VERTEX_SHADER_CONSTANTF
,
pCaps
->
MaxVertexShaderConst
);
pCaps
->
NumSimultaneousRTs
=
min
(
D3D9_MAX_SIMULTANEOUS_RENDERTARGETS
,
pCaps
->
NumSimultaneousRTs
);
if
(
pCaps
->
PixelShaderVersion
>
D3DPS_VERSION
(
3
,
0
)
)
if
(
pCaps
->
PixelShaderVersion
>
3
)
pCaps
->
PixelShaderVersion
=
D3DPS_VERSION
(
3
,
0
);
if
(
pCaps
->
VertexShaderVersion
>
D3DVS_VERSION
(
3
,
0
))
else
{
DWORD
major
=
pCaps
->
PixelShaderVersion
;
pCaps
->
PixelShaderVersion
=
D3DPS_VERSION
(
major
,
ps_minor_version
[
major
]);
}
if
(
pCaps
->
VertexShaderVersion
>
3
)
pCaps
->
VertexShaderVersion
=
D3DVS_VERSION
(
3
,
0
);
else
{
DWORD
major
=
pCaps
->
VertexShaderVersion
;
pCaps
->
VertexShaderVersion
=
D3DVS_VERSION
(
major
,
vs_minor_version
[
major
]);
}
}
static
HRESULT
WINAPI
IDirect3D9Impl_GetDeviceCaps
(
IDirect3D9Ex
*
iface
,
UINT
Adapter
,
...
...
dlls/wined3d/arb_program_shader.c
View file @
7254f5e6
...
...
@@ -4915,18 +4915,18 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
if
(
gl_info
->
supported
[
NV_VERTEX_PROGRAM3
])
{
caps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
3
,
0
)
;
caps
->
VertexShaderVersion
=
3
;
TRACE_
(
d3d_caps
)(
"Hardware vertex shader version 3.0 enabled (NV_VERTEX_PROGRAM3)
\n
"
);
}
else
if
(
vs_consts
>=
256
)
{
/* Shader Model 2.0 requires at least 256 vertex shader constants */
caps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
2
,
0
)
;
caps
->
VertexShaderVersion
=
2
;
TRACE_
(
d3d_caps
)(
"Hardware vertex shader version 2.0 enabled (ARB_PROGRAM)
\n
"
);
}
else
{
caps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
1
,
1
)
;
caps
->
VertexShaderVersion
=
1
;
TRACE_
(
d3d_caps
)(
"Hardware vertex shader version 1.1 enabled (ARB_PROGRAM)
\n
"
);
}
caps
->
MaxVertexShaderConst
=
vs_consts
;
...
...
@@ -4950,18 +4950,18 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
if
(
gl_info
->
supported
[
NV_FRAGMENT_PROGRAM2
])
{
caps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
3
,
0
)
;
caps
->
PixelShaderVersion
=
3
;
TRACE_
(
d3d_caps
)(
"Hardware pixel shader version 3.0 enabled (NV_FRAGMENT_PROGRAM2)
\n
"
);
}
else
if
(
ps_consts
>=
32
)
{
/* Shader Model 2.0 requires at least 32 pixel shader constants */
caps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
2
,
0
)
;
caps
->
PixelShaderVersion
=
2
;
TRACE_
(
d3d_caps
)(
"Hardware pixel shader version 2.0 enabled (ARB_PROGRAM)
\n
"
);
}
else
{
caps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
1
,
4
)
;
caps
->
PixelShaderVersion
=
1
;
TRACE_
(
d3d_caps
)(
"Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)
\n
"
);
}
caps
->
PixelShader1xMaxValue
=
8
.
0
f
;
...
...
dlls/wined3d/directx.c
View file @
7254f5e6
...
...
@@ -4723,7 +4723,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
if
(
vs_selected_mode
==
SHADER_NONE
)
{
TRACE_
(
d3d_caps
)(
"Vertex shader disabled in config, reporting version 0.0
\n
"
);
caps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
0
,
0
)
;
caps
->
VertexShaderVersion
=
0
;
caps
->
MaxVertexShaderConst
=
0
;
}
else
...
...
@@ -4735,7 +4735,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
if
(
ps_selected_mode
==
SHADER_NONE
)
{
TRACE_
(
d3d_caps
)(
"Pixel shader disabled in config, reporting version 0.0
\n
"
);
caps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
0
,
0
)
;
caps
->
PixelShaderVersion
=
0
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
}
else
{
caps
->
PixelShaderVersion
=
shader_caps
.
PixelShaderVersion
;
...
...
@@ -4750,7 +4750,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
* are the same among all shader models. So to avoid code duplication set the shader version
* specific, but otherwise constant caps here
*/
if
(
caps
->
VertexShaderVersion
==
WINED3DVS_VERSION
(
3
,
0
)
)
if
(
caps
->
VertexShaderVersion
==
3
)
{
/* Where possible set the caps based on OpenGL extensions and if they
* aren't set (in case of software rendering) use the VS 3.0 from
...
...
@@ -4766,7 +4766,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps
->
MaxVShaderInstructionsExecuted
=
65535
;
/* VS 3.0 needs at least 65535, some cards even use 2^32-1 */
caps
->
MaxVertexShader30InstructionSlots
=
max
(
512
,
adapter
->
gl_info
.
limits
.
arb_vs_instructions
);
}
else
if
(
caps
->
VertexShaderVersion
==
WINED3DVS_VERSION
(
2
,
0
)
)
else
if
(
caps
->
VertexShaderVersion
==
2
)
{
caps
->
VS20Caps
.
Caps
=
0
;
caps
->
VS20Caps
.
DynamicFlowControlDepth
=
WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH
;
...
...
@@ -4787,7 +4787,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps
->
MaxVertexShader30InstructionSlots
=
0
;
}
if
(
caps
->
PixelShaderVersion
==
WINED3DPS_VERSION
(
3
,
0
)
)
if
(
caps
->
PixelShaderVersion
==
3
)
{
/* Where possible set the caps based on OpenGL extensions and if they
* aren't set (in case of software rendering) use the PS 3.0 from
...
...
@@ -4814,7 +4814,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps
->
MaxPixelShader30InstructionSlots
=
max
(
WINED3DMIN30SHADERINSTRUCTIONS
,
adapter
->
gl_info
.
limits
.
arb_ps_instructions
);
}
else
if
(
caps
->
PixelShaderVersion
==
WINED3DPS_VERSION
(
2
,
0
)
)
else
if
(
caps
->
PixelShaderVersion
==
2
)
{
/* Below we assume PS2.0 specs, not extended 2.0a(GeforceFX)/2.0b(Radeon R3xx) ones */
caps
->
PS20Caps
.
Caps
=
0
;
...
...
@@ -4839,7 +4839,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps
->
MaxPixelShader30InstructionSlots
=
0
;
}
if
(
caps
->
VertexShaderVersion
>=
WINED3DVS_VERSION
(
2
,
0
)
)
if
(
caps
->
VertexShaderVersion
>=
2
)
{
/* OpenGL supports all the formats below, perhaps not always
* without conversion, but it supports them.
...
...
dlls/wined3d/glsl_shader.c
View file @
7254f5e6
...
...
@@ -4917,13 +4917,13 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s
* texldd and texldl instructions. */
if
(
gl_info
->
supported
[
ARB_SHADER_TEXTURE_LOD
]
||
gl_info
->
supported
[
EXT_GPU_SHADER4
])
{
caps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
3
,
0
)
;
caps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
3
,
0
)
;
caps
->
VertexShaderVersion
=
3
;
caps
->
PixelShaderVersion
=
3
;
}
else
{
caps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
2
,
0
)
;
caps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
2
,
0
)
;
caps
->
VertexShaderVersion
=
2
;
caps
->
PixelShaderVersion
=
2
;
}
caps
->
MaxVertexShaderConst
=
gl_info
->
limits
.
glsl_vs_float_constants
;
...
...
@@ -4945,10 +4945,10 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s
caps
->
VSClipping
=
TRUE
;
TRACE_
(
d3d_caps
)(
"Hardware vertex shader version %u
.%u
enabled (GLSL).
\n
"
,
(
caps
->
VertexShaderVersion
>>
8
)
&
0xff
,
caps
->
VertexShaderVersion
&
0xff
);
TRACE_
(
d3d_caps
)(
"Hardware pixel shader version %u
.%u
enabled (GLSL).
\n
"
,
(
caps
->
PixelShaderVersion
>>
8
)
&
0xff
,
caps
->
PixelShaderVersion
&
0xff
);
TRACE_
(
d3d_caps
)(
"Hardware vertex shader version %u enabled (GLSL).
\n
"
,
caps
->
VertexShaderVersion
);
TRACE_
(
d3d_caps
)(
"Hardware pixel shader version %u enabled (GLSL).
\n
"
,
caps
->
PixelShaderVersion
);
}
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