Henri Verbeet : wined3d: Pass a gl_info structure to fragment_pipeline. enable_extension().

Alexandre Julliard julliard at winehq.org
Wed Jul 25 16:06:54 CDT 2012


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jul 24 11:32:26 2012 +0200

wined3d: Pass a gl_info structure to fragment_pipeline.enable_extension().

---

 dlls/wined3d/arb_program_shader.c    |    2 +-
 dlls/wined3d/ati_fragment_shader.c   |    2 +-
 dlls/wined3d/context.c               |   13 ++++++-------
 dlls/wined3d/nvidia_texture_shader.c |    6 +++---
 dlls/wined3d/state.c                 |    2 +-
 dlls/wined3d/wined3d_private.h       |    2 +-
 6 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 85f51d2..4a4fdc8 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -5585,7 +5585,7 @@ struct arbfp_ffp_desc
 };
 
 /* Context activation and GL locking are done by the caller. */
-static void arbfp_enable(BOOL enable)
+static void arbfp_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
 {
     if(enable) {
         glEnable(GL_FRAGMENT_PROGRAM_ARB);
diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c
index 680367a..4d77e1d 100644
--- a/dlls/wined3d/ati_fragment_shader.c
+++ b/dlls/wined3d/ati_fragment_shader.c
@@ -1093,7 +1093,7 @@ static const struct StateEntryTemplate atifs_fragmentstate_template[] = {
 };
 
 /* Context activation and GL locking are done by the caller. */
-static void atifs_enable(BOOL enable)
+static void atifs_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
 {
     if(enable) {
         glEnable(GL_FRAGMENT_SHADER_ATI);
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index e53936f..24f812d 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1569,7 +1569,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
     {
         GL_EXTCALL(glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT));
     }
-    device->frag_pipe->enable_extension(TRUE);
+    device->frag_pipe->enable_extension(gl_info, TRUE);
 
     /* If this happens to be the first context for the device, dummy textures
      * are not created yet. In that case, they will be created (and bound) by
@@ -1866,7 +1866,7 @@ static void SetupForBlit(const struct wined3d_device *device, struct wined3d_con
     context_invalidate_state(context, STATE_RENDER(WINED3D_RS_CLIPPING));
 
     set_blit_dimension(rt_size.cx, rt_size.cy);
-    device->frag_pipe->enable_extension(FALSE);
+    device->frag_pipe->enable_extension(gl_info, FALSE);
 
     LEAVE_GL();
 
@@ -2139,6 +2139,7 @@ static BOOL context_validate_rt_config(UINT rt_count,
 BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_device *device,
         UINT rt_count, const struct wined3d_fb_state *fb)
 {
+    const struct wined3d_gl_info *gl_info = context->gl_info;
     DWORD rt_mask = 0, *cur_mask;
     UINT i;
     struct wined3d_surface **rts = fb->render_targets;
@@ -2221,7 +2222,7 @@ BOOL context_apply_clear_state(struct wined3d_context *context, const struct win
 
     if (context->last_was_blit)
     {
-        device->frag_pipe->enable_extension(TRUE);
+        device->frag_pipe->enable_extension(gl_info, TRUE);
         context->last_was_blit = FALSE;
     }
 
@@ -2349,9 +2350,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, struct wined3d_de
 
     ENTER_GL();
     if (context->last_was_blit)
-    {
-        device->frag_pipe->enable_extension(TRUE);
-    }
+        device->frag_pipe->enable_extension(context->gl_info, TRUE);
 
     for (i = 0; i < context->numDirtyEntries; ++i)
     {
@@ -2491,7 +2490,7 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str
         else
         {
             ENTER_GL();
-            device->frag_pipe->enable_extension(!context->last_was_blit);
+            device->frag_pipe->enable_extension(context->gl_info, !context->last_was_blit);
             LEAVE_GL();
         }
     }
diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c
index 48eacd5..35dd6ac 100644
--- a/dlls/wined3d/nvidia_texture_shader.c
+++ b/dlls/wined3d/nvidia_texture_shader.c
@@ -630,7 +630,7 @@ static void nvrc_texfactor(struct wined3d_context *context, const struct wined3d
 }
 
 /* Context activation is done by the caller. */
-static void nvrc_enable(BOOL enable)
+static void nvrc_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
 {
     if (enable)
     {
@@ -645,9 +645,9 @@ static void nvrc_enable(BOOL enable)
 }
 
 /* Context activation and GL locking are done by the caller. */
-static void nvts_enable(BOOL enable)
+static void nvts_enable(const struct wined3d_gl_info *gl_info, BOOL enable)
 {
-    nvrc_enable(enable);
+    nvrc_enable(gl_info, enable);
     if (enable)
     {
         glEnable(GL_TEXTURE_SHADER_NV);
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index f4a9f13..888f7da 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -5571,7 +5571,7 @@ static const struct StateEntryTemplate ffp_fragmentstate_template[] = {
 };
 
 /* Context activation and GL locking are done by the caller. */
-static void ffp_enable(BOOL enable) {}
+static void ffp_enable(const struct wined3d_gl_info *gl_info, BOOL enable) {}
 
 static void ffp_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps)
 {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7cc159d..a19088a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1166,7 +1166,7 @@ struct fragment_caps
 
 struct fragment_pipeline
 {
-    void (*enable_extension)(BOOL enable);
+    void (*enable_extension)(const struct wined3d_gl_info *gl_info, BOOL enable);
     void (*get_caps)(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps);
     HRESULT (*alloc_private)(struct wined3d_device *device);
     void (*free_private)(struct wined3d_device *device);




More information about the wine-cvs mailing list