@@ -430,6 +430,7 @@ Renderer11::Renderer11(egl::Display *display)
430430 mRenderer11DeviceCaps .supportsVpRtIndexWriteFromVertexShader = false ;
431431 mRenderer11DeviceCaps .supportsDXGI1_2 = false ;
432432 mRenderer11DeviceCaps .allowES3OnFL10_0 = false ;
433+ mRenderer11DeviceCaps .supportsTypedUAVLoadAdditionalFormats = false ;
433434 mRenderer11DeviceCaps .B5G6R5support = 0 ;
434435 mRenderer11DeviceCaps .B4G4R4A4support = 0 ;
435436 mRenderer11DeviceCaps .B5G5R5A1support = 0 ;
@@ -1077,6 +1078,14 @@ void Renderer11::populateRenderer11DeviceCaps()
10771078 mRenderer11DeviceCaps .supportsVpRtIndexWriteFromVertexShader =
10781079 (d3d11Options3.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer == TRUE );
10791080 }
1081+ D3D11_FEATURE_DATA_D3D11_OPTIONS2 d3d11Options2;
1082+ result = mDevice ->CheckFeatureSupport (D3D11_FEATURE_D3D11_OPTIONS2, &d3d11Options2,
1083+ sizeof (D3D11_FEATURE_DATA_D3D11_OPTIONS2));
1084+ if (SUCCEEDED (result))
1085+ {
1086+ mRenderer11DeviceCaps .supportsTypedUAVLoadAdditionalFormats =
1087+ d3d11Options2.TypedUAVLoadAdditionalFormats ;
1088+ }
10801089 }
10811090
10821091 mRenderer11DeviceCaps .supportsMultisampledDepthStencilSRVs =
@@ -3419,6 +3428,14 @@ TextureStorage *Renderer11::createTextureStorage2DMultisample(GLenum internalfor
34193428 fixedSampleLocations, label);
34203429}
34213430
3431+ TextureStorage *Renderer11::createTextureStorageBuffer (
3432+ const gl::OffsetBindingPointer<gl::Buffer> &buffer,
3433+ GLenum internalFormat,
3434+ const std::string &label)
3435+ {
3436+ return new TextureStorage11_Buffer (this , buffer, internalFormat, label);
3437+ }
3438+
34223439TextureStorage *Renderer11::createTextureStorage2DMultisampleArray (GLenum internalformat,
34233440 GLsizei width,
34243441 GLsizei height,
@@ -4103,7 +4120,7 @@ angle::Result Renderer11::dispatchCompute(const gl::Context *context,
41034120 {
41044121 ANGLE_TRY (markRawBufferUsage (context));
41054122 }
4106-
4123+ ANGLE_TRY ( markTypedBufferUsage (context));
41074124 ANGLE_TRY (mStateManager .updateStateForCompute (context, numGroupsX, numGroupsY, numGroupsZ));
41084125 mDeviceContext ->Dispatch (numGroupsX, numGroupsY, numGroupsZ);
41094126
@@ -4315,6 +4332,26 @@ angle::Result Renderer11::mapResource(const gl::Context *context,
43154332 return angle::Result::Continue;
43164333}
43174334
4335+ angle::Result Renderer11::markTypedBufferUsage (const gl::Context *context)
4336+ {
4337+ const gl::State &glState = context->getState ();
4338+ ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram ());
4339+ gl::RangeUI imageRange = programD3D->getUsedImageRange (gl::ShaderType::Compute, false );
4340+ for (unsigned int imageIndex = imageRange.low (); imageIndex < imageRange.high (); imageIndex++)
4341+ {
4342+ GLint imageUnitIndex = programD3D->getImageMapping (gl::ShaderType::Compute, imageIndex,
4343+ false , context->getCaps ());
4344+ ASSERT (imageUnitIndex != -1 );
4345+ const gl::ImageUnit &imageUnit = glState.getImageUnit (imageUnitIndex);
4346+ if (imageUnit.texture .get ()->getType () == gl::TextureType::Buffer)
4347+ {
4348+ Buffer11 *buffer11 = GetImplAs<Buffer11>(imageUnit.texture .get ()->getBuffer ().get ());
4349+ ANGLE_TRY (buffer11->markTypedBufferUsage (context));
4350+ }
4351+ }
4352+ return angle::Result::Continue;
4353+ }
4354+
43184355angle::Result Renderer11::markRawBufferUsage (const gl::Context *context)
43194356{
43204357 const gl::State &glState = context->getState ();
0 commit comments