H. Verbeet : wined3d: Add max_vertex_samplers and max_combined_samplers to WineD3D_GL_Info.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jun 26 07:11:55 CDT 2007


Module: wine
Branch: master
Commit: 9c44b67d289dfdc379d540fdcb2fb9d92692b255
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9c44b67d289dfdc379d540fdcb2fb9d92692b255

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Mon Jun 25 22:45:28 2007 +0200

wined3d: Add max_vertex_samplers and max_combined_samplers to WineD3D_GL_Info.

---

 dlls/wined3d/directx.c    |   10 ++++++++++
 dlls/wined3d/state.c      |    2 +-
 include/wine/wined3d_gl.h |    2 ++
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 5558d7f..f74d2f4 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -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");
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 396f89c..48874ff 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -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));
diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h
index 0dcd184..1d69e59 100644
--- a/include/wine/wined3d_gl.h
+++ b/include/wine/wined3d_gl.h
@@ -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;




More information about the wine-cvs mailing list