Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9246571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:31:18+00:00 2026-06-18T09:31:18+00:00

What is the best way to buffer Vertex Shaders, Pixel Shaders, etc into the

  • 0

What is the best way to buffer Vertex Shaders, Pixel Shaders, etc into the Device/Device Context without having to reload them from the filesystem every time?

ID3D11Device::CreateVertexShader
http://msdn.microsoft.com/en-us/library/windows/desktop/ff476524(v=vs.85).aspx

ID3D11DeviceContext::VSSetShader
http://msdn.microsoft.com/en-us/library/windows/desktop/ff476493(v=vs.85).aspx

Does Device::CreateVertexShader buffer a single instance of the shader in System, (not GPU), memory? Can I buffer more than 1?

DeviceContext::CreateVertexShader buffer a single instance of the shader in the GPU, (not System), memory? Can I buffer more than 1?

What are the recommended methods for buffering shaders within the system?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T09:31:19+00:00Added an answer on June 18, 2026 at 9:31 am

    When you use ID3D11Device::CreateVertexShader, you retrieve a reference to them, will represents your vertex shader in gpu, so if you have 3 vertex shaders you do:

    ID3D11VertexShader* vsref1;
    ID3D11VertexShader* vsref2;
    ID3D11VertexShader* vsref3;
    
    CreateVertexShader(bytecode1,sizeofbytecode1,NULL,&vsref1);
    CreateVertexShader(bytecode2,sizeofbytecode2,NULL,&vsref2);
    CreateVertexShader(bytecode3,sizeofbytecode3,NULL,&vsref3);
    

    Make sure you keep track of vsref1,2 and 3 (like as class members). Once created they are uploaded to your gpu, no need to do it again, VSSetShader is then called to select which one you want to use.

    Then you can assign your vertex shader to the pipeline anytime using:

    VSSetShader(vsref1,NULL,0);
    

    or

    VSSetShader(vsref2,NULL,0); 
    

    That doesn’t cause an upload, it’s just to tell your gpu which Vertex Shader you want to use for the next Draw call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What would be the best way to read an Int64BE from a node.js buffer
What is the best way to copy a string into a raw memory buffer
The best way to store images into MySQL is by storing the image location
I'm trying to copy vertex data from a texture to a vertex buffer, and
What would be the best way to check in an object being passed into
What is the best way to keep unacknowledged data buffer (sender's buffer) in TCP?
What is the best way to buffer incoming events/notifications your iPhone app is observing
Question What is the best way to convert binary to it's integral representation? Context
Whats the best way to extract a bit from an unsigned char .In my
Best way to match 2 pages for Google analytics. Pages to Query: 1.) this_google.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.