[Mesa-dev] [PATCH 05/18] mesa: Update viewport driver args for ARB_viewport_array

Courtney Goeltzenleuchter courtney at lunarg.com
Wed Nov 20 14:59:20 PST 2013


Change the Driver viewport method arguments to be floats
instead of ints.

Signed-off-by: Courtney Goeltzenleuchter <courtney at LunarG.com>
---
 src/mesa/drivers/dri/i915/intel_context.c   | 7 ++++---
 src/mesa/drivers/dri/i965/brw_context.c     | 2 +-
 src/mesa/drivers/dri/r200/r200_state.c      | 5 +++--
 src/mesa/drivers/dri/radeon/radeon_common.c | 5 +++--
 src/mesa/drivers/dri/radeon/radeon_state.c  | 5 +++--
 src/mesa/drivers/dri/swrast/swrast.c        | 2 +-
 src/mesa/main/dd.h                          | 3 ++-
 src/mesa/state_tracker/st_cb_viewport.c     | 4 ++--
 8 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c
index 6752f4b..24837cd 100644
--- a/src/mesa/drivers/dri/i915/intel_context.c
+++ b/src/mesa/drivers/dri/i915/intel_context.c
@@ -271,12 +271,12 @@ intel_prepare_render(struct intel_context *intel)
 }
 
 static void
-intel_noninvalidate_viewport(struct gl_context *ctx, GLuint idx, GLint x, GLint y,
-                             GLsizei w, GLsizei h)
+intel_viewport(struct gl_context *ctx, GLuint idx, GLfloat x, GLfloat y, GLfloat w, GLfloat h)
 {
     struct intel_context *intel = intel_context(ctx);
     __DRIcontext *driContext = intel->driContext;
 
+    (void) idx;
     (void) x;
     (void) y;
     (void) w;
@@ -291,8 +291,9 @@ intel_noninvalidate_viewport(struct gl_context *ctx, GLuint idx, GLint x, GLint
 }
 
 static void
-intel_viewport(struct gl_context *ctx, GLuint idx, GLint x, GLint y, GLsizei w, GLsizei h)
+intel_noninvalidate_viewport(struct gl_context *ctx, GLuint idx, GLfloat x, GLfloat y, GLfloat w, GLfloat h)
 {
+    (void) idx;
     (void) x;
     (void) y;
     (void) w;
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 8f049e7..bf01caa 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -134,7 +134,7 @@ intelGetString(struct gl_context * ctx, GLenum name)
 }
 
 static void
-intel_viewport(struct gl_context *ctx, GLuint idx, GLint x, GLint y, GLsizei w, GLsizei h)
+intel_viewport(struct gl_context *ctx, GLuint idx, GLfloat x, GLfloat y, GLfloat w, GLfloat h)
 {
    struct brw_context *brw = brw_context(ctx);
    __DRIcontext *driContext = brw->driContext;
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index 219fc49..388e904 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -1600,8 +1600,9 @@ void r200_vtbl_update_scissor( struct gl_context *ctx )
 }
 
 
-static void r200Viewport( struct gl_context *ctx, GLuint idx, GLint x, GLint y,
-			    GLsizei width, GLsizei height )
+static void r200Viewport( struct gl_context *ctx, GLuint idx,
+                          GLfloat x, GLfloat y,
+			  GLfloat width, GLfloat height )
 {
    (void) x;
    (void) y;
diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index d78c0c2..88f530a 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -410,8 +410,9 @@ void radeon_viewport(struct gl_context *ctx)
 {
 	radeonContextPtr radeon = RADEON_CONTEXT(ctx);
 	__DRIcontext *driContext = radeon->dri.context;
-	void (*old_viewport)(struct gl_context *ctx, GLuint idx, GLint x, GLint y,
-			     GLsizei w, GLsizei h);
+	void (*old_viewport)(struct gl_context *ctx, GLuint idx,
+                             GLfloat X, GLfloat Y,
+                             GLfloat Width, GLfloat Height);
 
 	if (_mesa_is_winsys_fbo(ctx->DrawBuffer)) {
 		if (radeon->is_front_buffer_rendering) {
diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c
index b62a51a..258f18f 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state.c
@@ -1383,8 +1383,9 @@ void radeonUpdateWindow( struct gl_context *ctx )
 }
 
 
-static void radeonViewport( struct gl_context *ctx, GLuint idx, GLint x, GLint y,
-			    GLsizei width, GLsizei height )
+static void radeonViewport( struct gl_context *ctx, GLuint idx,
+                            GLfloat x, GLfloat y,
+			    GLfloat width, GLfloat height )
 {
    (void) x;
    (void) y;
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index deba27e..2e3177d 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -619,7 +619,7 @@ update_state( struct gl_context *ctx, GLuint new_state )
 
 static void
 viewport(struct gl_context *ctx, GLuint idx,
-         GLint x, GLint y, GLsizei w, GLsizei h)
+         GLfloat x, GLfloat y, GLfloat w, GLfloat h)
 {
     struct gl_framebuffer *draw = ctx->WinSysDrawBuffer;
     struct gl_framebuffer *read = ctx->WinSysReadBuffer;
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index d777cc8..aff41f9 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -545,7 +545,8 @@ struct dd_function_table {
                         GLenum pname, const GLfloat *params);
    /** Set the viewport */
    void (*Viewport)(struct gl_context *ctx, GLuint idx,
-                    GLint x, GLint y, GLsizei w, GLsizei h);
+                    GLfloat X, GLfloat Y,
+                    GLfloat Width, GLfloat Height);
    /*@}*/
 
 
diff --git a/src/mesa/state_tracker/st_cb_viewport.c b/src/mesa/state_tracker/st_cb_viewport.c
index d48127e..0517b7f 100644
--- a/src/mesa/state_tracker/st_cb_viewport.c
+++ b/src/mesa/state_tracker/st_cb_viewport.c
@@ -49,8 +49,8 @@ st_ws_framebuffer(struct gl_framebuffer *fb)
 }
 
 static void st_viewport(struct gl_context * ctx, GLuint idx,
-                        GLint x, GLint y,
-                        GLsizei width, GLsizei height)
+                        GLfloat X, GLfloat Y,
+                        GLfloat Width, GLfloat Height)
 {
    struct st_context *st = ctx->st;
    struct st_framebuffer *stdraw;
-- 
1.8.1.2



More information about the mesa-dev mailing list