I've been putting together my own little shader framework, and something that has me a little stumped is the concept of techniques and passes. I can't figure out how these things are supposed to work without using the Effects11 framework. What I'm essentially doing is that first I compile the shaders and create the ID3D11Vertex(/Pixel)Shader objects, and then just set them with VSSetShader and PSSetShader. I'd imagine that setting the technique and going through its passes would be somewhere either right before or right after setting the shaders, but there doesn't appear to be any API for using that stuff.
Surely there has to be a way to do multiple passes without using Effects11? I tried to dig into the Effects11 source too, but that just gave me a huge headache and left me fairly clueless. I'm starting to think that the whole idea of techniques and passes is something that only exists within the Effects11 framework, and isn't actually a part of "raw" HLSL shaders. If anyone could nudge me in the right direction, I'd really appreciate it.
3 replies to this topic
Sponsor:
#2 Members - Reputation: 2045
Posted 03 June 2012 - 09:43 AM
You're right, techniques and passes are a part of Effects11, and if you want to support them in your own shader framework you'll have to design and implement them yourself.
The shader reflection API can provide a starting point if you want to implement these
The shader reflection API can provide a starting point if you want to implement these
#3 GDNet+ - Reputation: 2372
Posted 03 June 2012 - 04:05 PM
You are completely right - the idea of techniques and passes is not part of the low level API. What you can think about is that for each pass, you need to provide a complete pipeline state (including all shader programs, state objects, and the resources needed by the shaders). Then for each of these passes, you execute a draw call to push your geometry through the pipeline.
A technique is just a way to have multiple of these setups within a single file. I personally don't use the concept of passes, but it can be a useful way to specify how you want something to be rendered.
A technique is just a way to have multiple of these setups within a single file. I personally don't use the concept of passes, but it can be a useful way to specify how you want something to be rendered.
Jason Zink :: DirectX MVP
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article
#4 Members - Reputation: 141
Posted 04 June 2012 - 02:25 AM
I moved to DX11 after working with XNA for a while and started working with the Effects11 stuff at first, so I started with the assumption that techniques and passes were a part of the API. Never assume anything!
Thanks guys!
Thanks guys!
Edited by drowsyn, 04 June 2012 - 05:32 AM.






