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
fb989f1d
Commit
fb989f1d
authored
Sep 18, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement version checks for geometry shaders.
parent
62670c7b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
59 deletions
+63
-59
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+17
-15
device.c
dlls/wined3d/device.c
+6
-5
directx.c
dlls/wined3d/directx.c
+4
-4
glsl_shader.c
dlls/wined3d/glsl_shader.c
+14
-19
shader.c
dlls/wined3d/shader.c
+12
-8
wined3d_private.h
dlls/wined3d/wined3d_private.h
+10
-8
No files found.
dlls/wined3d/arb_program_shader.c
View file @
fb989f1d
...
...
@@ -4978,28 +4978,30 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
if
(
gl_info
->
supported
[
NV_VERTEX_PROGRAM3
])
{
caps
->
VertexShaderV
ersion
=
3
;
caps
->
vs_v
ersion
=
3
;
TRACE
(
"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
->
VertexShaderV
ersion
=
2
;
caps
->
vs_v
ersion
=
2
;
TRACE
(
"Hardware vertex shader version 2.0 enabled (ARB_PROGRAM)
\n
"
);
}
else
{
caps
->
VertexShaderV
ersion
=
1
;
caps
->
vs_v
ersion
=
1
;
TRACE
(
"Hardware vertex shader version 1.1 enabled (ARB_PROGRAM)
\n
"
);
}
caps
->
MaxVertexShaderCons
t
=
vs_consts
;
caps
->
vs_uniform_coun
t
=
vs_consts
;
}
else
{
caps
->
VertexShaderV
ersion
=
0
;
caps
->
MaxVertexShaderCons
t
=
0
;
caps
->
vs_v
ersion
=
0
;
caps
->
vs_uniform_coun
t
=
0
;
}
caps
->
gs_version
=
0
;
if
(
gl_info
->
supported
[
ARB_FRAGMENT_PROGRAM
])
{
DWORD
ps_consts
;
...
...
@@ -5013,31 +5015,31 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
if
(
gl_info
->
supported
[
NV_FRAGMENT_PROGRAM2
])
{
caps
->
PixelShaderV
ersion
=
3
;
caps
->
ps_v
ersion
=
3
;
TRACE
(
"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
->
PixelShaderV
ersion
=
2
;
caps
->
ps_v
ersion
=
2
;
TRACE
(
"Hardware pixel shader version 2.0 enabled (ARB_PROGRAM)
\n
"
);
}
else
{
caps
->
PixelShaderV
ersion
=
1
;
caps
->
ps_v
ersion
=
1
;
TRACE
(
"Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)
\n
"
);
}
caps
->
PixelShader1xMaxValue
=
8
.
0
f
;
caps
->
MaxPixelShaderConst
=
ps_consts
;
caps
->
ps_uniform_count
=
ps_consts
;
caps
->
ps_1x_max_value
=
8
.
0
f
;
}
else
{
caps
->
PixelShaderV
ersion
=
0
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
caps
->
MaxPixelShaderConst
=
0
;
caps
->
ps_v
ersion
=
0
;
caps
->
ps_uniform_count
=
0
;
caps
->
ps_1x_max_value
=
0
.
0
f
;
}
caps
->
VSC
lipping
=
use_nv_clip
(
gl_info
);
caps
->
vs_c
lipping
=
use_nv_clip
(
gl_info
);
}
static
BOOL
shader_arb_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
...
...
dlls/wined3d/device.c
View file @
fb989f1d
...
...
@@ -5547,11 +5547,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
if
(
device
->
shader_backend
)
{
device
->
shader_backend
->
shader_get_caps
(
&
adapter
->
gl_info
,
&
shader_caps
);
device
->
vshader_version
=
shader_caps
.
VertexShaderVersion
;
device
->
pshader_version
=
shader_caps
.
PixelShaderVersion
;
device
->
d3d_vshader_constantF
=
shader_caps
.
MaxVertexShaderConst
;
device
->
d3d_pshader_constantF
=
shader_caps
.
MaxPixelShaderConst
;
device
->
vs_clipping
=
shader_caps
.
VSClipping
;
device
->
vs_version
=
shader_caps
.
vs_version
;
device
->
gs_version
=
shader_caps
.
gs_version
;
device
->
ps_version
=
shader_caps
.
ps_version
;
device
->
d3d_vshader_constantF
=
shader_caps
.
vs_uniform_count
;
device
->
d3d_pshader_constantF
=
shader_caps
.
ps_uniform_count
;
device
->
vs_clipping
=
shader_caps
.
vs_clipping
;
}
fragment_pipeline
=
adapter
->
fragment_pipe
;
device
->
frag_pipe
=
fragment_pipeline
;
...
...
dlls/wined3d/directx.c
View file @
fb989f1d
...
...
@@ -4962,8 +4962,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
}
else
{
caps
->
VertexShaderVersion
=
shader_caps
.
VertexShaderV
ersion
;
caps
->
MaxVertexShaderConst
=
shader_caps
.
MaxVertexShaderCons
t
;
caps
->
VertexShaderVersion
=
shader_caps
.
vs_v
ersion
;
caps
->
MaxVertexShaderConst
=
shader_caps
.
vs_uniform_coun
t
;
}
if
(
ps_selected_mode
==
SHADER_NONE
)
...
...
@@ -4972,8 +4972,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps
->
PixelShaderVersion
=
0
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
}
else
{
caps
->
PixelShaderVersion
=
shader_caps
.
PixelShaderV
ersion
;
caps
->
PixelShader1xMaxValue
=
shader_caps
.
PixelShader1xMaxV
alue
;
caps
->
PixelShaderVersion
=
shader_caps
.
ps_v
ersion
;
caps
->
PixelShader1xMaxValue
=
shader_caps
.
ps_1x_max_v
alue
;
}
caps
->
TextureOpCaps
=
fragment_caps
.
TextureOpCaps
;
...
...
dlls/wined3d/glsl_shader.c
View file @
fb989f1d
...
...
@@ -4964,27 +4964,25 @@ static void shader_glsl_context_destroyed(void *shader_priv, const struct wined3
static
void
shader_glsl_get_caps
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
shader_caps
*
caps
)
{
UINT
shader_model
;
if
(
gl_info
->
supported
[
EXT_GPU_SHADER4
]
&&
gl_info
->
supported
[
ARB_GEOMETRY_SHADER4
]
&&
gl_info
->
glsl_version
>=
MAKEDWORD_VERSION
(
1
,
50
))
{
caps
->
VertexShaderVersion
=
4
;
caps
->
PixelShaderVersion
=
4
;
}
shader_model
=
4
;
/* ARB_shader_texture_lod or EXT_gpu_shader4 is required for the SM3
* texldd and texldl instructions. */
else
if
(
gl_info
->
supported
[
ARB_SHADER_TEXTURE_LOD
]
||
gl_info
->
supported
[
EXT_GPU_SHADER4
])
{
caps
->
VertexShaderVersion
=
3
;
caps
->
PixelShaderVersion
=
3
;
}
shader_model
=
3
;
else
{
caps
->
VertexShaderVersion
=
2
;
caps
->
PixelShaderVersion
=
2
;
}
shader_model
=
2
;
TRACE
(
"Shader model %u.
\n
"
,
shader_model
);
caps
->
MaxVertexShaderConst
=
gl_info
->
limits
.
glsl_vs_float_constants
;
caps
->
MaxPixelShaderConst
=
gl_info
->
limits
.
glsl_ps_float_constants
;
caps
->
vs_version
=
shader_model
;
caps
->
gs_version
=
shader_model
;
caps
->
ps_version
=
shader_model
;
caps
->
vs_uniform_count
=
gl_info
->
limits
.
glsl_vs_float_constants
;
caps
->
ps_uniform_count
=
gl_info
->
limits
.
glsl_ps_float_constants
;
/* FIXME: The following line is card dependent. -8.0 to 8.0 is the
* Direct3D minimum requirement.
...
...
@@ -4998,12 +4996,9 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s
* the shader will generate incorrect results too. Unfortunately, GL deliberately doesn't
* offer a way to query this.
*/
caps
->
PixelShader1xMaxValue
=
8
.
0
;
caps
->
VSClipping
=
TRUE
;
caps
->
ps_1x_max_value
=
8
.
0
;
TRACE
(
"Hardware vertex shader version %u enabled (GLSL).
\n
"
,
caps
->
VertexShaderVersion
);
TRACE
(
"Hardware pixel shader version %u enabled (GLSL).
\n
"
,
caps
->
PixelShaderVersion
);
caps
->
vs_clipping
=
TRUE
;
}
static
BOOL
shader_glsl_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
...
...
dlls/wined3d/shader.c
View file @
fb989f1d
...
...
@@ -1482,12 +1482,13 @@ static void shader_none_context_destroyed(void *shader_priv, const struct wined3
static
void
shader_none_get_caps
(
const
struct
wined3d_gl_info
*
gl_info
,
struct
shader_caps
*
caps
)
{
/* Set the shader caps to 0 for the none shader backend */
caps
->
VertexShaderVersion
=
0
;
caps
->
MaxVertexShaderConst
=
0
;
caps
->
PixelShaderVersion
=
0
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
caps
->
MaxPixelShaderConst
=
0
;
caps
->
VSClipping
=
FALSE
;
caps
->
vs_version
=
0
;
caps
->
gs_version
=
0
;
caps
->
ps_version
=
0
;
caps
->
vs_uniform_count
=
0
;
caps
->
ps_uniform_count
=
0
;
caps
->
ps_1x_max_value
=
0
.
0
f
;
caps
->
vs_clipping
=
FALSE
;
}
static
BOOL
shader_none_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
...
...
@@ -1581,10 +1582,13 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, const DWORD *b
switch
(
type
)
{
case
WINED3D_SHADER_TYPE_VERTEX
:
backend_version
=
shader
->
device
->
vshader_version
;
backend_version
=
shader
->
device
->
vs_version
;
break
;
case
WINED3D_SHADER_TYPE_GEOMETRY
:
backend_version
=
shader
->
device
->
gs_version
;
break
;
case
WINED3D_SHADER_TYPE_PIXEL
:
backend_version
=
shader
->
device
->
ps
hader
_version
;
backend_version
=
shader
->
device
->
ps_version
;
break
;
default:
FIXME
(
"No backend version-checking for this shader type
\n
"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
fb989f1d
...
...
@@ -702,15 +702,17 @@ extern const struct wined3d_shader_frontend sm4_shader_frontend DECLSPEC_HIDDEN;
typedef
void
(
*
SHADER_HANDLER
)(
const
struct
wined3d_shader_instruction
*
);
struct
shader_caps
{
DWORD
VertexShaderVersion
;
DWORD
MaxVertexShaderConst
;
struct
shader_caps
{
UINT
vs_version
;
UINT
gs_version
;
UINT
ps_version
;
DWORD
PixelShaderVersion
;
float
PixelShader1xMaxValue
;
DWORD
MaxPixelShaderConst
;
DWORD
vs_uniform_count
;
DWORD
ps_uniform_count
;
float
ps_1x_max_value
;
BOOL
VSC
lipping
;
BOOL
vs_c
lipping
;
};
enum
tex_types
...
...
@@ -1696,7 +1698,7 @@ struct wined3d_device
const
struct
blit_shader
*
blitter
;
unsigned
int
max_ffp_textures
;
DWORD
vshader_version
,
pshader
_version
;
UINT
vs_version
,
gs_version
,
ps
_version
;
DWORD
d3d_vshader_constantF
,
d3d_pshader_constantF
;
/* Advertised d3d caps, not GL ones */
DWORD
vs_clipping
;
...
...
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