Render Targets, Video Memory, and Pixel Shaders

Hello,

I have just been thinking about the whole rasterization process and a question came up. It seems to be from the information I have researched that Pixel Processing can only be done in hardware. Customizable pixel processing which is what you do when you write a pixel shader in HLSL, most obviously has to be done in hardware. However, if I use the fixed function pipeline, does this mean that the pixel pipeline is implemented in hardware If I create a device using CreateDevice() with a device type of D3DDEVTYPE_REF or D3DDEVTYPE_SW, is the pixel processing still done in hardware

My thoughts on this are that pixel processing updates the render target, and that the render target is usually stored in video ram. This would make sense then because you would always need a video card to draw to the screen. What I am really wondering though is, why can't you have programmable or non programmable pixel shaders in software I mean, your render targets might not even be located on the card. Thanks for the info.




Answer this question

Render Targets, Video Memory, and Pixel Shaders

  • rastsan_caj

    jwhansen wrote:
    It seems to be from the information I have researched that Pixel Processing can only be done in hardware.

    For most applications these days rasterization, whether using pixel shaders or the fixed function pipeline, can't be done anywhere near fast enough on the CPU. You need to use the specialized rasterization hardware in a video card to get acceptable frame rates. Because of this, Direct3D 9 doesn't provide a software rasterizer usable by end-users. While the reference device (D3DDEVTYPE_REF) does do rasterization on the CPU, this device is only provided with the DirectX SDK, the end-user runtimes don't include it. It's possible to use "plug-in" software rasterizers (D3DDEVTYPE_SW) with Direct3D 9, but there are none provide with either the SDK or the end-user runtime.


  • Ferry Mulyono

    jwhansen wrote:
    What I am really wondering though is, why can't you have programmable or non programmable pixel shaders in software I mean, your render targets might not even be located on the card. Thanks for the info.

    You can however emulate pixel shaders in software by using TextureLoader.FillTexture. This method allows you to specify a TextureShader object in which you can specify how to fill the texture in HLSL. I don't have any first-hand experience with this, but apparently it is perfectly acceptable for offline texture preparation and may often be easier to use than texture locking.

    The remarks on CPU performance above still hold true though.



  • Render Targets, Video Memory, and Pixel Shaders