HLSL image Shader Ps_2_0 Run no problem, ps_3_0 run a problem

Source: Internet
Author: User

a pixel shader was used in the recent development, I wrote a text data with D3dxcompileshaderfromfile to compile it, when I set to ps_2_0 a cut normally.

because the program needs to write more branch statements, and ps_2_0 the number of instructions such as limited, so I want to change to ps_3_0 version compile, compile normal "I tested the hardware, it is to support Ps_3_0 ".

Runtime discovery: The PS_2_0 image is displayed correctly; When using PS_3_0, the image is displayed incorrectly as a background image of the same color.


The way to resolve the problem: ps_3_0 needing a vertex shader . That is, when the PS_3_0 version is used, the support of the vertex shader is required to add a vertex coloring

Device after, run normally!



HLSL image Shader Ps_2_0 Run no problem, ps_3_0 run a problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.