crazyxiazi
crazyxiazi

Reputation: 68

DirectX 11 Texture Slot in different Shaders

I have an array of Textures,and these Textures should be used in different shader. say Texture A,B should be used in vertex Shader. Texture B,C should be used in ps Shader. so what should I do. use an array of texture A ,B,C .and bind them to vs and ps use the sample sequence (is this correct?). or should I use sequence A B bind to vs .and sequence B C bind to Ps

Upvotes: 0

Views: 1425

Answers (1)

MooseBoys
MooseBoys

Reputation: 6783

Texture binding accross stages is independent, and has two levels of indirection - selection of bind point for a given SRV object (e.g. PSSetShaderResources(slot, ...)) and selection of bind point for a given HLSL texture declaration (e.g. Texture2D foo : register(t7))

Assuming your vertex and pixel shaders both use registers 0 and 1 for the two texture bind points, you would bind VS slots 0 and 1 to A and B, and PS slots 0 and 1 to B and C.

Upvotes: 1

Related Questions