[Mesa-dev,2/3] i965: Allow GL_UNPACK_SKIP_ROWS/PIXELS in intel_try_pbo_upload

Submitted by Neil Roberts on Dec. 22, 2014, 11:08 p.m.

Details

Message ID 1419289730-20554-3-git-send-email-neil@linux.intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Neil Roberts Dec. 22, 2014, 11:08 p.m.
This should just be a simple case of adding the skip values to the src offset
so we can trivially implement it.
---
 src/mesa/drivers/dri/i965/intel_tex_image.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 52ee97e..b1b49b9 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -105,7 +105,7 @@  intel_try_pbo_upload(struct gl_context *ctx,
 
    DBG("trying pbo upload\n");
 
-   if (ctx->_ImageTransferState || unpack->SkipPixels || unpack->SkipRows) {
+   if (ctx->_ImageTransferState) {
       DBG("%s: image transfer\n", __FUNCTION__);
       return false;
    }
@@ -137,6 +137,11 @@  intel_try_pbo_upload(struct gl_context *ctx,
 
    /* note: potential 64-bit ptr to 32-bit int cast */
    src_offset = (GLuint) (unsigned long) pixels;
+   src_offset += _mesa_image_offset(2,
+                                    unpack,
+                                    width, height,
+                                    format, type,
+                                    0, 0, 0 /* img/row/column */);
    src_buffer = intel_bufferobj_buffer(brw, pbo,
                                        src_offset, src_stride * height);
 

Comments

Patches 1 and 2 are

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>

On Mon, Dec 22, 2014 at 3:08 PM, Neil Roberts <neil@linux.intel.com> wrote:

> This should just be a simple case of adding the skip values to the src
> offset
> so we can trivially implement it.
> ---
>  src/mesa/drivers/dri/i965/intel_tex_image.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c
> b/src/mesa/drivers/dri/i965/intel_tex_image.c
> index 52ee97e..b1b49b9 100644
> --- a/src/mesa/drivers/dri/i965/intel_tex_image.c
> +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
> @@ -105,7 +105,7 @@ intel_try_pbo_upload(struct gl_context *ctx,
>
>     DBG("trying pbo upload\n");
>
> -   if (ctx->_ImageTransferState || unpack->SkipPixels ||
> unpack->SkipRows) {
> +   if (ctx->_ImageTransferState) {
>        DBG("%s: image transfer\n", __FUNCTION__);
>        return false;
>     }
> @@ -137,6 +137,11 @@ intel_try_pbo_upload(struct gl_context *ctx,
>
>     /* note: potential 64-bit ptr to 32-bit int cast */
>     src_offset = (GLuint) (unsigned long) pixels;
> +   src_offset += _mesa_image_offset(2,
> +                                    unpack,
> +                                    width, height,
> +                                    format, type,
> +                                    0, 0, 0 /* img/row/column */);
>     src_buffer = intel_bufferobj_buffer(brw, pbo,
>                                         src_offset, src_stride * height);
>
> --
> 1.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>