• Advertisement
Sign in to follow this  

Vertex shader 1.1 assembler error (dcl_position)

This topic is 2775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey all,

I have this HLSL code:

// Vertex shader input structure
struct VS_INPUT
{
float4 Position : POSITION;
float2 Texture : TEXCOORD0;
};


// Vertex shader output structure
struct VS_OUTPUT
{
float4 Position : POSITION;
float2 Texture : TEXCOORD0;
};


// Global variables
float4x4 WorldViewProj;


VS_OUTPUT main( in VS_INPUT In )
{
VS_OUTPUT Out; //create an output vertex
Out.Position = mul(In.Position, WorldViewProj); //apply vertex transformation
Out.Texture = In.Texture; //copy original texcoords
return Out; //return output vertex
}


Since Im using DX8, I have to compile it with FXC:

//
// Generated by Microsoft (R) D3DX9 Shader Compiler 9.15.779.0000
//
// fxc /nologo /Tvs_1_1 /LD /Emain prj2
//
//
// Parameters:
//
// float4x4 WorldViewProj;
//
//
// Registers:
//
// Name Reg Size
// ------------- ----- ----
// WorldViewProj c0 4
//

vs_1_1
dcl_position v0
dcl_texcoord v1
dp4 oPos.x, v0, c0
dp4 oPos.y, v0, c1
dp4 oPos.z, v0, c2
dp4 oPos.w, v0, c3
mov oT0.xy, v1

// approximately 5 instruction slots used



its good, but when I try to "D3DXAssembleShader" this code, it drops "syntax error" to line 2. The "vs_1_1" is replaced to "vs.1.1".

Whats wrong with it? The simplest example:

vs.1.1
dcl_position v0
m4x4 oPos, v0, c0
mov oD0, c4

doesnt get compiled neither. I used to work with pixel shader, I havent found this kind of unexplainable misterousness.

Share this post


Link to post
Share on other sites
Advertisement
I don’t have an old DX8 SDK by hand right now. But if I remember correctly there were some changes in the assembler language from 8 to 9. Your FXC version looks like one from a DX9 SDK. I assume your D3DX lib is still from an old DX8 SDK.

Any reason why you not port to DX9? It’s a quick and easy job.

Share this post


Link to post
Share on other sites
Does the old 8.0, 8.1 DX SDK contain fxc.exe? I dont think so.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement