[Mesa-dev] Gallium resources and new sampling opcodes

Zack Rusin zackr at vmware.com
Wed Jun 9 03:01:12 PDT 2010


Hey,

there's another branch with a significant impact that I'm planning to merge soon. gallium-resource-sampling. It effectively adds the concept of shader resources (currently required by both DX10+ and OpenCL). The idea is to allow arbitrary binding of resources in shaders with a number of new opcodes to access them.

So we're adding a new declaration along with a new register type to specify those resources. The syntax looks as follows:
DCL RES[#], resource, type
where resource can be one of 1D, 2D, 3D, CUBE and soon BUFFER, 1DArray and 2DArray and type can be one of UNORM, SNORM, SINT, UINT amd FLOAT. e.g.
DCL RES[0], 2D, FLOAT
DCL RES[1], 1D, UNORM, UNORM, UNORM, FLOAT
(the second declaration specifies types per component).

Those declared resources can in turn be used by the new sampling instructions, which include various versions of the SAMPLE instruction, LOAD instruction and GATHER4 instruction. All of them have been documented so I won't be explaining them here.

We're not deprecating the previous texturing opcodes to make sure that everything is still running fine. Future state trackers will certainly have to use those opcodes though to implement functionality of their respective api's, there's nothing we can do about that though.

Also, I know this is coming quickly. You might have noticed that Keith and Roland have been updating Gallium to make sure we can support modern api's, in particular DX10 a lot better, I've joined them now so things will move in a rapid fashion over the next two weeks. Over the next two weeks we'd like to add a number of new queries (e.g. pipeline statistics), improve conditional rendering to be able to specify the rendering condition (fail or pass), implement indexable immediate constant buffers, support for multiple independent constant buffers from shaders, finish texture arrays and implement whatever else we'll see DX10 apps using that can't be easily done on top of Gallium already.

z


More information about the mesa-dev mailing list