Paul Berry <[email protected]> writes: > On 5 June 2013 10:14, Eric Anholt <[email protected]> wrote: > >> Intel had brokenness here, and I'd like to continue moving Mesa toward >> hiding 1D_ARRAY's ridiculousness inside of the core, like we did with >> MapTextureImage. Fixes copyteximage 1D_ARRAY on intel. >> >> There's still an impedance mismatch in meta when falling back to read and >> texsubimage, since texsubimage expects coordinates into 1D_ARRAY as >> (width, slice, 0) instead of (width, 0, slice).
>> diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
>> index 13c7a83..846d5d0 100644
>> --- a/src/mesa/main/dd.h
>> +++ b/src/mesa/main/dd.h
>> @@ -249,10 +249,15 @@ struct dd_function_table {
>>
>> /**
>> * Called by glCopyTex[Sub]Image[123]D().
>> + *
>> + * In the case of 1D array textures, the driver will be called to copy
>> each
>> + * appropriate scanline from the rb to each destination slice. For 3D
>> or
>> + * other array textures, only one slice may be copied, but @slice may
>> be
>> + * nonzero.
>>
>
> I'm having trouble following this comment, especially the second sentence.
> Would this be clearer?
>
> "This function should copy a rectangular region in the rb to a single
> destination slice, specified by @slice. In the case of 1D array textures
> (where one GL call can potentially affect multiple destination slices),
> core mesa takes care of calling this function multiple times, once for each
> scanline to be copied."
When I first wrote the comment, I was thinking there was going to be
multi-slice code for 2d arrays/3d/cubemaps, then I didn't rewrite from
scratch when I discovered things were simpler. Your text is much
better.
>> +static void
>> +copytexsubimage_by_slice(struct gl_context *ctx,
>> + struct gl_texture_image *texImage,
>> + GLuint dims,
>> + GLint xoffset, GLint yoffset, GLint zoffset,
>> + struct gl_renderbuffer *rb,
>> + GLint x, GLint y,
>> + GLsizei width, GLsizei height)
>> +{
>> + if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY) {
>> + int slice;
>> +
>> + /* For 1D arrays, we copy each scanline of the source rectangle
>> into the
>> + * next array slice.
>> + */
>> + assert(zoffset == 0);
>> +
>> + for (slice = 0; slice < height; slice++) {
>> + if (yoffset + slice >= texImage->Height)
>> + break;
>>
>
> Shouldn't the error check in error_check_subtexture_dimensions() prevent
> this from ever occurring? If so, I think this should be an assertion.
I failed to find the error case when I was writing the code. Thanks!
pgpOYFHo9Kss8.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
