Commit 9c44b67d authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Add max_vertex_samplers and max_combined_samplers to WineD3D_GL_Info.

parent 3ad03206
...@@ -495,6 +495,8 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) { ...@@ -495,6 +495,8 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) {
gl_info->max_textures = 1; gl_info->max_textures = 1;
gl_info->max_texture_stages = 1; gl_info->max_texture_stages = 1;
gl_info->max_fragment_samplers = 1; gl_info->max_fragment_samplers = 1;
gl_info->max_vertex_samplers = 0;
gl_info->max_combined_samplers = 0;
gl_info->max_sampler_stages = 1; gl_info->max_sampler_stages = 1;
gl_info->ps_arb_version = PS_VERSION_NOT_SUPPORTED; gl_info->ps_arb_version = PS_VERSION_NOT_SUPPORTED;
gl_info->ps_arb_max_temps = 0; gl_info->ps_arb_max_temps = 0;
...@@ -657,6 +659,12 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) { ...@@ -657,6 +659,12 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) {
gl_max /= 4; gl_max /= 4;
TRACE_(d3d_caps)(" FOUND: ARB_vertex_shader (GLSL) support - max float vs constants=%u\n", gl_max); TRACE_(d3d_caps)(" FOUND: ARB_vertex_shader (GLSL) support - max float vs constants=%u\n", gl_max);
gl_info->vs_glsl_constantsF = gl_max; gl_info->vs_glsl_constantsF = gl_max;
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &gl_max);
TRACE_(d3d_caps)(" FOUND: ARB_vertex_shader (GLSL) support - GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB=%u\n", gl_max);
gl_info->max_vertex_samplers = gl_max;
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &gl_max);
TRACE_(d3d_caps)(" FOUND: ARB_vertex_shader (GLSL) support - GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB=%u\n", gl_max);
gl_info->max_combined_samplers = gl_max;
} else if (strcmp(ThisExtn, "GL_ARB_vertex_blend") == 0) { } else if (strcmp(ThisExtn, "GL_ARB_vertex_blend") == 0) {
glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max); glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max);
TRACE_(d3d_caps)(" FOUND: ARB Vertex Blend support GL_MAX_VERTEX_UNITS_ARB %d\n", gl_max); TRACE_(d3d_caps)(" FOUND: ARB Vertex Blend support GL_MAX_VERTEX_UNITS_ARB %d\n", gl_max);
...@@ -840,6 +848,8 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) { ...@@ -840,6 +848,8 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) {
* shaders), but 8 texture stages (register combiners). */ * shaders), but 8 texture stages (register combiners). */
gl_info->max_sampler_stages = max(gl_info->max_fragment_samplers, gl_info->max_texture_stages); gl_info->max_sampler_stages = max(gl_info->max_fragment_samplers, gl_info->max_texture_stages);
if (!gl_info->max_combined_samplers) gl_info->max_combined_samplers = gl_info->max_fragment_samplers;
/* We can only use ORM_FBO when the hardware supports it. */ /* We can only use ORM_FBO when the hardware supports it. */
if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && !gl_info->supported[EXT_FRAMEBUFFER_OBJECT]) { if (wined3d_settings.offscreen_rendering_mode == ORM_FBO && !gl_info->supported[EXT_FRAMEBUFFER_OBJECT]) {
WARN_(d3d_caps)("GL_EXT_framebuffer_object not supported, falling back to PBuffer offscreen rendering mode.\n"); WARN_(d3d_caps)("GL_EXT_framebuffer_object not supported, falling back to PBuffer offscreen rendering mode.\n");
......
...@@ -2138,7 +2138,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont ...@@ -2138,7 +2138,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
} }
if (GL_SUPPORT(ARB_MULTITEXTURE)) { if (GL_SUPPORT(ARB_MULTITEXTURE)) {
if (mapped_stage >= GL_LIMITS(fragment_samplers)) { if (mapped_stage >= GL_LIMITS(combined_samplers)) {
return; return;
} }
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + mapped_stage)); GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + mapped_stage));
......
...@@ -1962,6 +1962,8 @@ typedef struct _WineD3D_GL_Info { ...@@ -1962,6 +1962,8 @@ typedef struct _WineD3D_GL_Info {
UINT max_textures; UINT max_textures;
UINT max_texture_stages; UINT max_texture_stages;
UINT max_fragment_samplers; UINT max_fragment_samplers;
UINT max_vertex_samplers;
UINT max_combined_samplers;
UINT max_sampler_stages; UINT max_sampler_stages;
UINT max_clipplanes; UINT max_clipplanes;
UINT max_texture_size; UINT max_texture_size;
......
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