Jump to content

  • Log In with Google      Sign In   
  • Create Account

Matias Goldberg

Member Since 02 Jul 2006
Offline Last Active Yesterday, 07:00 PM

Posts I've Made

In Topic: Direct3D 11.3 and SM 5.1?

23 August 2016 - 10:00 PM

Why do you need dynamic indexing? Most of the time you can get away with indexing const/Tex buffers and texture arrays. Is there something in particular you want to achieve?


In Topic: Direct3D 11.3 and SM 5.1?

21 August 2016 - 12:04 PM

Long shot: Try creating the device with D3D_FEATURE_LEVEL_11_3; if the enumeration is not present in your headers use the value 0xb300


In Topic: Shader array limit?

18 August 2016 - 01:39 PM

Using SSBO is overkill. The problem is you're requesting 90 UBOs instead of an UBO with 90 elements in it.
 
Change your code to:
 

struct CSpotLight
{
vec3 vColor;
vec3 vPosition;
vec3 vDirection;
float fConeAngle;
float fConeCosine;
float fLinearAtt;
bool Enabled;
};

uniform SpotLightBuffer
{
CSpotLight SpotLights[90];
} spotLightBuffer;

//Then access it via:
spotLightBuffer.SpotLights[i];

In Topic: dx11 draw instance with different material

17 August 2016 - 12:28 PM

There is a 3rd option:

 

Create an array of materials:

struct Material
{
float4 alpha_test_threshold;
float4 diffuse;


uint4 textureIndices0_3;
};


cbuffer materialArray : register(b1)
{
Material materialArray[1024];
};

And index them via SV_InstanceID:

materialArray[instanceId];

Note that SV_InstanceID always starts from 0 regardless from what baseInstance parameter in DrawPrimitive says. If you want an instance ID that starts from baseInstance, you'll need to setup an instance buffer pre-filled with values from [0; arbitraryLimit) and use that buffer instead.

 

This technique trades a little GPU overhead (an indirection + higher VGPR pressure instead of SGPR pressure) for massive lower CPU overheads.


In Topic: How Long Will Directx Last For?

12 August 2016 - 10:32 PM

The same applies to DirectDraw. In the beginning they were separate, one for 2D the other 3D.

Beginning DirectX 8, DDraw began a slow deprecation (moving towards doing everything in D3D) until it was completely phased out in DirectX10.

 

DDraw could have bugs or not, just like D3D applications. But it's more likely to have fewer bugs. A major advantage is that on Windows XP DDraw acceleration can be turned off as CPUs should be fast enough the kind of work we supplied in the 90's to DDraw; and in Windows Vista+ it can be turned off via the DirectX Control Panel switch or reg keys (though not beginners).


PARTNERS