wined3d: Add max_vertex_samplers and max_combined_samplers to WineD3D_GL_Info.

This commit is contained in:
H. Verbeet 2007-06-25 22:45:28 +02:00 committed by Alexandre Julliard
parent 3ad03206ab
commit 9c44b67d28
3 changed files with 13 additions and 1 deletions

View file

@ -495,6 +495,8 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) {
gl_info->max_textures = 1;
gl_info->max_texture_stages = 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->ps_arb_version = PS_VERSION_NOT_SUPPORTED;
gl_info->ps_arb_max_temps = 0;
@ -657,6 +659,12 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) {
gl_max /= 4;
TRACE_(d3d_caps)(" FOUND: ARB_vertex_shader (GLSL) support - max float vs constants=%u\n", 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) {
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);
@ -840,6 +848,8 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info, Display* display) {
* shaders), but 8 texture stages (register combiners). */
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. */
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");

View file

@ -2138,7 +2138,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
}
if (GL_SUPPORT(ARB_MULTITEXTURE)) {
if (mapped_stage >= GL_LIMITS(fragment_samplers)) {
if (mapped_stage >= GL_LIMITS(combined_samplers)) {
return;
}
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + mapped_stage));

View file

@ -1962,6 +1962,8 @@ typedef struct _WineD3D_GL_Info {
UINT max_textures;
UINT max_texture_stages;
UINT max_fragment_samplers;
UINT max_vertex_samplers;
UINT max_combined_samplers;
UINT max_sampler_stages;
UINT max_clipplanes;
UINT max_texture_size;