Sign in to follow this  

tbuffer resource view configuration

This topic is 1589 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,

As the topic name suggests I got a few questions about the creation of resource views for tbuffers.

 

I implemented the simplest case of a tbuffer like:

tbuffer MyTbuffer {
  matrix mat
};

I am creating the resource view with the following config and it works fine (allthough I am not quite sure why):

SRVConfig.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
SRVConfig.ViewDimension = D3D10_SRV_DIMENSION_BUFFER;
SRVConfig.Buffer.ElementOffset = 0;
SRVConfig.Buffer.NumElements = 4;

I can explain the 4 elemetns only because it targets a matrix which is built up of 4 times a value of the SRV format.

 

1.) Setting the Element width to 64 or to 16 will cause the SRV creation to fail, saying the ElementWidth has to be in range of [1, 4], why?

If this is really the byte width of one element, should't that be the byte width of matrix?

 

2.) Another thing i was wondering about is, that the D3D_BUFFER_SRV.NumElements and D3D_BUFFER_SRV.ElementWidth are allways set to the same value, why?

This causes both numElements and ElementWidth to be 4 in my example, which produces the expected results in my test application.

The fact the ByteWidth is set to 4 and the results seem to be right lets me doubt my own reason.

 

Would be nice if I could get some clarification regarding this.

Horrido!

Share this post


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