Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Direct3D API suggestions

2 views
Skip to first unread message

Hexadecimal

unread,
Sep 19, 2009, 10:02:26 PM9/19/09
to
Let me start by saying that I am pleased with the progression of the
Direct3D API. I would like to state my observations and suggestions
for future iterations of the API.

1) Now that we have new buffer types (structured buffers, byte address
buffers), the need for the input assembler seems to be shrinking. I
have a feeling it helps performance a bit, but it would be nice to see
this eliminated. That way, the indexed rendering calls would be
eliminated and the number of paths would decrease. The only problem I
can think of here is DrawAuto, but maybe it could just bind a buffer
to a shader resource slot instead of the input assembler.

2) I was told that this is currently a hardware limitation, but it
would be nice to be able to set the number of threads-per-group and
shared memory amount for compute shaders at dispatch time. If it's
still true that using too much shared memory decreases efficiency,
then I'd say that having the ability to set these parameters at
dispatch time is useful (and avoids having to compile many variations
of a single shader).

3) Another hardware limitation: reading and writing from a multi-
component RWTexture*/RWBuffer. Being able to cast 32-bit texture
types into R32_UINT UAVs is nice, but it would also be useful to be
able to read-write a 128-bit type for example.

4) More flexible buffer copying. I ran into a (small) limitation just
the other day -- I tried calling UpdateResource on a structured buffer
array and found that I have to update in units of the struct size; I
can't update part of one struct using this call it seems. Also, it
would be nice to be able to copy between two differently strided
structured buffer resources (such as copying an index from one into a
single location of another). I realize that this depends on the
cooperation of hardware vendors.

5) One for DXGI. After having used Direct3D10 <-> Direct2D interop, I
have noticed one limitation that seems unnecessary: it isn't possible
to obtain an IDXGISurface representation for a mipmapped/multi-layer
2D texture. This could also be solved by adding some kind of shader
resource view thing into D2D, but this adds dependencies to D2D
(though it seems that it requires me to create a D3D10 device
anyway...)

Thanks for listening,
Seth

Richard [Microsoft Direct3D MVP]

unread,
Sep 20, 2009, 8:26:52 PM9/20/09
to
[Please do not mail me a copy of your followup]

Hexadecimal <hex...@gmail.com> spake the secret code
<163e16db-0f58-4c25...@a39g2000pre.googlegroups.com> thusly:

>1) Now that we have new buffer types (structured buffers, byte address
>buffers), the need for the input assembler seems to be shrinking. I
>have a feeling it helps performance a bit, but it would be nice to see
>this eliminated. That way, the indexed rendering calls would be
>eliminated and the number of paths would decrease. The only problem I
>can think of here is DrawAuto, but maybe it could just bind a buffer
>to a shader resource slot instead of the input assembler.

Indexed rendering calls are a huge performance win. I don't know why
you want to see them go away.

>5) One for DXGI. After having used Direct3D10 <-> Direct2D interop, I
>have noticed one limitation that seems unnecessary: it isn't possible
>to obtain an IDXGISurface representation for a mipmapped/multi-layer
>2D texture.

I'm not sure what you mean by a "multi-layer" texture as there is no
direct concept of layers in Direct3D.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

Hexadecimal

unread,
Sep 20, 2009, 8:56:26 PM9/20/09
to
On Sep 20, 7:26 pm, legalize+jee...@mail.xmission.com (Richard

[Microsoft Direct3D MVP]) wrote:
> [Please do not mail me a copy of your followup]
>
> Hexadecimal <hex...@gmail.com> spake the secret code
> <163e16db-0f58-4c25-a3dd-9ee612308...@a39g2000pre.googlegroups.com> thusly:

Indexed rendering can still be performed with my idea; the vertex/
normal/UV buffer(s) would be bound as Buffer<>s, and the index buffer
would simply be another Buffer<>. The index buffer would be indexed
with SV_VertexID, and the result would be used to index the vertex/
normal/UV buffer. However, this does involve a level of indirection
and thus the IA might still win out. However, I have found that
keeping the number of per-instance attributes low in the IA is a
performance win -- I suppose it'd be best to use the IA for per-vertex
data, and bind Buffer<>s/StructuredBuffer<>s for per-instance data (if
there are lots of per-instance attributes).

As for multi-layer 2D textures, I am talking about the ArraySize
member of D3D10_TEXTURE2D_DESC. It isn't possible to obtain an
IDXGISurface representation of a single subresource of a 2D texture
with mipmaps and/or more than one layer in the array. This means that
I can't render directly into one subresource (a single layer on a
particular mip level) using D2D. I instead have to render into a
"plain old" 2D texture, then perform an on-device copy into my multi-
layer/mipmapped 2D texture. This isn't a major limitation, but
something worth looking into in my opinion.

Thanks,
Seth

MC

unread,
Oct 22, 2009, 11:53:01 PM10/22/09
to

"Richard [Microsoft Direct3D MVP]" wrote:
> I'm not sure what you mean by a "multi-layer" texture as there is no
> direct concept of layers in Direct3D.

Hi Richard,

As you say above is that you mean that Direct3D does not provide any layer
control?(The layer i mean was the display that have close and far object
which the close object will overlap the far object).

As i know there is layer control for DirectDraw and how bout Direct3D?


Richard [Microsoft Direct3D MVP]

unread,
Oct 30, 2009, 6:43:00 PM10/30/09
to
[Please do not mail me a copy of your followup]

=?Utf-8?B?TUM=?= <M...@discussions.microsoft.com> spake the secret code
<E810D5B0-9A19-491E...@microsoft.com> thusly:

>"Richard [Microsoft Direct3D MVP]" wrote:
>> I'm not sure what you mean by a "multi-layer" texture as there is no
>> direct concept of layers in Direct3D.
>

>As you say above is that you mean that Direct3D does not provide any layer
>control?

Direct3D provides a set of facilities that you can use to implement
layers as stacks of images on top of one another. It doens't have any
API calls or data structures that reference "layers".

>(The layer i mean was the display that have close and far object
>which the close object will overlap the far object).

There are any number of ways you could implement this: painter's
algorithm, the depth buffer and pixel shaders are just a few.

>As i know there is layer control for DirectDraw and how bout Direct3D?

Direct3D doesn't have layers the way DirectDraw had them. It has
other mechanisms that can be used to achieve the same end visual
result.

0 new messages