wined3d: Enable SM4 support in the GLSL shader backend when possible.

This commit is contained in:
Matteo Bruni 2011-10-25 16:58:45 +02:00 committed by Alexandre Julliard
parent 7254f5e661
commit 5f2c6b3c82
2 changed files with 9 additions and 3 deletions

View File

@ -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 * are the same among all shader models. So to avoid code duplication set the shader version
* specific, but otherwise constant caps here * specific, but otherwise constant caps here
*/ */
if (caps->VertexShaderVersion == 3) if (caps->VertexShaderVersion >= 3)
{ {
/* Where possible set the caps based on OpenGL extensions and if they /* 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 * aren't set (in case of software rendering) use the VS 3.0 from
@ -4787,7 +4787,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
caps->MaxVertexShader30InstructionSlots = 0; caps->MaxVertexShader30InstructionSlots = 0;
} }
if (caps->PixelShaderVersion == 3) if (caps->PixelShaderVersion >= 3)
{ {
/* Where possible set the caps based on OpenGL extensions and if they /* 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 * aren't set (in case of software rendering) use the PS 3.0 from

View File

@ -4913,9 +4913,15 @@ 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)
{ {
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;
}
/* 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. */
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])
{ {
caps->VertexShaderVersion = 3; caps->VertexShaderVersion = 3;
caps->PixelShaderVersion = 3; caps->PixelShaderVersion = 3;