Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b8cff9e

Browse files
qjia7Commit Bot
authored andcommitted
ES31: Add MAX_COMPUTE_SHARED_MEMORY_SIZE
Bug: angleproject:2682 Change-Id: If9100bee246dfb99fca3f0470742a337a126c9a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1476951 Reviewed-by: Geoff Lang <[email protected]> Reviewed-by: Jamie Madill <[email protected]> Commit-Queue: Jiajia Qin <[email protected]>
1 parent b36f7a2 commit b8cff9e

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,21 @@ size_t GetMaxComputeWorkGroupInvocations(D3D_FEATURE_LEVEL featureLevel)
893893
}
894894
}
895895

896+
unsigned int GetMaxComputeSharedMemorySize(D3D_FEATURE_LEVEL featureLevel)
897+
{
898+
switch (featureLevel)
899+
{
900+
// In D3D11 the maximum total size of all variables with the groupshared storage class is
901+
// 32kb.
902+
// https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-syntax
903+
case D3D_FEATURE_LEVEL_11_1:
904+
case D3D_FEATURE_LEVEL_11_0:
905+
return 32768u;
906+
default:
907+
return 0u;
908+
}
909+
}
910+
896911
size_t GetMaximumComputeUniformVectors(D3D_FEATURE_LEVEL featureLevel)
897912
{
898913
switch (featureLevel)
@@ -1491,6 +1506,7 @@ void GenerateCaps(ID3D11Device *device,
14911506
caps->maxComputeWorkGroupSize = GetMaxComputeWorkGroupSize(featureLevel);
14921507
caps->maxComputeWorkGroupInvocations =
14931508
static_cast<GLuint>(GetMaxComputeWorkGroupInvocations(featureLevel));
1509+
caps->maxComputeSharedMemorySize = GetMaxComputeSharedMemorySize(featureLevel);
14941510
caps->maxShaderUniformComponents[gl::ShaderType::Compute] =
14951511
static_cast<GLuint>(GetMaximumComputeUniformVectors(featureLevel)) * 4;
14961512
caps->maxShaderUniformBlocks[gl::ShaderType::Compute] =

src/tests/deqp_support/deqp_gles31_test_expectations.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
3032 D3D11 : dEQP-GLES31.functional.ssbo.layout.random.nested_structs_arrays_instance_arrays.13 = FAIL
7171
3032 D3D11 : dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer* = FAIL
7272

73-
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_compute_shared_memory_size_* = FAIL
7473
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_compute_atomic_counters_* = FAIL
7574
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_atomic_counter_buffer_size_* = FAIL
7675
1442 D3D11 : dEQP-GLES31.functional.state_query.integer.max_combined_atomic_counters* = FAIL

0 commit comments

Comments
 (0)