[Mesa-dev] [PATCH 1/4] gallium: add resource normalization flags (v3)

Keith Whitwell keithw at vmware.com
Tue Aug 17 07:32:19 PDT 2010


On Tue, 2010-08-17 at 00:09 -0700, Luca Barbieri wrote:
> -#define PIPE_BIND_STREAM_OUTPUT        (1 << 11) /*
> set_stream_output_buffers */
> +
> +/* Sampler views can be created based on this texture. Only the
> + * normalization preferred by the driver can be used, unless the
> other
> + * flags below are set as well. Only clamp wrap modes are allowed. */
> +#define PIPE_BIND_SAMPLER_VIEW_ANY     (1 << 2) /* get_sampler_view
> */

I don't see the need for this "any" flag -- if this is an internally
generated texture, the state tracker can query the driver, find out what
normalization it prefers, and then use that explicitly.  


> +/* State trackers must set this flag if they/the user API need to be
> able to use
> + * unnormalized coodinates with clamp, clamp-to-edge or
> clamp-to-border wrap
> + * mode with this resource when a sampler view based on it is bound.
> + *
> + * OpenCL and OpenGL TEXTURE_RECTANGLE textures will have this flag
> set.
> + */
> +#define PIPE_BIND_SAMPLER_VIEW_UNNORMALIZED_CLAMP ((1 << 2) | (1 <<
> 3))
> +
> +/* State trackers must set this flag if they/the user API need to be
> able to use
> + * unnormalized coordinates with non-clamp wrap modes with this
> resource
> + * when a sampler view based on it is bound.
> + *
> + * OpenCL textures will have this flag set.
> + */
> +#define PIPE_BIND_SAMPLER_VIEW_UNNORMALIZED_NON_CLAMP ((1 << 2) | (1
> << 4))
> +
> +/* State trackers must set this flag if they/the user API need to be
> able to use
> + * normalized coordinates with any wrap mode with this resource
> + * when a sampler view based on it is bound.
> + *
> + * OpenCL, OpenGL TEXTURE_2D and D3D11 textures will have this flag
> set.
> + */
> +#define PIPE_BIND_SAMPLER_VIEW_NORMALIZED ((1 << 2) | (1 << 5))


Is there a practical difference at the driver level between the two
unnormalized versions?  

I know some hardware will support one and not the other, but that's
something to be handled with queries.

Once we get around to creating a texture, is it going to get layed out
differently depending on whether it uses clamp vs wrap addressing?

Keith 



More information about the mesa-dev mailing list