Commit 2afbab0c authored by Paul Gofman's avatar Paul Gofman Committed by Vitaly Lipatov

wined3d: Report actual vertex shader float constants limit for SWVP device.

parent a00ecdfe
......@@ -5196,7 +5196,8 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->limits.gs_version = shader_caps.gs_version;
d3d_info->limits.ps_version = shader_caps.ps_version;
d3d_info->limits.cs_version = shader_caps.cs_version;
d3d_info->limits.vs_uniform_count = shader_caps.vs_uniform_count;
d3d_info->limits.vs_uniform_count_swvp = shader_caps.vs_uniform_count;
d3d_info->limits.vs_uniform_count = min(WINED3D_MAX_VS_CONSTS_F, shader_caps.vs_uniform_count);
d3d_info->limits.ps_uniform_count = shader_caps.ps_uniform_count;
d3d_info->limits.varying_count = shader_caps.varying_count;
d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
......
......@@ -4333,9 +4333,16 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device,
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps)
{
HRESULT hr;
TRACE("device %p, caps %p.\n", device, caps);
return wined3d_get_device_caps(device->adapter, device->create_parms.device_type, caps);
if (FAILED(hr = wined3d_get_device_caps(device->adapter, device->create_parms.device_type, caps)))
return hr;
if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING)
caps->MaxVertexShaderConst = device->adapter->d3d_info.limits.vs_uniform_count_swvp;
return hr;
}
HRESULT CDECL wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx,
......
......@@ -11310,7 +11310,10 @@ static void shader_glsl_get_caps(const struct wined3d_adapter *adapter, struct s
caps->vs_version = gl_info->supported[ARB_VERTEX_SHADER] ? caps->vs_version : 0;
caps->ps_version = gl_info->supported[ARB_FRAGMENT_SHADER] ? caps->ps_version : 0;
caps->vs_uniform_count = min(WINED3D_MAX_VS_CONSTS_F, gl_info->limits.glsl_vs_float_constants);
caps->vs_uniform_count = min(WINED3D_MAX_VS_CONSTS_F_SWVP,
gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT]
? gl_info->limits.glsl_max_uniform_block_size / sizeof(struct wined3d_vec4)
: gl_info->limits.glsl_vs_float_constants);
caps->ps_uniform_count = min(WINED3D_MAX_PS_CONSTS_F, gl_info->limits.glsl_ps_float_constants);
caps->varying_count = gl_info->limits.glsl_varyings;
......
......@@ -180,6 +180,7 @@ struct wined3d_d3d_limits
{
unsigned int vs_version, hs_version, ds_version, gs_version, ps_version, cs_version;
DWORD vs_uniform_count;
DWORD vs_uniform_count_swvp;
DWORD ps_uniform_count;
unsigned int varying_count;
unsigned int ffp_textures;
......
......@@ -1616,6 +1616,7 @@ enum wined3d_memory_segment_group
#define WINED3D_MAX_CONSTS_B 16
#define WINED3D_MAX_CONSTS_I 16
#define WINED3D_MAX_VS_CONSTS_F 256
#define WINED3D_MAX_VS_CONSTS_F_SWVP 8192
#define WINED3D_MAX_PS_CONSTS_F 224
#define WINED3D_MAX_RENDER_TARGETS 8
#define WINED3D_MAX_CONSTANT_BUFFER_SIZE 4096
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment