[Mesa-dev] gallium-bind-sampler-states branch

Chia-I Wu olvaffe at gmail.com
Mon Sep 16 09:27:10 PDT 2013


On Tue, Sep 17, 2013 at 12:09 AM, Brian Paul <brianp at vmware.com> wrote:
> On 09/15/2013 09:31 AM, Chia-I Wu wrote:
>>
>> On Sun, Sep 15, 2013 at 12:24 AM, Brian Paul <brianp at vmware.com> wrote:
>>>
>>> On 09/12/2013 09:06 PM, Chia-I Wu wrote:
>>>>
>>>>
>>>> Hi Brian,
>>>>
>>>> On Fri, Sep 13, 2013 at 8:46 AM, Brian Paul <brianp at vmware.com> wrote:
>>>>>
>>>>>
>>>>>
>>>>> I just pushed a gallium-bind-sampler-states branch to my git repo at
>>>>> git://people.freedesktop.org/~brianp/mesa
>>>>>
>>>>> It replaces the four
>>>>> pipe_context::bind_fragment/vertex/geometry/compute_sampler_states()
>>>>> functions with a single bind_sampler_states() function:
>>>>>
>>>>>    void (*bind_sampler_states)(struct pipe_context *,
>>>>>                                unsigned shader, unsigned start_slot,
>>>>>                                unsigned num_samplers, void **samplers);
>>>>>
>>>>> At this point start_slot is always zero (at least for non-compute
>>>>> shaders).
>>>>> And as the updated gallium docs explain, at some point calls to
>>>>> bind_sampler_states() will be used to updated sub-ranges, but that
>>>>> never
>>>>> happens currently.
>>>>>
>>>>> I've updated all the drivers, state trackers, utils, etc.
>>>>>
>>>>> I've tested the svga, llvmpipe and softpipe drivers.  'make check' and
>>>>> a
>>>>> texture subset of piglit pass w/out regressions.  I'd appreciate it if
>>>>> other
>>>>> driver developers would test their favorite driver.
>>>>
>>>>
>>>> For ilo, the new code does not follow the doc and unbinds samplers not
>>>> in
>>>> range.
>>>
>>>
>>>
>>> I think that's OK.  The CSO module (used by the state tracker) currently
>>> always calls pipe_context::bind_sampler_states() with start=0 and count
>>> such
>>> that it sets/replaces all samplers, never a sub-range.  That could/should
>>> change in the future.
>>>
>>> See single_sampler_done() in cso_context.c.
>>>
>>>
>>>
>>>> Is it fine if I implement the new bind_sampler_states as a helper
>>>> function on master branch, so that you hook it up to
>>>> pipe_context::bind_sampler_states in your branch and remove the old
>>>> ones?
>>>
>>>
>>>
>>> I'm not quite sure that I understand what you mean.  Can you elaborate?
>>
>> There is already ilo_bind_sampler_states that does what
>> pipe_context::bind_sampler_states expects, except that the function
>> returns a bool.  I can make it return void so that, in your branch,
>> you can initialize pipe_context::bind_sampler_states to it instead of
>> adding ilo_bind_sampler_states2.
>
>
> Sure, feel free to refactor as you see fit.  I didn't do that in the first
> place because the existing ilo_bind_X_sampler_states() functions are calling
> ilo_bind_sampler_states() twice and setting dirty flags.  I didn't feel
> comfortable rewriting all that and likely breaking it so I just wrapped
> things up with ilo_bind_sampler_states2().
I've pushed the change.  It is called twice by
ilo_bind_X_sampler_states() needs to bind the samplers in the range,
and unbind samplers that are not.

It's great to see the interface change.  Thanks for the work.  When
you get to work on consolidating set_X_sampler_views, I believe there
is also ilo_set_sampler_views that you can hook up to :P


>
> -Brian
>



-- 
olv at LunarG.com


More information about the mesa-dev mailing list