Add HasTypedUAVLoad to GPULimits (use for GPU lightmaps support baking detection)
#526
This commit is contained in:
@@ -296,26 +296,16 @@ bool GPUDeviceDX11::Init()
|
||||
ASSERT(createdFeatureLevel == targetFeatureLevel);
|
||||
_state = DeviceState::Created;
|
||||
|
||||
// Verify compute shader is supported on DirectX 11
|
||||
if (createdFeatureLevel >= D3D_FEATURE_LEVEL_11_0)
|
||||
{
|
||||
D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS options = { 0 };
|
||||
_device->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &options, sizeof(options));
|
||||
if (!options.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x)
|
||||
{
|
||||
_device->Release();
|
||||
_device = nullptr;
|
||||
LOG(Fatal, "DirectCompute is not supported by this device (DirectX 11 level).");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Init device limits
|
||||
{
|
||||
auto& limits = Limits;
|
||||
if (createdFeatureLevel >= D3D_FEATURE_LEVEL_11_0)
|
||||
{
|
||||
limits.HasCompute = true;
|
||||
D3D11_FEATURE_DATA_D3D10_X_HARDWARE_OPTIONS d3D10XHardwareOptions = {};
|
||||
_device->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &d3D10XHardwareOptions, sizeof(d3D10XHardwareOptions));
|
||||
D3D11_FEATURE_DATA_D3D11_OPTIONS2 featureDataD3D11Options2 = {};
|
||||
_device->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS2, &featureDataD3D11Options2, sizeof(featureDataD3D11Options2));
|
||||
limits.HasCompute = d3D10XHardwareOptions.ComputeShaders_Plus_RawAndStructuredBuffers_Via_Shader_4_x != 0;
|
||||
limits.HasTessellation = true;
|
||||
limits.HasGeometryShaders = true;
|
||||
limits.HasInstancing = true;
|
||||
@@ -326,6 +316,7 @@ bool GPUDeviceDX11::Init()
|
||||
limits.HasDepthAsSRV = true;
|
||||
limits.HasReadOnlyDepth = true;
|
||||
limits.HasMultisampleDepthAsSRV = true;
|
||||
limits.HasTypedUAVLoad = featureDataD3D11Options2.TypedUAVLoadAdditionalFormats != 0;
|
||||
limits.MaximumMipLevelsCount = D3D11_REQ_MIP_LEVELS;
|
||||
limits.MaximumTexture1DSize = D3D11_REQ_TEXTURE1D_U_DIMENSION;
|
||||
limits.MaximumTexture1DArraySize = D3D11_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION;
|
||||
@@ -347,6 +338,7 @@ bool GPUDeviceDX11::Init()
|
||||
limits.HasDepthAsSRV = false;
|
||||
limits.HasReadOnlyDepth = createdFeatureLevel == D3D_FEATURE_LEVEL_10_1;
|
||||
limits.HasMultisampleDepthAsSRV = false;
|
||||
limits.HasTypedUAVLoad = false;
|
||||
limits.MaximumMipLevelsCount = D3D10_REQ_MIP_LEVELS;
|
||||
limits.MaximumTexture1DSize = D3D10_REQ_TEXTURE1D_U_DIMENSION;
|
||||
limits.MaximumTexture1DArraySize = D3D10_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION;
|
||||
|
||||
Reference in New Issue
Block a user