Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Edge-Friend: Fast and Deterministic Catmull-Clark Subdivision Surfaces
    • Error Metrics for Smart Image Refinement
    • High-Quality Shadows for Streaming Terrain Rendering
    • Hybrid Sample-based Surface Rendering
    • Interactive rendering of Giga-Particle Fluid Simulations
    • Quantitative Analysis of Voxel Raytracing Acceleration Structures
    • Real-time Hybrid Hair Rendering
    • Real-Time Procedural Generation with GPU Work Graphs
    • Scalable rendering for very large meshes
    • Spatiotemporal Variance-Guided Filtering for Motion Blur
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
    • Towards Practical Meshlet Compression
  • About
  • Archive

DirectX11 hints ...

March 01, 2010
  • Direct3d
  • Graphics
approximately 1 minutes to read

Some stuff that might be useful if you’re getting started with DX11:

  • Tesselation:

    • If you get error X4577: Not all elements of SV_Position were written, make sure to write 4 elements positions in your domain shader.
    • error X3502: tessfactor inputs missing: For triangles and quads, you have to write both SV_TessFactor and SV_InsideTessFactor. The first determines the number of subdivisions for each edge, the second the internal subdivision. You should try to keep them somehow together, as widely varying values will result in totally broken polygons along the edge (basically, you’ll get vertices with a very high valence).
    • Freeze when rendering: Make sure to change your topology to D3D11_PRIMITIVE_TOPOLOGY_<N>_CONTROL_POINT_PATCHLIST, with being equal to the number of control points expected by your hull shader. Rendering using for instance D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST freezes my machine until Windows 7 resets the driver
  • Compute shader:

    • D3D11: WARNING: ID3D11DeviceContext::OMSetRenderTargets: Resource being set to OM RenderTarget slot 1 is still bound on input! [ STATE_SETTING WARNING #9: DEVICE_OMSETRENDERTARGETS_HAZARD ]````D3D11: WARNING: ID3D11DeviceContext::OMSetRenderTargets[AndUnorderedAccessViews]: Forcing CS shader resource slot 1 to NULL. [ STATE_SETTING WARNING #2097317: DEVICE_CSSETSHADERRESOURCES_HAZARD ] Easy, just make sure you unbind all resources after calling Dispatch by using CSSetShaderResources and an array of nullptr (or plain NULL, in pre-C++-0x days) resources.
    • In order to create a RW texture, use a D3D11_TEXTURE2D_DESC and specify D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS for binding. Then, just create an UnorderedAccessView on it.
    • Parameter binding has to be done in order. Use register (tN) for textures and structured buffers. uN is for unordered access views. I’ve put my constant buffers into bN, just in case.
  • HLSL:

    • If you need infinity, just use float i = 1.#INF.

So much for starts, I really do hope Microsoft improves the documentation of these parts, as it’s mostly trial&error for many things, despite having a nice debug layer on the runtime. Ah and yes, if anyone at ATI reads this: Crashing the driver in case of user errors is not helpful ;) I’ve seen plenty of freezes while doing CS development which required me to reboot; it’s slightly better with tessellation as Windows seems to be able to restart the driver each time.

Previous post
Next post

Recent posts

  • Data formats: Why CSV and JSON aren't the best
    Posted on 2024-12-29
  • Replacing cron with systemd-timers
    Posted on 2024-04-21
  • Open Source Maintenance
    Posted on 2024-04-02
  • Angular, Caddy, Gunicorn and Django
    Posted on 2023-10-21
  • Effective meetings
    Posted on 2022-09-12
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

Anteru NIV_Anteru
Contents © 2005-2025
Anteru
Imprint/Impressum
Privacy policy/Datenschutz
Made with Liara
Last updated February 03, 2019