Home > Software engineering >  D3d rendering texture rendering yuv video, cannot compile a shader.
D3d rendering texture rendering yuv video, cannot compile a shader.

Time:09-29

Today with d3d rendering yuv video, through the shader yuv RGB, but using D3DXCompileShaderFromResource compile shader is not through, also tried D3DXCompileShaderFromFile, are similar mistake, which, o great spirit to guide the appreciate, attached code:
D3DXCompileShaderFromResource (NULL,
LPCWSTR (" sampler YTex;"
"Sampler UTex;"
"Sampler VTex;"
"Struct PS_INPUT {
""Float2 y: TEXCOORD0;"
"The float2 u: TEXCOORD1;"
"Float2 v: TEXCOORD2; }
""Float4 Main (PS_INPUT input) : COLOR0 {
""Float y=tex2D (YTex, input. Y.) r;"
"Float u=tex2D (UTex, input u.x y/2), r - 0.5 f;"
"Float v=tex2D (VTex, input v.x y/2), r - 0.5 f;"
"Float r=y + 1.14 f * v;"
"Float g=y u - 0.581-0.394 f * f * v;"
"Float b=y + 2.03 f * u"
"Return float4 (r, g, b, 1); } "),
0,
0,
"Main",
"Ps_2_0,"
D3DXSHADER_USE_LEGACY_D3DX9_31_DLL,
& Shader,
& ErrorBuffer,
& MultiTexCT
);

Also try this:
Ret=D3DXCompileShaderFromFile (
(LPCWSTR) (" shader. TXT "),
0,
0,
"Main",//entry point function name
"Ps_2_0,"
D3DXSHADER_DEBUG,
& Shader,
& ErrorBuffer,
& MultiTexCT);
Error: error: error X1512: failed to open the resource
GetLastError () returns 1813.
I am on the virtual machine to use qt development,

CodePudding user response:

Try to use full path
  • Related