Advertisement

unableto compile vertex shader using fxc vs2017

Started by January 13, 2020 09:45 AM
1 comment, last by MJP 5 years ago

this is my vertex shader,

struct WorldViewProjection
{
	matrix WVP;
};

ConstantBuffer<WorldViewProjection> WorldViewProjectionCB : register(b0);

struct PSInput
{
    float4 position : SV_POSITION;
    float3 uvw : TEXCOORD;
};

PSInput main(float4 position : POSITION, float3 uvw : TEXCOORD) 
{
    PSInput result;

    result.position = position;
    result.uvw = uvw;

    return result;
}


when i try to compile it with in visual studiuo 2017 i get this error…

Severity Code Description Project File Line Suppression State

Error X3000 unrecognized identifier 'ConstantBuffer' ********vertexshader_volume.hlsl 6

i am correctly setting

shader type to /vs

shader model 5_0


but when i try to compile it with D3DcompileFromFile it works...

why i m not able to get a precompiled cso object....

The ConstantBuffer syntax you're using is only available in shader model 5.1 (it was added for D3D12).

This topic is closed to new replies.

Advertisement