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
Show 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
...
@@ -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
])
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
"
);
TRACE
(
"Hardware vertex shader version 3.0 enabled (NV_VERTEX_PROGRAM3)
\n
"
);
}
}
else
if
(
vs_consts
>=
256
)
else
if
(
vs_consts
>=
256
)
{
{
/* Shader Model 2.0 requires at least 256 vertex shader constants */
/* 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
"
);
TRACE
(
"Hardware vertex shader version 2.0 enabled (ARB_PROGRAM)
\n
"
);
}
}
else
else
{
{
caps
->
VertexShaderV
ersion
=
1
;
caps
->
vs_v
ersion
=
1
;
TRACE
(
"Hardware vertex shader version 1.1 enabled (ARB_PROGRAM)
\n
"
);
TRACE
(
"Hardware vertex shader version 1.1 enabled (ARB_PROGRAM)
\n
"
);
}
}
caps
->
MaxVertexShaderCons
t
=
vs_consts
;
caps
->
vs_uniform_coun
t
=
vs_consts
;
}
}
else
else
{
{
caps
->
VertexShaderV
ersion
=
0
;
caps
->
vs_v
ersion
=
0
;
caps
->
MaxVertexShaderCons
t
=
0
;
caps
->
vs_uniform_coun
t
=
0
;
}
}
caps
->
gs_version
=
0
;
if
(
gl_info
->
supported
[
ARB_FRAGMENT_PROGRAM
])
if
(
gl_info
->
supported
[
ARB_FRAGMENT_PROGRAM
])
{
{
DWORD
ps_consts
;
DWORD
ps_consts
;
...
@@ -5013,31 +5015,31 @@ static void shader_arb_get_caps(const struct wined3d_gl_info *gl_info, struct sh
...
@@ -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
])
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
"
);
TRACE
(
"Hardware pixel shader version 3.0 enabled (NV_FRAGMENT_PROGRAM2)
\n
"
);
}
}
else
if
(
ps_consts
>=
32
)
else
if
(
ps_consts
>=
32
)
{
{
/* Shader Model 2.0 requires at least 32 pixel shader constants */
/* 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
"
);
TRACE
(
"Hardware pixel shader version 2.0 enabled (ARB_PROGRAM)
\n
"
);
}
}
else
else
{
{
caps
->
PixelShaderV
ersion
=
1
;
caps
->
ps_v
ersion
=
1
;
TRACE
(
"Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)
\n
"
);
TRACE
(
"Hardware pixel shader version 1.4 enabled (ARB_PROGRAM)
\n
"
);
}
}
caps
->
PixelShader1xMaxValue
=
8
.
0
f
;
caps
->
ps_uniform_count
=
ps_consts
;
caps
->
MaxPixelShaderConst
=
ps_consts
;
caps
->
ps_1x_max_value
=
8
.
0
f
;
}
}
else
else
{
{
caps
->
PixelShaderV
ersion
=
0
;
caps
->
ps_v
ersion
=
0
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
caps
->
ps_uniform_count
=
0
;
caps
->
MaxPixelShaderConst
=
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
)
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,
...
@@ -5547,11 +5547,12 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
if
(
device
->
shader_backend
)
if
(
device
->
shader_backend
)
{
{
device
->
shader_backend
->
shader_get_caps
(
&
adapter
->
gl_info
,
&
shader_caps
);
device
->
shader_backend
->
shader_get_caps
(
&
adapter
->
gl_info
,
&
shader_caps
);
device
->
vshader_version
=
shader_caps
.
VertexShaderVersion
;
device
->
vs_version
=
shader_caps
.
vs_version
;
device
->
pshader_version
=
shader_caps
.
PixelShaderVersion
;
device
->
gs_version
=
shader_caps
.
gs_version
;
device
->
d3d_vshader_constantF
=
shader_caps
.
MaxVertexShaderConst
;
device
->
ps_version
=
shader_caps
.
ps_version
;
device
->
d3d_pshader_constantF
=
shader_caps
.
MaxPixelShaderConst
;
device
->
d3d_vshader_constantF
=
shader_caps
.
vs_uniform_count
;
device
->
vs_clipping
=
shader_caps
.
VSClipping
;
device
->
d3d_pshader_constantF
=
shader_caps
.
ps_uniform_count
;
device
->
vs_clipping
=
shader_caps
.
vs_clipping
;
}
}
fragment_pipeline
=
adapter
->
fragment_pipe
;
fragment_pipeline
=
adapter
->
fragment_pipe
;
device
->
frag_pipe
=
fragment_pipeline
;
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
...
@@ -4962,8 +4962,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
}
}
else
else
{
{
caps
->
VertexShaderVersion
=
shader_caps
.
VertexShaderV
ersion
;
caps
->
VertexShaderVersion
=
shader_caps
.
vs_v
ersion
;
caps
->
MaxVertexShaderConst
=
shader_caps
.
MaxVertexShaderCons
t
;
caps
->
MaxVertexShaderConst
=
shader_caps
.
vs_uniform_coun
t
;
}
}
if
(
ps_selected_mode
==
SHADER_NONE
)
if
(
ps_selected_mode
==
SHADER_NONE
)
...
@@ -4972,8 +4972,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
...
@@ -4972,8 +4972,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps
->
PixelShaderVersion
=
0
;
caps
->
PixelShaderVersion
=
0
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
}
else
{
}
else
{
caps
->
PixelShaderVersion
=
shader_caps
.
PixelShaderV
ersion
;
caps
->
PixelShaderVersion
=
shader_caps
.
ps_v
ersion
;
caps
->
PixelShader1xMaxValue
=
shader_caps
.
PixelShader1xMaxV
alue
;
caps
->
PixelShader1xMaxValue
=
shader_caps
.
ps_1x_max_v
alue
;
}
}
caps
->
TextureOpCaps
=
fragment_caps
.
TextureOpCaps
;
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
...
@@ -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
)
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
]
if
(
gl_info
->
supported
[
EXT_GPU_SHADER4
]
&&
gl_info
->
supported
[
ARB_GEOMETRY_SHADER4
]
&&
gl_info
->
glsl_version
>=
MAKEDWORD_VERSION
(
1
,
50
))
&&
gl_info
->
glsl_version
>=
MAKEDWORD_VERSION
(
1
,
50
))
{
shader_model
=
4
;
caps
->
VertexShaderVersion
=
4
;
caps
->
PixelShaderVersion
=
4
;
}
/* ARB_shader_texture_lod or EXT_gpu_shader4 is required for the SM3
/* ARB_shader_texture_lod or EXT_gpu_shader4 is required for the SM3
* texldd and texldl instructions. */
* texldd and texldl instructions. */
else
if
(
gl_info
->
supported
[
ARB_SHADER_TEXTURE_LOD
]
||
gl_info
->
supported
[
EXT_GPU_SHADER4
])
else
if
(
gl_info
->
supported
[
ARB_SHADER_TEXTURE_LOD
]
||
gl_info
->
supported
[
EXT_GPU_SHADER4
])
{
shader_model
=
3
;
caps
->
VertexShaderVersion
=
3
;
caps
->
PixelShaderVersion
=
3
;
}
else
else
{
shader_model
=
2
;
caps
->
VertexShaderVersion
=
2
;
TRACE
(
"Shader model %u.
\n
"
,
shader_model
);
caps
->
PixelShaderVersion
=
2
;
}
caps
->
MaxVertexShaderConst
=
gl_info
->
limits
.
glsl_vs_float_constants
;
caps
->
vs_version
=
shader_model
;
caps
->
MaxPixelShaderConst
=
gl_info
->
limits
.
glsl_ps_float_constants
;
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
/* FIXME: The following line is card dependent. -8.0 to 8.0 is the
* Direct3D minimum requirement.
* Direct3D minimum requirement.
...
@@ -4998,12 +4996,9 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s
...
@@ -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
* the shader will generate incorrect results too. Unfortunately, GL deliberately doesn't
* offer a way to query this.
* offer a way to query this.
*/
*/
caps
->
PixelShader1xMaxValue
=
8
.
0
;
caps
->
ps_1x_max_value
=
8
.
0
;
caps
->
VSClipping
=
TRUE
;
TRACE
(
"Hardware vertex shader version %u enabled (GLSL).
\n
"
,
caps
->
VertexShaderVersion
);
caps
->
vs_clipping
=
TRUE
;
TRACE
(
"Hardware pixel shader version %u enabled (GLSL).
\n
"
,
caps
->
PixelShaderVersion
);
}
}
static
BOOL
shader_glsl_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
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
...
@@ -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
)
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 */
/* Set the shader caps to 0 for the none shader backend */
caps
->
VertexShaderVersion
=
0
;
caps
->
vs_version
=
0
;
caps
->
MaxVertexShaderConst
=
0
;
caps
->
gs_version
=
0
;
caps
->
PixelShaderVersion
=
0
;
caps
->
ps_version
=
0
;
caps
->
PixelShader1xMaxValue
=
0
.
0
f
;
caps
->
vs_uniform_count
=
0
;
caps
->
MaxPixelShaderConst
=
0
;
caps
->
ps_uniform_count
=
0
;
caps
->
VSClipping
=
FALSE
;
caps
->
ps_1x_max_value
=
0
.
0
f
;
caps
->
vs_clipping
=
FALSE
;
}
}
static
BOOL
shader_none_color_fixup_supported
(
struct
color_fixup_desc
fixup
)
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
...
@@ -1581,10 +1582,13 @@ static HRESULT shader_set_function(struct wined3d_shader *shader, const DWORD *b
switch
(
type
)
switch
(
type
)
{
{
case
WINED3D_SHADER_TYPE_VERTEX
:
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
;
break
;
case
WINED3D_SHADER_TYPE_PIXEL
:
case
WINED3D_SHADER_TYPE_PIXEL
:
backend_version
=
shader
->
device
->
ps
hader
_version
;
backend_version
=
shader
->
device
->
ps_version
;
break
;
break
;
default:
default:
FIXME
(
"No backend version-checking for this shader type
\n
"
);
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;
...
@@ -702,15 +702,17 @@ extern const struct wined3d_shader_frontend sm4_shader_frontend DECLSPEC_HIDDEN;
typedef
void
(
*
SHADER_HANDLER
)(
const
struct
wined3d_shader_instruction
*
);
typedef
void
(
*
SHADER_HANDLER
)(
const
struct
wined3d_shader_instruction
*
);
struct
shader_caps
{
struct
shader_caps
DWORD
VertexShaderVersion
;
{
DWORD
MaxVertexShaderConst
;
UINT
vs_version
;
UINT
gs_version
;
UINT
ps_version
;
DWORD
PixelShaderVersion
;
DWORD
vs_uniform_count
;
float
PixelShader1xMaxValue
;
DWORD
ps_uniform_count
;
DWORD
MaxPixelShaderConst
;
float
ps_1x_max_value
;
BOOL
VSC
lipping
;
BOOL
vs_c
lipping
;
};
};
enum
tex_types
enum
tex_types
...
@@ -1696,7 +1698,7 @@ struct wined3d_device
...
@@ -1696,7 +1698,7 @@ struct wined3d_device
const
struct
blit_shader
*
blitter
;
const
struct
blit_shader
*
blitter
;
unsigned
int
max_ffp_textures
;
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
d3d_vshader_constantF
,
d3d_pshader_constantF
;
/* Advertised d3d caps, not GL ones */
DWORD
vs_clipping
;
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