Jump to content
  • Advertisement
Sign in to follow this  
ArcticHammer

[SlimDX] Flexible Vertex Format (FVF) usage with nVidia and Intel?

This topic is 2445 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

Hi everyone,

We are successfully using compact vertex structure for Ati(AMD) Radeon GPUs, they work in all models about 5 years old or newer. We want to minimize the data amount to be written to the GPU for maximizing the performance, we are rendering 2D graphics with D3D9. The same vertex structure type doesn't work with any nVidia or Intel GPU in our app.

We can successfully use the following struct for Ati(AMD):

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]internal

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]struct [size="2"][color="#2b91af"][size="2"][color="#2b91af"]CompactVertex
[size="2"]{

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]float[size="2"] X;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]float[size="2"] Y;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]int[size="2"] Color;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]static [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexFormat[size="2"] Format = [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexFormat[size="2"].None;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]const [size="2"][color="#0000ff"][size="2"][color="#0000ff"]int[size="2"] StrideSize = 12;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]static [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"][] VertexElements =
[size="2"]{

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]new [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"](0, 0,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationType[size="2"].Float2,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationMethod[size="2"].Default,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationUsage[size="2"].PositionTransformed,0),

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]new [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"](0, 8,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationType[size="2"].Color,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationMethod[size="2"].Default,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationUsage[size="2"].Color, 0),

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"].VertexDeclarationEnd
[size="2"]};
[size="2"]}


And for nVidia and Intel, we have to use larger one:

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]internal

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]struct [size="2"][color="#2b91af"][size="2"][color="#2b91af"]LargeVertex
[size="2"]{

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]float[size="2"] X;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]float[size="2"] Y;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]float[size="2"] Z;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]float[size="2"] RHW;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]int[size="2"] Color;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]static [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexFormat[size="2"] Format = [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexFormat[size="2"].PositionRhw | [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexFormat[size="2"].Diffuse;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]const [size="2"][color="#0000ff"][size="2"][color="#0000ff"]int[size="2"] StrideSize = 20;

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]public [size="2"][color="#0000ff"][size="2"][color="#0000ff"]static [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"][] VertexElements =
[size="2"]{

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]new [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"](0, 0,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationType[size="2"].Float4,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationMethod[size="2"].Default,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationUsage[size="2"].PositionTransformed,0),

[size="2"][color="#0000ff"][size="2"][color="#0000ff"]new [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"](0, 16,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationType[size="2"].Color,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationMethod[size="2"].Default,

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]DeclarationUsage[size="2"].Color, 0),

[size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexElement[size="2"].VertexDeclarationEnd
[size="2"]};
[size="2"]}

[size="2"]We have tried to detect the compatible type by investigating
[size="2"][size="2"]bool compactSupported = (caps.FVFCaps & [size="2"][color="#2b91af"][size="2"][color="#2b91af"]VertexFormatCaps[size="2"].DoNotStripElements) == 0;


[size="2"][size="2"]Ati/AMD has flag value set to 0, Intel and nVidia 1.

and also tried to force the compact format into use in nVidia and Intel, but they fail to render it.

[size="2"]It's very difficult for me to believe that nVidia wouldn't support this kind of compact vertex type.

[size="2"]So, can you say what are we doing wrong, and how to get a compact vertex type (x,y,color) working with nVidia?

[size="2"]Thanks for any help...

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!