[Mesa-dev] [PATCH 1/2] st/mesa: fix texture buffer objects

Marek Olšák maraeo at gmail.com
Wed Feb 13 07:30:57 PST 2013


On Wed, Feb 13, 2013 at 4:03 PM, Brian Paul <brianp at vmware.com> wrote:
> On 02/12/2013 06:11 PM, Marek Olšák wrote:
>>
>> Broken by 624528834f53f54c7a934f929769b7e6b230a0b1.
>> ---
>>   src/mesa/state_tracker/st_atom_texture.c |   14 ++++++++++----
>>   1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_atom_texture.c
>> b/src/mesa/state_tracker/st_atom_texture.c
>> index 28327bc..fc2d690 100644
>> --- a/src/mesa/state_tracker/st_atom_texture.c
>> +++ b/src/mesa/state_tracker/st_atom_texture.c
>> @@ -234,11 +234,17 @@ update_single_texture(struct st_context *st,
>>      }
>>
>>      /* Determine the format of the texture sampler view */
>> -   view_format = stObj->pt->format;
>> +   if (texObj->Target == GL_TEXTURE_BUFFER) {
>> +      view_format =
>> +         st_mesa_format_to_pipe_format(stObj->base._BufferObjectFormat);
>> +   }
>> +   else {
>> +      view_format = stObj->pt->format;
>
>
> For buffer objects, isn't the stObj->pt->format field set like an ordinary
> texture?

stObj->pt->target is PIPE_BUFFER, so the format is most probably R8_UNORM.

glTexBuffer behaves pretty much like create_sampler_view and specifies
the format for the buffer.

Marek


More information about the mesa-dev mailing list