Jump to content
  • Advertisement
Sign in to follow this  
Chrislilc

HLSL Shader texture buffer? ?

This topic is 2644 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi i have a question regarding textures from cpu to the gpu , im using SlimDX which is a direct x wrapper in C# , and im running DirectX11

i have recently changes all my shaders to constant buffers , and update them when needed acordingly ,
and atm in the draw function i use this to set the textures

effect.GetVariableByName("texture").AsResource().SetResource(texture);


isent there a way to set the textures once just like the method with constant buffers,


i use this to update resources



var data = new DataStream((4 * 4 * 4) * 3, true, true);
data.Write<Matrix>(Matrix.Transpose(Rot));
data.Write<Matrix>(Matrix.Transpose(Matrix.Translation(pos)));
data.Write<Matrix>(Matrix.Transpose(camera.View));
data.Position = 0;

effect.GetConstantBufferByName("bufferChanges").SetRawValue(data, (4 * 4 * 4) * 3);
data.Dispose();

any similar way to update textures ?? when i create a buffer i see under bindflags a option ShaderResource .. how can i write a ShaderresourceView to a Buffer ? ? ...

thnx alot ,


regards chris fuller

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!