Techniques and passes without Effects11

Started by
2 comments, last by drowsyn 11 years, 10 months ago
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.
Advertisement
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

I gets all your texture budgets!

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.
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!

This topic is closed to new replies.

Advertisement