Skip to content

Commit

Permalink
ES31: Add MAX_COMPUTE_SHARED_MEMORY_SIZE
Browse files Browse the repository at this point in the history
Bug: angleproject:2682
Change-Id: If9100bee246dfb99fca3f0470742a337a126c9a5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1476951
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@google.com>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
  • Loading branch information
qjia7 authored and Commit Bot committed Mar 5, 2019
1 parent b36f7a2 commit b8cff9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,21 @@ size_t GetMaxComputeWorkGroupInvocations(D3D_FEATURE_LEVEL featureLevel)
}
}

unsigned int GetMaxComputeSharedMemorySize(D3D_FEATURE_LEVEL featureLevel)
{
switch (featureLevel)
{
// In D3D11 the maximum total size of all variables with the groupshared storage class is
// 32kb.
// https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-syntax
case D3D_FEATURE_LEVEL_11_1:
case D3D_FEATURE_LEVEL_11_0:
return 32768u;
default:
return 0u;
}
}

size_t GetMaximumComputeUniformVectors(D3D_FEATURE_LEVEL featureLevel)
{
switch (featureLevel)
Expand Down Expand Up @@ -1491,6 +1506,7 @@ void GenerateCaps(ID3D11Device *device,
caps->maxComputeWorkGroupSize = GetMaxComputeWorkGroupSize(featureLevel);
caps->maxComputeWorkGroupInvocations =
static_cast<GLuint>(GetMaxComputeWorkGroupInvocations(featureLevel));
caps->maxComputeSharedMemorySize = GetMaxComputeSharedMemorySize(featureLevel);
caps->maxShaderUniformComponents[gl::ShaderType::Compute] =
static_cast<GLuint>(GetMaximumComputeUniformVectors(featureLevel)) * 4;
caps->maxShaderUniformBlocks[gl::ShaderType::Compute] =
Expand Down
1 change: 0 additions & 1 deletion src/tests/deqp_support/deqp_gles31_test_expectations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
3032 D3D11 : dEQP-GLES31.functional.ssbo.layout.random.nested_structs_arrays_instance_arrays.13 = FAIL
3032 D3D11 : dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer* = FAIL

1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_compute_shared_memory_size_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_compute_atomic_counters_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_atomic_counter_buffer_size_* = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_combined_atomic_counters* = FAIL
Expand Down

0 comments on commit b8cff9e

Please sign in to comment.