[Mesa-dev] mesa-dev Digest, Vol 46, Issue 190

Maxence Le Doré maxence.ledore at gmail.com
Thu Jan 16 12:58:21 PST 2014


Those of Fredrik of course, since his implementation is better, I no
more work on multi bind.

2014/1/16  <mesa-dev-request at lists.freedesktop.org>:
> Send mesa-dev mailing list submissions to
>         mesa-dev at lists.freedesktop.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> or, via email, send a message with subject or body 'help' to
>         mesa-dev-request at lists.freedesktop.org
>
> You can reach the person managing the list at
>         mesa-dev-owner at lists.freedesktop.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of mesa-dev digest..."
>
>
> Today's Topics:
>
>    1. [PATCH 2/3] mesa: Fix extension dependency for    half-float
>       TexBOs (Ian Romanick)
>    2. Re: [PATCH] glsl: Assert buildin uniform variables (Matt Turner)
>    3. Re: [PATCH 05/10] nv50: assert before trying to out-of-bounds
>       access vtxbuf (Ilia Mirkin)
>    4. Re: [PATCH 00/10] nv50: out-of-bounds access of context
>       specific attribs (Ilia Mirkin)
>    5. Re: [PATCH 1/3] docs: Update GL3.txt due to recent work
>       (Matt Turner)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 16 Jan 2014 10:44:50 -0800
> From: "Ian Romanick" <idr at freedesktop.org>
> To: mesa-dev at lists.freedesktop.org
> Cc: Ian Romanick <ian.d.romanick at intel.com>
> Subject: [Mesa-dev] [PATCH 2/3] mesa: Fix extension dependency for
>         half-float TexBOs
> Message-ID: <1389897891-6088-2-git-send-email-idr at freedesktop.org>
>
> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Half-float TexBOs should require both GL_ARB_half_float_pixel and
> GL_ARB_texture_float.  This doesn't matter much in practice.  Every
> driver that supports GL_ARB_texture_buffer_object already supports
> GL_ARB_half_float_pixel.  We only expose the TexBO extension in core
> profiles, and those require GL_ARB_texture_float.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mesa/main/teximage.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 8aac54e..bbd5006 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -4150,7 +4150,18 @@ _mesa_validate_texbuffer_format(const struct gl_context *ctx,
>     if (datatype == GL_FLOAT && !ctx->Extensions.ARB_texture_float)
>        return MESA_FORMAT_NONE;
>
> -   if (datatype == GL_HALF_FLOAT && !ctx->Extensions.ARB_half_float_pixel)
> +   /* The GL_ARB_texture_buffer_object spec says:
> +    *
> +    *     "If ARB_texture_float is not supported, references to the
> +    *     floating-point internal formats provided by that extension should be
> +    *     removed, and such formats may not be passed to TexBufferARB."
> +    *
> +    * As a result, GL_HALF_FLOAT internal format depends on both
> +    * GL_ARB_texture_float and GL_ARB_half_float_pixel.
> +    */
> +   if (datatype == GL_HALF_FLOAT &&
> +       !(ctx->Extensions.ARB_half_float_pixel
> +         && ctx->Extensions.ARB_texture_float))
>        return MESA_FORMAT_NONE;
>
>     if (!ctx->Extensions.ARB_texture_rg) {
> --
> 1.8.1.4
>
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 16 Jan 2014 10:48:20 -0800
> From: Matt Turner <mattst88 at gmail.com>
> To: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> Cc: "mesa-dev at lists.freedesktop.org" <mesa-dev at lists.freedesktop.org>
> Subject: Re: [Mesa-dev] [PATCH] glsl: Assert buildin uniform variables
> Message-ID:
>         <CAEdQ38G1+dA0L0Dd=16XnVJ1G8cqgo5mUOC8DXqc=-=iCO1bRg at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Thu, Jan 16, 2014 at 2:59 AM, Juha-Pekka Heikkila
> <juhapekka.heikkila at gmail.com> wrote:
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
>> ---
>>  src/glsl/builtin_variables.cpp | 24 ++++++++++++++++++++----
>>  1 file changed, 20 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/glsl/builtin_variables.cpp b/src/glsl/builtin_variables.cpp
>> index f630923..9f4f7c7 100644
>> --- a/src/glsl/builtin_variables.cpp
>> +++ b/src/glsl/builtin_variables.cpp
>> @@ -669,7 +669,11 @@ void
>>  builtin_variable_generator::generate_uniforms()
>>  {
>>     add_uniform(int_t, "gl_NumSamples");
>> -   add_uniform(type("gl_DepthRangeParameters"), "gl_DepthRange");
>> +
>> +   const glsl_type *const depth_range_parameters_type =
>> +      type("gl_DepthRangeParameters");
>> +   assert(depth_range_parameters_type);
>> +   add_uniform(depth_range_parameters_type, "gl_DepthRange");
>>     add_uniform(array(vec4_t, VERT_ATTRIB_MAX), "gl_CurrentAttribVertMESA");
>>     add_uniform(array(vec4_t, VARYING_SLOT_MAX), "gl_CurrentAttribFragMESA");
>>
>> @@ -688,7 +692,11 @@ builtin_variable_generator::generate_uniforms()
>>        add_uniform(mat4_t, "gl_ProjectionMatrixInverseTranspose");
>>        add_uniform(mat4_t, "gl_ModelViewProjectionMatrixInverseTranspose");
>>        add_uniform(float_t, "gl_NormalScale");
>> -      add_uniform(type("gl_LightModelParameters"), "gl_LightModel");
>> +
>> +      const glsl_type *const light_model_parameters_type =
>> +         type("gl_LightModelParameters");
>> +      assert(light_model_parameters_type);
>> +      add_uniform(light_model_parameters_type, "gl_LightModel");
>>        add_uniform(vec2_t, "gl_BumpRotMatrix0MESA");
>>        add_uniform(vec2_t, "gl_BumpRotMatrix1MESA");
>>        add_uniform(vec4_t, "gl_FogParamsOptimizedMESA");
>> @@ -701,10 +709,15 @@ builtin_variable_generator::generate_uniforms()
>>        add_uniform(mat4_array_type, "gl_TextureMatrixInverseTranspose");
>>
>>        add_uniform(array(vec4_t, state->Const.MaxClipPlanes), "gl_ClipPlane");
>> -      add_uniform(type("gl_PointParameters"), "gl_Point");
>> +
>> +      const glsl_type *const point_parameters_type =
>> +         type("gl_PointParameters");
>> +      assert(point_parameters_type);
>> +      add_uniform(point_parameters_type, "gl_Point");
>>
>>        const glsl_type *const material_parameters_type =
>>          type("gl_MaterialParameters");
>> +      assert(material_parameters_type);
>>        add_uniform(material_parameters_type, "gl_FrontMaterial");
>>        add_uniform(material_parameters_type, "gl_BackMaterial");
>>
>> @@ -714,6 +727,7 @@ builtin_variable_generator::generate_uniforms()
>>
>>        const glsl_type *const light_model_products_type =
>>           type("gl_LightModelProducts");
>> +      assert(light_model_products_type);
>>        add_uniform(light_model_products_type, "gl_FrontLightModelProduct");
>>        add_uniform(light_model_products_type, "gl_BackLightModelProduct");
>>
>> @@ -736,7 +750,9 @@ builtin_variable_generator::generate_uniforms()
>>        add_uniform(texcoords_vec4, "gl_ObjectPlaneR");
>>        add_uniform(texcoords_vec4, "gl_ObjectPlaneQ");
>>
>> -      add_uniform(type("gl_FogParameters"), "gl_Fog");
>> +      const glsl_type *const fog_parameters_type = type("gl_FogParameters");
>> +      assert(fog_parameters_type);
>> +      add_uniform(fog_parameters_type, "gl_Fog");
>>     }
>>  }
>>
>> --
>> 1.8.1.2
>
> Does this help something? asserts are no-ops in optimized builds, so
> adding them won't fix klocwork issues.
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 16 Jan 2014 13:51:32 -0500
> From: Ilia Mirkin <imirkin at alum.mit.edu>
> To: Emil Velikov <emil.l.velikov at gmail.com>
> Cc: "mesa-dev at lists.freedesktop.org" <mesa-dev at lists.freedesktop.org>
> Subject: Re: [Mesa-dev] [PATCH 05/10] nv50: assert before trying to
>         out-of-bounds access vtxbuf
> Message-ID:
>         <CAKb7UviseT_CNPffDZ7=hejZb_CaKsXuwt+=md+7bty8MfeWBA at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Thu, Jan 16, 2014 at 1:44 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>  src/gallium/drivers/nouveau/nv50/nv50_context.c |  2 ++
>>  src/gallium/drivers/nouveau/nv50/nv50_push.c    |  1 +
>>  src/gallium/drivers/nouveau/nv50/nv50_vbo.c     | 12 +++++++++++-
>>  3 files changed, 14 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c
>> index 9ea425e..a4ec93a 100644
>> --- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
>> +++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
>> @@ -80,6 +80,7 @@ nv50_context_unreference_resources(struct nv50_context *nv50)
>>
>>     util_unreference_framebuffer_state(&nv50->framebuffer);
>>
>> +   assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
>>     for (i = 0; i < nv50->num_vtxbufs; ++i)
>>        pipe_resource_reference(&nv50->vtxbuf[i].buffer, NULL);
>>
>> @@ -149,6 +150,7 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
>>     }
>>
>>     if (res->bind & PIPE_BIND_VERTEX_BUFFER) {
>> +      assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
>>        for (i = 0; i < nv50->num_vtxbufs; ++i) {
>>           if (nv50->vtxbuf[i].buffer == res) {
>>              nv50->dirty |= NV50_NEW_ARRAYS;
>> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_push.c b/src/gallium/drivers/nouveau/nv50/nv50_push.c
>> index 3e9a409..a3a397c 100644
>> --- a/src/gallium/drivers/nouveau/nv50/nv50_push.c
>> +++ b/src/gallium/drivers/nouveau/nv50/nv50_push.c
>> @@ -219,6 +219,7 @@ nv50_push_vbo(struct nv50_context *nv50, const struct pipe_draw_info *info)
>>     ctx.packet_vertex_limit = nv50->vertex->packet_vertex_limit;
>>     ctx.vertex_words = nv50->vertex->vertex_size;
>>
>> +   assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
>>     for (i = 0; i < nv50->num_vtxbufs; ++i) {
>>        const struct pipe_vertex_buffer *vb = &nv50->vtxbuf[i];
>>        const uint8_t *data;
>> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
>> index 947c67d..1dcccfe 100644
>> --- a/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
>> +++ b/src/gallium/drivers/nouveau/nv50/nv50_vbo.c
>> @@ -192,6 +192,7 @@ static INLINE void
>>  nv50_user_vbuf_range(struct nv50_context *nv50, int vbi,
>>                       uint32_t *base, uint32_t *size)
>>  {
>> +   assert(vbi < PIPE_MAX_ATTRIBS);
>
> Also make the parameter a uint?
>
>>     if (unlikely(nv50->vertex->instance_bufs & (1 << vbi))) {
>>        /* TODO: use min and max instance divisor to get a proper range */
>>        *base = 0;
>> @@ -211,6 +212,7 @@ nv50_upload_user_buffers(struct nv50_context *nv50,
>>  {
>>     unsigned b;
>>
>> +   assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
>>     for (b = 0; b < nv50->num_vtxbufs; ++b) {
>>        struct nouveau_bo *bo;
>>        const struct pipe_vertex_buffer *vb = &nv50->vtxbuf[b];
>> @@ -241,9 +243,12 @@ nv50_update_user_vbufs(struct nv50_context *nv50)
>>     for (i = 0; i < nv50->vertex->num_elements; ++i) {
>>        struct pipe_vertex_element *ve = &nv50->vertex->element[i].pipe;
>>        const unsigned b = ve->vertex_buffer_index;
>> -      struct pipe_vertex_buffer *vb = &nv50->vtxbuf[b];
>> +      struct pipe_vertex_buffer *vb;
>>        uint32_t base, size;
>>
>> +      assert(b < PIPE_MAX_ATTRIBS);
>> +      vb = &nv50->vtxbuf[b];
>> +
>>        if (!(nv50->vbo_user & (1 << b)))
>>           continue;
>>
>> @@ -306,6 +311,7 @@ nv50_vertex_arrays_validate(struct nv50_context *nv50)
>>
>>     if (!nv50->vbo_fifo) {
>>        /* if vertex buffer was written by GPU - flush VBO cache */
>> +      assert(nv50->num_vtxbufs <= PIPE_MAX_ATTRIBS);
>>        for (i = 0; i < nv50->num_vtxbufs; ++i) {
>>           struct nv04_resource *buf = nv04_resource(nv50->vtxbuf[i].buffer);
>>           if (buf && buf->status & NOUVEAU_BUFFER_STATUS_GPU_WRITING) {
>> @@ -332,6 +338,8 @@ nv50_vertex_arrays_validate(struct nv50_context *nv50)
>>     }
>>     for (i = 0; i < vertex->num_elements; ++i) {
>>        const unsigned b = vertex->element[i].pipe.vertex_buffer_index;
>> +
>> +      assert(b < PIPE_MAX_ATTRIBS);
>>        ve = &vertex->element[i];
>>        vb = &nv50->vtxbuf[b];
>>
>> @@ -360,6 +368,8 @@ nv50_vertex_arrays_validate(struct nv50_context *nv50)
>>     for (i = 0; i < vertex->num_elements; ++i) {
>>        uint64_t address, limit;
>>        const unsigned b = vertex->element[i].pipe.vertex_buffer_index;
>> +
>> +      assert(b < PIPE_MAX_ATTRIBS);
>>        ve = &vertex->element[i];
>>        vb = &nv50->vtxbuf[b];
>>
>> --
>> 1.8.5.2
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 16 Jan 2014 13:54:17 -0500
> From: Ilia Mirkin <imirkin at alum.mit.edu>
> To: Emil Velikov <emil.l.velikov at gmail.com>
> Cc: "mesa-dev at lists.freedesktop.org" <mesa-dev at lists.freedesktop.org>
> Subject: Re: [Mesa-dev] [PATCH 00/10] nv50: out-of-bounds access of
>         context specific attribs
> Message-ID:
>         <CAKb7UvihSp9L8VhMCYaUip6uGokcrxTV99-p=5P0_dX__9sfjw at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Thu, Jan 16, 2014 at 1:44 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> Subject: [PATCH 00/10] nv50: out-of-bounds access of context specific attribs
>> In-Reply-To:
>>
>> So here it goes, a few serious patches and some not as much
>>
>> Patches 1, 2 correct the range to be within the defined boundaries
>> when invalidating the textures/constbufs. Most likely a copy/paste
>> typo from the nvc0 driver.
>>
>> Patches 3, 5, 7, 8, 9 introduce asserts which may not be stricly
>> needed. I'm open to suggestions
>>
>> Patches 4, 6 changes the type of variables used to store the index
>> to be unsigned.
>>
>> And patch 10 provides a small/trivial cleanup at the context_ctor
>> errot path.
>
> Series is
>
> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
>
> Nice cleanups! And it should make future bugs a bit more obvious.
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 16 Jan 2014 10:58:19 -0800
> From: Matt Turner <mattst88 at gmail.com>
> To: Ian Romanick <idr at freedesktop.org>
> Cc: "mesa-dev at lists.freedesktop.org" <mesa-dev at lists.freedesktop.org>,
>         Ian Romanick <ian.d.romanick at intel.com>
> Subject: Re: [Mesa-dev] [PATCH 1/3] docs: Update GL3.txt due to recent
>         work
> Message-ID:
>         <CAEdQ38FxGt87xfNvfeZYLc171zXb51mAOhm54yT-JQ+KtjzdEQ at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Thu, Jan 16, 2014 at 10:44 AM, Ian Romanick <idr at freedesktop.org> wrote:
>> From: Ian Romanick <ian.d.romanick at intel.com>
>>
>> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
>> ---
>>  docs/GL3.txt | 18 +++++++++---------
>>  1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/docs/GL3.txt b/docs/GL3.txt
>> index 0672ec7..be78652 100644
>> --- a/docs/GL3.txt
>> +++ b/docs/GL3.txt
>> @@ -55,7 +55,7 @@ GL 3.1 --- all DONE: i965, nv50, nvc0, r600, radeonsi
>>    Forward compatible context support/deprecations       DONE ()
>>    Instanced drawing (GL_ARB_draw_instanced)             DONE (swrast)
>>    Buffer copying (GL_ARB_copy_buffer)                   DONE (r300, swrast)
>> -  Primitive restart (GL_NV_primitive_restart)           DONE (r300, )
>> +  Primitive restart (GL_NV_primitive_restart)           DONE (r300)
>>    16 vertex texture image units                         DONE ()
>>    Texture buffer objs (GL_ARB_texture_buffer_object)    DONE for OpenGL 3.1 contexts ()
>>    Rectangular textures (GL_ARB_texture_rectangle)       DONE (r300, swrast)
>> @@ -83,9 +83,9 @@ GL 3.3 --- all DONE: i965
>>
>>    GLSL 3.30                                             DONE ()
>>    GL_ARB_blend_func_extended                            DONE (nv50, nvc0, r600, radeonsi, softpipe)
>> -  GL_ARB_explicit_attrib_location                       DONE (i915, nv50, nvc0, r300, r600, radeonsi, swrast)
>> +  GL_ARB_explicit_attrib_location                       DONE (all drivers that support GLSL)
>>    GL_ARB_occlusion_query2                               DONE (nv50, nvc0, r300, r600, radeonsi, swrast)
>> -  GL_ARB_sampler_objects                                DONE (nv50, nvc0, r300, r600, radeonsi)
>> +  GL_ARB_sampler_objects                                DONE (all drivers)
>>    GL_ARB_shader_bit_encoding                            DONE (nv50, nvc0, r600, radeonsi)
>>    GL_ARB_texture_rgb10_a2ui                             DONE (r600, radeonsi)
>>    GL_ARB_texture_swizzle                                DONE (nv50, nvc0, r300, r600, radeonsi, swrast)
>> @@ -117,10 +117,10 @@ GL 4.1:
>>    GLSL 4.1                                             not started
>>    GL_ARB_ES2_compatibility                             DONE (i965, r300, r600, radeonsi)
>>    GL_ARB_get_program_binary                            DONE (0 binary formats)
>> -  GL_ARB_separate_shader_objects                       some infrastructure done
>> +  GL_ARB_separate_shader_objects                       started (Ian Romanick, Gregory Hainaut)
>>    GL_ARB_shader_precision                              not started
>>    GL_ARB_vertex_attrib_64bit                           not started
>> -  GL_ARB_viewport_array                                not started
>> +  GL_ARB_viewport_array                                started (Ian Romanick, Courtney Goeltzenleuchter)
>>
>>
>>  GL 4.2:
>> @@ -144,8 +144,8 @@ GL 4.3:
>>    GLSL 4.3                                             not started
>>    GL_ARB_arrays_of_arrays                              not started
>>    GL_ARB_ES3_compatibility                             DONE (i965)
>> -  GL_ARB_clear_buffer_object                           not started
>> -  GL_ARB_compute_shader                                not started
>> +  GL_ARB_clear_buffer_object                           DONE (all drivers)
>> +  GL_ARB_compute_shader                                started (Paul Berry)
>>    GL_ARB_copy_image                                    not started
>>    GL_KHR_debug                                         DONE (all drivers)
>>    GL_ARB_explicit_uniform_location                     not started
>> @@ -162,7 +162,7 @@ GL 4.3:
>>    GL_ARB_texture_buffer_range                          DONE (nv50, nvc0, i965, r600, radeonsi)
>>    GL_ARB_texture_query_levels                          DONE (i965)
>>    GL_ARB_texture_storage_multisample                   DONE (all drivers that support GL_ARB_texture_multisample)
>> -  GL_ARB_texture_view                                  not started
>> +  GL_ARB_texture_view                                  started (Courtney Goeltzenleuchter, Chris Forbes)
>>    GL_ARB_vertex_attrib_binding                         DONE (all drivers)
>>
>>
>> @@ -173,7 +173,7 @@ GL 4.4:
>>    GL_ARB_buffer_storage                                not started
>>    GL_ARB_clear_texture                                 not started
>>    GL_ARB_enhanced_layouts                              not started
>> -  GL_ARB_multi_bind                                    not started
>> +  GL_ARB_multi_bind                                    started (Maxence Le Dor?)
>
> I don't think we were going forward with Maxence's patches, and rather
> going with Fredrik's (Cc'd). Fredrik, what's the current status?
>
>
> ------------------------------
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
> End of mesa-dev Digest, Vol 46, Issue 190
> *****************************************


More information about the mesa-dev mailing list