Commit 78a9c733 by Jamie Madill Committed by Commit Bot

D3D11: Implement multisampled stencil resolve.

This implements a fairly slow path with readback for stencil blits, and depth/stencil resolve. In a subsequent patch I'll implement the depth blits. BUG=angleproject:1246 Change-Id: I04151d1f49ca404d858172dff8286608eae29864 Reviewed-on: https://chromium-review.googlesource.com/359955Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent e58e1416
......@@ -62,7 +62,7 @@ void SafeRelease(T& resource)
}
template <typename T>
void SafeDelete(T*& resource)
void SafeDelete(T *&resource)
{
delete resource;
resource = NULL;
......
......@@ -17,35 +17,22 @@ namespace rx
{
struct D3DCompilerWorkarounds
{
D3DCompilerWorkarounds()
: skipOptimization(false), useMaxOptimization(false), enableIEEEStrictness(false)
{
}
bool skipOptimization;
bool useMaxOptimization;
bool skipOptimization = false;
bool useMaxOptimization = false;
// IEEE strictness needs to be enabled for NANs to work.
bool enableIEEEStrictness;
bool enableIEEEStrictness = false;
};
struct WorkaroundsD3D
{
WorkaroundsD3D()
: mrtPerfWorkaround(false),
setDataFasterThanImageUpload(false),
zeroMaxLodWorkaround(false),
useInstancedPointSpriteEmulation(false)
{
}
// On some systems, having extra rendertargets than necessary slows down the shader.
// We can fix this by optimizing those out of the shader. At the same time, we can
// work around a bug on some nVidia drivers that they ignore "null" render targets
// in D3D11, by compacting the active color attachments list to omit null entries.
bool mrtPerfWorkaround;
bool mrtPerfWorkaround = false;
bool setDataFasterThanImageUpload;
bool setDataFasterThanImageUpload = false;
// Some renderers can't disable mipmaps on a mipmapped texture (i.e. solely sample from level
// zero, and ignore the other levels). D3D11 Feature Level 10+ does this by setting MaxLOD to
......@@ -54,13 +41,19 @@ struct WorkaroundsD3D
// application creates a mipmapped texture2D, but sets GL_TEXTURE_MIN_FILTER to GL_NEAREST
// (i.e disables mipmaps). To work around this, D3D11 FL9_3 has to create two copies of the
// texture. The textures' level zeros are identical, but only one texture has mips.
bool zeroMaxLodWorkaround;
bool zeroMaxLodWorkaround = false;
// Some renderers do not support Geometry Shaders so the Geometry Shader-based PointSprite
// emulation will not work. To work around this, D3D11 FL9_3 has to use a different pointsprite
// emulation that is implemented using instanced quads.
bool useInstancedPointSpriteEmulation;
bool useInstancedPointSpriteEmulation = false;
// NVIDIA driver versions 347.88 <= x < 368.69 have a bug where using CopySubresourceRegion
// from a staging texture to a depth/stencil texture triggers a timeout/TDR. The workaround
// is to use UpdateSubresource to trigger an extra copy.
bool depthStencilBlitExtraCopy = false;
};
}
} // namespace rx
#endif // LIBANGLE_RENDERER_D3D_WORKAROUNDSD3D_H_
......@@ -12,8 +12,10 @@
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/RenderTarget11.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
#include "libANGLE/renderer/d3d/d3d11/texture_format_table.h"
#include "third_party/trace_event/trace_event.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough2d11vs.h"
......@@ -50,6 +52,10 @@
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughlum3d11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughlumalpha3d11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/resolvedepthstencil11_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/resolvedepthstencil11_vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/resolvestencil11_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/swizzlef2dps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/swizzlei2dps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/swizzleui2dps.h"
......@@ -179,6 +185,111 @@ void StretchedBlitNearest(const gl::Box &sourceArea,
}
}
using DepthStencilLoader = void(const float *, uint8_t *);
void LoadDepth16(const float *source, uint8_t *dest)
{
uint32_t convertedDepth = gl::floatToNormalized<16, uint32_t>(source[0]);
memcpy(dest, &convertedDepth, 2u);
}
void LoadDepth24(const float *source, uint8_t *dest)
{
uint32_t convertedDepth = gl::floatToNormalized<24, uint32_t>(source[0]);
memcpy(dest, &convertedDepth, 3u);
}
void LoadStencilHelper(const float *source, uint8_t *dest)
{
uint32_t convertedStencil = gl::getShiftedData<8, 0>(static_cast<uint32_t>(source[1]));
memcpy(dest, &convertedStencil, 1u);
}
void LoadStencil8(const float *source, uint8_t *dest)
{
// STENCIL_INDEX8 is implemented with D24S8, with the depth bits unused. Writes zero for safety.
float zero = 0.0f;
LoadDepth24(&zero, &dest[0]);
LoadStencilHelper(source, &dest[3]);
}
void LoadDepth24Stencil8(const float *source, uint8_t *dest)
{
LoadDepth24(source, &dest[0]);
LoadStencilHelper(source, &dest[3]);
}
void LoadDepth32F(const float *source, uint8_t *dest)
{
memcpy(dest, source, sizeof(float));
}
void LoadDepth32FStencil8(const float *source, uint8_t *dest)
{
LoadDepth32F(source, &dest[0]);
LoadStencilHelper(source, &dest[4]);
}
template <DepthStencilLoader loader>
void CopyDepthStencil(const gl::Box &sourceArea,
const gl::Box &destArea,
const gl::Rectangle &clippedDestArea,
const gl::Extents &sourceSize,
unsigned int sourceRowPitch,
unsigned int destRowPitch,
ptrdiff_t readOffset,
ptrdiff_t writeOffset,
size_t copySize,
size_t srcPixelStride,
size_t destPixelStride,
const uint8_t *sourceData,
uint8_t *destData)
{
// No stretching or subregions are supported, only full blits.
ASSERT(sourceArea == destArea);
ASSERT(sourceSize.width == sourceArea.width && sourceSize.height == sourceArea.height &&
sourceSize.depth == 1);
ASSERT(clippedDestArea.width == sourceSize.width &&
clippedDestArea.height == sourceSize.height);
ASSERT(readOffset == 0 && writeOffset == 0);
ASSERT(destArea.x == 0 && destArea.y == 0);
for (int row = 0; row < destArea.height; ++row)
{
for (int column = 0; column < destArea.width; ++column)
{
const float *sourcePixel = reinterpret_cast<const float *>(
sourceData + row * sourceRowPitch + column * srcPixelStride);
uint8_t *destPixel = destData + row * destRowPitch + column * destPixelStride;
loader(sourcePixel, destPixel);
}
}
}
Blit11::BlitConvertFunction *GetCopyDepthStencilFunction(GLenum internalFormat)
{
switch (internalFormat)
{
case GL_DEPTH_COMPONENT16:
return &CopyDepthStencil<LoadDepth16>;
case GL_DEPTH_COMPONENT24:
return &CopyDepthStencil<LoadDepth24>;
case GL_DEPTH_COMPONENT32F:
return &CopyDepthStencil<LoadDepth32F>;
case GL_STENCIL_INDEX8:
return &CopyDepthStencil<LoadStencil8>;
case GL_DEPTH24_STENCIL8:
return &CopyDepthStencil<LoadDepth24Stencil8>;
case GL_DEPTH32F_STENCIL8:
return &CopyDepthStencil<LoadDepth32FStencil8>;
default:
UNREACHABLE();
return nullptr;
}
}
inline void GenerateVertexCoords(const gl::Box &sourceArea,
const gl::Extents &sourceSize,
const gl::Box &destArea,
......@@ -265,7 +376,7 @@ void Write3DVertices(const gl::Box &sourceArea,
*outTopology = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
}
inline unsigned int GetSwizzleIndex(GLenum swizzle)
unsigned int GetSwizzleIndex(GLenum swizzle)
{
unsigned int colorIndex = 0;
......@@ -325,6 +436,21 @@ D3D11_INPUT_ELEMENT_DESC quad3DLayout[] = {
{"TEXCOORD", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0},
};
DXGI_FORMAT GetStencilSRVFormat(d3d11::ANGLEFormat angleFormat)
{
auto formatSet = d3d11::GetANGLEFormatSet(angleFormat);
switch (formatSet.texFormat)
{
case DXGI_FORMAT_R32G8X24_TYPELESS:
return DXGI_FORMAT_X32_TYPELESS_G8X24_UINT;
case DXGI_FORMAT_R24G8_TYPELESS:
return DXGI_FORMAT_X24_TYPELESS_G8_UINT;
default:
UNREACHABLE();
return DXGI_FORMAT_UNKNOWN;
}
}
} // namespace
Blit11::Blit11(Renderer11 *renderer)
......@@ -353,7 +479,18 @@ Blit11::Blit11(Renderer11 *renderer)
mQuad3DVS(g_VS_Passthrough3D, ArraySize(g_VS_Passthrough3D), "Blit11 3D vertex shader"),
mQuad3DGS(g_GS_Passthrough3D, ArraySize(g_GS_Passthrough3D), "Blit11 3D geometry shader"),
mAlphaMaskBlendState(GetAlphaMaskBlendStateDesc(), "Blit11 Alpha Mask Blend"),
mSwizzleCB(nullptr)
mSwizzleCB(nullptr),
mResolveDepthStencilVS(g_VS_ResolveDepthStencil,
ArraySize(g_VS_ResolveDepthStencil),
"Blit11::mResolveDepthStencilVS"),
mResolveDepthStencilPS(g_PS_ResolveDepthStencil,
ArraySize(g_PS_ResolveDepthStencil),
"Blit11::mResolveDepthStencilPS"),
mResolveStencilPS(g_PS_ResolveStencil,
ArraySize(g_PS_ResolveStencil),
"Blit11::mResolveStencilPS"),
mStencilSRV(nullptr),
mResolvedDepthStencilRTView(nullptr)
{
}
......@@ -370,6 +507,7 @@ Blit11::~Blit11()
mQuad3DGS.release();
clearShaderMap();
releaseResolveDepthStencilResources();
}
gl::Error Blit11::initResources()
......@@ -1197,22 +1335,26 @@ gl::Error Blit11::copyDepthStencilImpl(const TextureHelper11 &source,
const gl::Rectangle *scissor,
bool stencilOnly)
{
ASSERT(source.getANGLEFormat() == dest.getANGLEFormat());
auto format = source.getFormat();
const auto &sizeInfo = d3d11::GetDXGIFormatSizeInfo(format);
unsigned int pixelSize = sizeInfo.pixelBytes;
auto srcFormat = source.getFormat();
const auto &srcSizeInfo = d3d11::GetDXGIFormatSizeInfo(srcFormat);
unsigned int srcPixelSize = srcSizeInfo.pixelBytes;
unsigned int copyOffset = 0;
unsigned int copySize = pixelSize;
unsigned int copySize = srcPixelSize;
auto destFormat = dest.getFormat();
const auto &destSizeInfo = d3d11::GetDXGIFormatSizeInfo(destFormat);
unsigned int destPixelSize = destSizeInfo.pixelBytes;
ASSERT(srcFormat == destFormat);
if (stencilOnly)
{
const d3d11::DXGIFormat &dxgiFormatInfo = d3d11::GetDXGIFormatInfo(format);
const d3d11::DXGIFormat &srcDXGIFormat = d3d11::GetDXGIFormatInfo(srcFormat);
// Stencil channel should be right after the depth channel. Some views to depth/stencil
// resources have red channel for depth, in which case the depth channel bit width is in
// redBits.
ASSERT((dxgiFormatInfo.redBits != 0) != (dxgiFormatInfo.depthBits != 0));
GLuint depthBits = dxgiFormatInfo.redBits + dxgiFormatInfo.depthBits;
ASSERT((srcDXGIFormat.redBits != 0) != (srcDXGIFormat.depthBits != 0));
GLuint depthBits = srcDXGIFormat.redBits + srcDXGIFormat.depthBits;
// Known formats have either 24 or 32 bits of depth.
ASSERT(depthBits == 24 || depthBits == 32);
copyOffset = depthBits / 8;
......@@ -1222,25 +1364,24 @@ gl::Error Blit11::copyDepthStencilImpl(const TextureHelper11 &source,
}
return copyAndConvert(source, sourceSubresource, sourceArea, sourceSize, dest, destSubresource,
destArea, destSize, scissor, copyOffset, copyOffset, copySize, pixelSize,
pixelSize, StretchedBlitNearest);
destArea, destSize, scissor, copyOffset, copyOffset, copySize,
srcPixelSize, destPixelSize, StretchedBlitNearest);
}
gl::Error Blit11::copyAndConvert(const TextureHelper11 &source,
unsigned int sourceSubresource,
const gl::Box &sourceArea,
const gl::Extents &sourceSize,
const TextureHelper11 &dest,
unsigned int destSubresource,
const gl::Box &destArea,
const gl::Extents &destSize,
const gl::Rectangle *scissor,
size_t readOffset,
size_t writeOffset,
size_t copySize,
size_t srcPixelStride,
size_t destPixelStride,
BlitConvertFunction *convertFunction)
gl::Error Blit11::copyAndConvertImpl(const TextureHelper11 &source,
unsigned int sourceSubresource,
const gl::Box &sourceArea,
const gl::Extents &sourceSize,
const TextureHelper11 &destStaging,
const gl::Box &destArea,
const gl::Extents &destSize,
const gl::Rectangle *scissor,
size_t readOffset,
size_t writeOffset,
size_t copySize,
size_t srcPixelStride,
size_t destPixelStride,
BlitConvertFunction *convertFunction)
{
ANGLE_TRY(initResources());
......@@ -1255,17 +1396,6 @@ gl::Error Blit11::copyAndConvert(const TextureHelper11 &source,
deviceContext->CopySubresourceRegion(sourceStaging.getResource(), 0, 0, 0, 0,
source.getResource(), sourceSubresource, nullptr);
// HACK: Create the destination staging buffer as a read/write texture so
// ID3D11DevicContext::UpdateSubresource can be called
// using it's mapped data as a source
TextureHelper11 destStaging;
ANGLE_TRY_RESULT(CreateStagingTexture(GL_TEXTURE_2D, dest.getANGLEFormat(), destSize,
StagingAccess::READ_WRITE, device),
destStaging);
deviceContext->CopySubresourceRegion(destStaging.getResource(), 0, 0, 0, 0, dest.getResource(),
destSubresource, nullptr);
D3D11_MAPPED_SUBRESOURCE sourceMapping;
HRESULT result =
deviceContext->Map(sourceStaging.getResource(), 0, D3D11_MAP_READ, 0, &sourceMapping);
......@@ -1302,21 +1432,62 @@ gl::Error Blit11::copyAndConvert(const TextureHelper11 &source,
destPixelStride, static_cast<const uint8_t *>(sourceMapping.pData),
static_cast<uint8_t *>(destMapping.pData));
// HACK: Use ID3D11DevicContext::UpdateSubresource which causes an extra copy compared to
// ID3D11DevicContext::CopySubresourceRegion
// according to MSDN.
deviceContext->UpdateSubresource(dest.getResource(), destSubresource, nullptr,
destMapping.pData, destMapping.RowPitch,
destMapping.DepthPitch);
deviceContext->Unmap(sourceStaging.getResource(), 0);
deviceContext->Unmap(destStaging.getResource(), 0);
// TODO: Determine why this call to ID3D11DevicContext::CopySubresourceRegion causes a TDR
// timeout on some
// systems when called repeatedly.
// deviceContext->CopySubresourceRegion(dest, destSubresource, 0, 0, 0, destStaging, 0,
// nullptr);
return gl::NoError();
}
gl::Error Blit11::copyAndConvert(const TextureHelper11 &source,
unsigned int sourceSubresource,
const gl::Box &sourceArea,
const gl::Extents &sourceSize,
const TextureHelper11 &dest,
unsigned int destSubresource,
const gl::Box &destArea,
const gl::Extents &destSize,
const gl::Rectangle *scissor,
size_t readOffset,
size_t writeOffset,
size_t copySize,
size_t srcPixelStride,
size_t destPixelStride,
BlitConvertFunction *convertFunction)
{
ANGLE_TRY(initResources());
ID3D11Device *device = mRenderer->getDevice();
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
// HACK: Create the destination staging buffer as a read/write texture so
// ID3D11DevicContext::UpdateSubresource can be called
// using it's mapped data as a source
TextureHelper11 destStaging;
ANGLE_TRY_RESULT(CreateStagingTexture(GL_TEXTURE_2D, dest.getANGLEFormat(), destSize,
StagingAccess::READ_WRITE, device),
destStaging);
deviceContext->CopySubresourceRegion(destStaging.getResource(), 0, 0, 0, 0, dest.getResource(),
destSubresource, nullptr);
copyAndConvertImpl(source, sourceSubresource, sourceArea, sourceSize, destStaging, destArea,
destSize, scissor, readOffset, writeOffset, copySize, srcPixelStride,
destPixelStride, convertFunction);
// Work around timeouts/TDRs in older NVIDIA drivers.
if (mRenderer->getWorkarounds().depthStencilBlitExtraCopy)
{
D3D11_MAPPED_SUBRESOURCE mapped;
deviceContext->Map(destStaging.getResource(), 0, D3D11_MAP_READ, 0, &mapped);
deviceContext->UpdateSubresource(dest.getResource(), destSubresource, nullptr, mapped.pData,
mapped.RowPitch, mapped.DepthPitch);
deviceContext->Unmap(destStaging.getResource(), 0);
}
else
{
deviceContext->CopySubresourceRegion(dest.getResource(), destSubresource, 0, 0, 0,
destStaging.getResource(), 0, nullptr);
}
return gl::NoError();
}
......@@ -1656,13 +1827,149 @@ gl::Error Blit11::getSwizzleShader(GLenum type,
return gl::NoError();
}
gl::ErrorOrResult<TextureHelper11> Blit11::resolveDepthStencil(RenderTarget11 *dsRenderTarget,
bool resolveDepth,
bool resolveStencil)
gl::ErrorOrResult<TextureHelper11> Blit11::resolveDepth(RenderTarget11 *depth)
{
ASSERT(resolveDepth || resolveStencil);
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION,
"Multisample depth stencil resolve not implemented yet.");
// TODO(jmadill)
return gl::Error(GL_INVALID_OPERATION, "Multisample depth stencil not implemented yet");
}
gl::ErrorOrResult<TextureHelper11> Blit11::resolveStencil(RenderTarget11 *depthStencil,
bool alsoDepth)
{
ID3D11Device *device = mRenderer->getDevice();
ID3D11DeviceContext *context = mRenderer->getDeviceContext();
auto resolvedFormat = d3d11::ANGLE_FORMAT_R32G32_FLOAT;
auto formatSet = d3d11::GetANGLEFormatSet(resolvedFormat);
auto extents = depthStencil->getExtents();
// Check if we need to recreate depth stencil view
if (mResolvedDepthStencil.valid() && extents != mResolvedDepthStencil.getExtents())
{
releaseResolveDepthStencilResources();
}
if (!mResolvedDepthStencil.valid())
{
D3D11_TEXTURE2D_DESC textureDesc;
textureDesc.Width = extents.width;
textureDesc.Height = extents.height;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.Format = formatSet.texFormat;
textureDesc.SampleDesc.Count = 1;
textureDesc.SampleDesc.Quality = 0;
textureDesc.Usage = D3D11_USAGE_DEFAULT;
textureDesc.BindFlags = D3D11_BIND_RENDER_TARGET;
textureDesc.CPUAccessFlags = 0;
textureDesc.MiscFlags = 0;
ID3D11Texture2D *resolvedDepthStencil = nullptr;
HRESULT hr = device->CreateTexture2D(&textureDesc, nullptr, &resolvedDepthStencil);
if (FAILED(hr))
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to allocate resolved depth stencil texture");
}
d3d11::SetDebugName(resolvedDepthStencil, "Blit11::mResolvedDepthStencil");
ASSERT(mResolvedDepthStencilRTView == nullptr);
hr = device->CreateRenderTargetView(resolvedDepthStencil, nullptr,
&mResolvedDepthStencilRTView);
if (FAILED(hr))
{
return gl::Error(GL_OUT_OF_MEMORY,
"Failed to allocate Blit11::mResolvedDepthStencilRTView");
}
d3d11::SetDebugName(mResolvedDepthStencilRTView, "Blit11::mResolvedDepthStencilRTView");
mResolvedDepthStencil =
TextureHelper11::MakeAndPossess2D(resolvedDepthStencil, resolvedFormat);
}
ID3D11Resource *stencilResource = depthStencil->getTexture();
// Check if we need to re-create the stencil SRV.
if (mStencilSRV)
{
ID3D11Resource *priorResource = nullptr;
mStencilSRV->GetResource(&priorResource);
if (stencilResource != priorResource)
{
SafeRelease(mStencilSRV);
}
}
if (!mStencilSRV)
{
D3D11_SHADER_RESOURCE_VIEW_DESC srViewDesc;
srViewDesc.Format = GetStencilSRVFormat(depthStencil->getANGLEFormat());
srViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DMS;
HRESULT hr = device->CreateShaderResourceView(stencilResource, &srViewDesc, &mStencilSRV);
if (FAILED(hr))
{
return gl::Error(GL_OUT_OF_MEMORY, "Error creating Blit11 stencil SRV");
}
d3d11::SetDebugName(mStencilSRV, "Blit11::mStencilSRV");
}
// Notify the Renderer that all state should be invalidated.
mRenderer->markAllStateDirty();
// Apply the necessary state changes to the D3D11 immediate device context.
context->IASetInputLayout(nullptr);
context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
context->VSSetShader(mResolveDepthStencilVS.resolve(device), nullptr, 0);
context->GSSetShader(nullptr, nullptr, 0);
context->RSSetState(nullptr);
context->OMSetDepthStencilState(nullptr, 0xFFFFFFFF);
context->OMSetRenderTargets(1, &mResolvedDepthStencilRTView, nullptr);
context->OMSetBlendState(nullptr, nullptr, 0xFFFFFFF);
ID3D11ShaderResourceView *pixelViews[] = {
depthStencil->getShaderResourceView(), mStencilSRV,
};
context->PSSetShaderResources(0, 2, pixelViews);
// Resolving the depth buffer works by sampling the depth in the shader using a SRV, then
// writing to the resolved depth buffer using SV_Depth. We can't use this method for stencil
// because SV_StencilRef isn't supported until HLSL 5.1/D3D11.3.
if (alsoDepth)
{
context->PSSetShader(mResolveDepthStencilPS.resolve(device), nullptr, 0);
}
else
{
context->PSSetShader(mResolveStencilPS.resolve(device), nullptr, 0);
}
// Trigger the blit on the GPU.
context->Draw(6, 0);
gl::Box copyBox(0, 0, 0, extents.width, extents.height, 1);
TextureHelper11 dest;
ANGLE_TRY_RESULT(CreateStagingTexture(GL_TEXTURE_2D, depthStencil->getANGLEFormat(), extents,
StagingAccess::READ_WRITE, device),
dest);
auto copyFunction = GetCopyDepthStencilFunction(depthStencil->getInternalFormat());
auto dsFormatSet = d3d11::GetANGLEFormatSet(depthStencil->getANGLEFormat());
auto dsDxgiInfo = d3d11::GetDXGIFormatSizeInfo(dsFormatSet.texFormat);
ANGLE_TRY(copyAndConvertImpl(mResolvedDepthStencil, 0, copyBox, extents, dest, copyBox, extents,
nullptr, 0, 0, 0, 8u, dsDxgiInfo.pixelBytes, copyFunction));
// Return the resolved depth texture, which the caller must Release.
return dest;
}
void Blit11::releaseResolveDepthStencilResources()
{
SafeRelease(mStencilSRV);
SafeRelease(mResolvedDepthStencilRTView);
}
} // namespace rx
......@@ -70,9 +70,23 @@ class Blit11 : angle::NonCopyable
const gl::Extents &destSize,
const gl::Rectangle *scissor);
gl::ErrorOrResult<TextureHelper11> resolveDepthStencil(RenderTarget11 *dsRenderTarget,
bool resolveDepth,
bool resolveStencil);
gl::ErrorOrResult<TextureHelper11> resolveDepth(RenderTarget11 *depth);
gl::ErrorOrResult<TextureHelper11> resolveStencil(RenderTarget11 *depthStencil, bool alsoDepth);
using BlitConvertFunction = void(const gl::Box &sourceArea,
const gl::Box &destArea,
const gl::Rectangle &clipRect,
const gl::Extents &sourceSize,
unsigned int sourceRowPitch,
unsigned int destRowPitch,
ptrdiff_t readOffset,
ptrdiff_t writeOffset,
size_t copySize,
size_t srcPixelStride,
size_t destPixelStride,
const uint8_t *sourceData,
uint8_t *destData);
private:
enum BlitShaderType
......@@ -168,20 +182,6 @@ class Blit11 : angle::NonCopyable
ShaderDimension dimension);
static SwizzleShaderType GetSwizzleShaderType(GLenum type, D3D11_SRV_DIMENSION dimensionality);
typedef void BlitConvertFunction(const gl::Box &sourceArea,
const gl::Box &destArea,
const gl::Rectangle &clipRect,
const gl::Extents &sourceSize,
unsigned int sourceRowPitch,
unsigned int destRowPitch,
ptrdiff_t readOffset,
ptrdiff_t writeOffset,
size_t copySize,
size_t srcPixelStride,
size_t destPixelStride,
const uint8_t *sourceData,
uint8_t *destData);
gl::Error copyDepthStencilImpl(const TextureHelper11 &source,
unsigned int sourceSubresource,
const gl::Box &sourceArea,
......@@ -193,6 +193,21 @@ class Blit11 : angle::NonCopyable
const gl::Rectangle *scissor,
bool stencilOnly);
gl::Error copyAndConvertImpl(const TextureHelper11 &source,
unsigned int sourceSubresource,
const gl::Box &sourceArea,
const gl::Extents &sourceSize,
const TextureHelper11 &destStaging,
const gl::Box &destArea,
const gl::Extents &destSize,
const gl::Rectangle *scissor,
size_t readOffset,
size_t writeOffset,
size_t copySize,
size_t srcPixelStride,
size_t destPixelStride,
BlitConvertFunction *convertFunction);
gl::Error copyAndConvert(const TextureHelper11 &source,
unsigned int sourceSubresource,
const gl::Box &sourceArea,
......@@ -226,6 +241,7 @@ class Blit11 : angle::NonCopyable
ID3D11PixelShader *ps);
void clearShaderMap();
void releaseResolveDepthStencilResources();
Renderer11 *mRenderer;
......@@ -251,6 +267,13 @@ class Blit11 : angle::NonCopyable
d3d11::LazyBlendState mAlphaMaskBlendState;
ID3D11Buffer *mSwizzleCB;
d3d11::LazyShader<ID3D11VertexShader> mResolveDepthStencilVS;
d3d11::LazyShader<ID3D11PixelShader> mResolveDepthStencilPS;
d3d11::LazyShader<ID3D11PixelShader> mResolveStencilPS;
ID3D11ShaderResourceView *mStencilSRV;
TextureHelper11 mResolvedDepthStencil;
ID3D11RenderTargetView *mResolvedDepthStencilRTView;
};
} // namespace rx
......
......@@ -3084,14 +3084,7 @@ gl::Error Renderer11::createRenderTarget(int width, int height, GLenum format, G
bool bindRTV = false, bindDSV = false, bindSRV = false;
bindRTV = (formatInfo.formatSet->rtvFormat != DXGI_FORMAT_UNKNOWN);
bindDSV = (formatInfo.formatSet->dsvFormat != DXGI_FORMAT_UNKNOWN);
if (formatInfo.formatSet->srvFormat != DXGI_FORMAT_UNKNOWN)
{
// Multisample targets flagged for binding as depth stencil cannot also be
// flagged for binding as SRV, so make certain not to add the SRV flag for
// these targets.
bindSRV = !(formatInfo.formatSet->dsvFormat != DXGI_FORMAT_UNKNOWN &&
desc.SampleDesc.Count > 1);
}
bindSRV = (formatInfo.formatSet->srvFormat != DXGI_FORMAT_UNKNOWN);
desc.BindFlags = (bindRTV ? D3D11_BIND_RENDER_TARGET : 0) |
(bindDSV ? D3D11_BIND_DEPTH_STENCIL : 0) |
......@@ -3785,20 +3778,24 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRectIn,
auto readRT11 = GetAs<RenderTarget11>(readRenderTarget);
ANGLE_TRY_RESULT(resolveMultisampledTexture(readRT11, depthBlit, stencilBlit), readTexture);
const auto &formatSet = d3d11::GetANGLEFormatSet(readTexture.getANGLEFormat());
if (!stencilBlit)
{
const auto &readFormatSet = d3d11::GetANGLEFormatSet(readTexture.getANGLEFormat());
D3D11_SHADER_RESOURCE_VIEW_DESC srViewDesc;
srViewDesc.Format = formatSet.srvFormat;
srViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
srViewDesc.Texture2D.MipLevels = 1;
srViewDesc.Texture2D.MostDetailedMip = 0;
D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
viewDesc.Format = readFormatSet.srvFormat;
viewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
viewDesc.Texture2D.MipLevels = 1;
viewDesc.Texture2D.MostDetailedMip = 0;
HRESULT hresult =
mDevice->CreateShaderResourceView(readTexture.getResource(), &srViewDesc, &readSRV);
if (FAILED(hresult))
{
return gl::Error(GL_OUT_OF_MEMORY,
"Renderer11::blitRenderbufferRect: Failed to create temporary SRV.");
HRESULT hresult =
mDevice->CreateShaderResourceView(readTexture.getResource(), &viewDesc, &readSRV);
if (FAILED(hresult))
{
return gl::Error(
GL_OUT_OF_MEMORY,
"Renderer11::blitRenderbufferRect: Failed to create temporary SRV.");
}
}
}
else
......@@ -3817,10 +3814,8 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRectIn,
readSRV->AddRef();
}
if (!readSRV)
{
return gl::Error(GL_OUT_OF_MEMORY, "Failed to retrieve the internal read render target view from the read render target.");
}
// Stencil blits don't use shaders.
ASSERT(readSRV || stencilBlit);
const gl::Extents readSize(readRenderTarget->getWidth(), readRenderTarget->getHeight(), 1);
const gl::Extents drawSize(drawRenderTarget->getWidth(), drawRenderTarget->getHeight(), 1);
......@@ -3988,6 +3983,7 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRectIn,
}
else if (depthBlit)
{
ASSERT(readSRV);
ANGLE_TRY(mBlit->copyDepth(readSRV, readArea, readSize, drawDSV, drawArea, drawSize,
scissor));
}
......@@ -4001,6 +3997,7 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRectIn,
{
// We don't currently support masking off any other channel than alpha
bool maskOffAlpha = colorMaskingNeeded && colorMask.alpha;
ASSERT(readSRV);
ANGLE_TRY(mBlit->copyTexture(readSRV, readArea, readSize, drawRTV, drawArea, drawSize,
scissor, destFormatInfo.format, filter, maskOffAlpha));
}
......@@ -4059,9 +4056,14 @@ void Renderer11::onBufferDelete(const Buffer11 *deleted)
gl::ErrorOrResult<TextureHelper11>
Renderer11::resolveMultisampledTexture(RenderTarget11 *renderTarget, bool depth, bool stencil)
{
if (depth || stencil)
if (depth && !stencil)
{
return mBlit->resolveDepth(renderTarget);
}
if (stencil)
{
return mBlit->resolveDepthStencil(renderTarget, depth, stencil);
return mBlit->resolveStencil(renderTarget, depth);
}
const auto &formatSet = d3d11::GetANGLEFormatSet(renderTarget->getANGLEFormat());
......@@ -4169,7 +4171,7 @@ void Renderer11::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap *outTextureC
WorkaroundsD3D Renderer11::generateWorkarounds() const
{
return d3d11::GenerateWorkarounds(mRenderer11DeviceCaps.featureLevel);
return d3d11::GenerateWorkarounds(mRenderer11DeviceCaps, mAdapterDescription);
}
gl::Error Renderer11::clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd)
......
......@@ -1506,13 +1506,20 @@ ID3D11BlendState *LazyBlendState::resolve(ID3D11Device *device)
return mResource;
}
WorkaroundsD3D GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel)
WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps,
const DXGI_ADAPTER_DESC &adapterDesc)
{
bool is9_3 = (deviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3);
WorkaroundsD3D workarounds;
workarounds.mrtPerfWorkaround = true;
workarounds.setDataFasterThanImageUpload = true;
workarounds.zeroMaxLodWorkaround = (featureLevel <= D3D_FEATURE_LEVEL_9_3);
workarounds.useInstancedPointSpriteEmulation = (featureLevel <= D3D_FEATURE_LEVEL_9_3);
workarounds.zeroMaxLodWorkaround = is9_3;
workarounds.useInstancedPointSpriteEmulation = is9_3;
// TODO(jmadill): Narrow problematic driver range.
workarounds.depthStencilBlitExtraCopy = (adapterDesc.VendorId == VENDOR_ID_NVIDIA);
return workarounds;
}
......@@ -1654,6 +1661,11 @@ void TextureHelper11::reset()
mTexture3D = nullptr;
}
bool TextureHelper11::valid() const
{
return (mTextureType != GL_NONE);
}
gl::ErrorOrResult<TextureHelper11> CreateStagingTexture(GLenum textureType,
d3d11::ANGLEFormat angleFormat,
const gl::Extents &size,
......
......@@ -346,7 +346,8 @@ void SetBufferData(ID3D11DeviceContext *context, ID3D11Buffer *constantBuffer, c
}
}
WorkaroundsD3D GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel);
WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps,
const DXGI_ADAPTER_DESC &adapterDesc);
enum ReservedConstantBufferSlot
{
......@@ -383,6 +384,7 @@ class TextureHelper11 : angle::NonCopyable
ID3D11Texture2D *getTexture2D() const { return mTexture2D; }
ID3D11Texture3D *getTexture3D() const { return mTexture3D; }
ID3D11Resource *getResource() const;
bool valid() const;
private:
void reset();
......
static const float2 g_Corners[6] =
{
float2(-1.0f, 1.0f),
float2( 1.0f, -1.0f),
float2(-1.0f, -1.0f),
float2(-1.0f, 1.0f),
float2( 1.0f, 1.0f),
float2( 1.0f, -1.0f),
};
void VS_ResolveDepthStencil(in uint id : SV_VertexID,
out float4 position : SV_Position,
out float2 texCoord : TEXCOORD0)
{
float2 corner = g_Corners[id];
position = float4(corner.x, corner.y, 0.0f, 1.0f);
texCoord = float2((corner.x + 1.0f) * 0.5f, (-corner.y + 1.0f) * 0.5f);
}
Texture2DMS<float> Depth : register(t0);
Texture2DMS<uint2> Stencil : register(t1);
void PS_ResolveDepthStencil(in float4 position : SV_Position,
in float2 texCoord : TEXCOORD0,
out float2 depthStencil : SV_Target0)
{
// MS samplers must use Load
uint width, height, samples;
Depth.GetDimensions(width, height, samples);
uint2 coord = uint2(texCoord.x * float(width), texCoord.y * float(height));
depthStencil.r = Depth.Load(coord, 0).r;
depthStencil.g = float(Stencil.Load(coord, 0).g);
}
void PS_ResolveStencil(in float4 position : SV_Position,
in float2 texCoord : TEXCOORD0,
out float2 stencil : SV_Target0)
{
// MS samplers must use Load
uint width, height, samples;
Stencil.GetDimensions(width, height, samples);
uint2 coord = uint2(texCoord.x * float(width), texCoord.y * float(height));
stencil.r = 0.0f;
stencil.g = float(Stencil.Load(coord, 0).g);
}
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Depth texture float 2dMS 0 1
// Stencil texture uint2 2dMS 1 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xy 0 TARGET float xy
//
ps_4_1
dcl_globalFlags refactoringAllowed
dcl_resource_texture2dms(0) (float,float,float,float) t0
dcl_resource_texture2dms(0) (uint,uint,uint,uint) t1
dcl_input_ps linear v1.xy
dcl_output o0.xy
dcl_temps 1
resinfo_uint r0.xy, l(0), t0.xyzw
utof r0.xy, r0.xyxx
mul r0.xy, r0.xyxx, v1.xyxx
ftou r0.xy, r0.xyxx
mov r0.zw, l(0,0,0,0)
ldms r0.z, r0.xyzw, t1.xzyw, l(0)
ldms r0.x, r0.xyww, t0.xyzw, l(0)
mov o0.x, r0.x
utof o0.y, r0.z
ret
// Approximately 10 instruction slots used
#endif
const BYTE g_PS_ResolveDepthStencil[] = {
68, 88, 66, 67, 229, 191, 254, 12, 10, 19, 181, 162, 222, 203, 244, 146, 104, 226, 195,
177, 1, 0, 0, 0, 40, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 216, 0,
0, 0, 48, 1, 0, 0, 100, 1, 0, 0, 172, 2, 0, 0, 82, 68, 69, 70, 156,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0,
1, 4, 255, 255, 0, 1, 0, 0, 106, 0, 0, 0, 92, 0, 0, 0, 2, 0, 0,
0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 98, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 6,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0,
68, 101, 112, 116, 104, 0, 83, 116, 101, 110, 99, 105, 108, 0, 77, 105, 99, 114, 111,
115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48,
46, 49, 54, 51, 56, 52, 0, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0,
8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95, 80, 111,
115, 105, 116, 105, 111, 110, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171,
79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 3, 12,
0, 0, 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171, 83, 72, 68, 82, 64,
1, 0, 0, 65, 0, 0, 0, 80, 0, 0, 0, 106, 8, 0, 1, 88, 32, 0, 4,
0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 88, 32, 0, 4, 0, 112, 16,
0, 1, 0, 0, 0, 68, 68, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3, 50, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 1,
0, 0, 0, 61, 16, 0, 7, 50, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0,
0, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 86, 0, 0, 5, 50, 0, 16,
0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 50, 0,
16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1,
0, 0, 0, 28, 0, 0, 5, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0,
0, 0, 0, 0, 54, 0, 0, 8, 194, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, 0,
0, 9, 66, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 134,
125, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 46, 0, 0, 9,
18, 0, 16, 0, 0, 0, 0, 0, 70, 15, 16, 0, 0, 0, 0, 0, 70, 126, 16,
0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 18, 32,
16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 86, 0, 0, 5, 34,
32, 16, 0, 0, 0, 0, 0, 42, 0, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0, 0, 0, 10, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_VertexID 0 x 0 VERTID uint x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xy 1 NONE float xy
//
vs_4_1
dcl_globalFlags refactoringAllowed
dcl_immediateConstantBuffer { { -1.000000, 1.000000, 0, 0},
{ 1.000000, -1.000000, 0, 0},
{ -1.000000, -1.000000, 0, 0},
{ -1.000000, 1.000000, 0, 0},
{ 1.000000, 1.000000, 0, 0},
{ 1.000000, -1.000000, 0, 0} }
dcl_input_sgv v0.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_temps 1
mov o0.zw, l(0,0,0,1.000000)
mov r0.x, v0.x
mov o0.xy, icb[r0.x + 0].xyxx
add r0.y, l(1.000000), icb[r0.x + 0].x
add r0.x, l(1.000000), -icb[r0.x + 0].y
mul o1.xy, r0.yxyy, l(0.500000, 0.500000, 0.000000, 0.000000)
ret
// Approximately 7 instruction slots used
#endif
const BYTE g_VS_ResolveDepthStencil[] = {
68, 88, 66, 67, 205, 15, 103, 70, 202, 235, 195, 98, 255, 82, 84, 239, 130, 6, 12,
104, 1, 0, 0, 0, 0, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 140, 0,
0, 0, 192, 0, 0, 0, 24, 1, 0, 0, 132, 2, 0, 0, 82, 68, 69, 70, 80,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0,
1, 4, 254, 255, 0, 1, 0, 0, 28, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111,
102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32,
67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49,
54, 51, 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0,
8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 1, 1, 0, 0, 83, 86, 95, 86, 101, 114, 116, 101, 120, 73,
68, 0, 79, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
0, 1, 0, 0, 0, 3, 12, 0, 0, 83, 86, 95, 80, 111, 115, 105, 116, 105, 111,
110, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 83, 72, 68, 82, 100,
1, 0, 0, 65, 0, 1, 0, 89, 0, 0, 0, 106, 8, 0, 1, 53, 24, 0, 0,
26, 0, 0, 0, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
128, 191, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0,
0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 0,
0, 0, 0, 0, 0, 96, 0, 0, 4, 18, 16, 16, 0, 0, 0, 0, 0, 6, 0,
0, 0, 103, 0, 0, 4, 242, 32, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 101,
0, 0, 3, 50, 32, 16, 0, 1, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0,
54, 0, 0, 8, 194, 32, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 54, 0, 0, 5, 18, 0,
16, 0, 0, 0, 0, 0, 10, 16, 16, 0, 0, 0, 0, 0, 54, 0, 0, 6, 50,
32, 16, 0, 0, 0, 0, 0, 70, 144, 144, 0, 10, 0, 16, 0, 0, 0, 0, 0,
0, 0, 0, 8, 34, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128,
63, 10, 144, 144, 0, 10, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 9, 18, 0,
16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 26, 144, 144, 128, 65,
0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 50, 32, 16, 0,
1, 0, 0, 0, 22, 5, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0,
63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 1, 83, 84,
65, 84, 116, 0, 0, 0, 7, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0, 0, 3,
0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Stencil texture uint2 2dMS 1 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xy 0 TARGET float xy
//
ps_4_1
dcl_globalFlags refactoringAllowed
dcl_resource_texture2dms(0) (uint,uint,uint,uint) t1
dcl_input_ps linear v1.xy
dcl_output o0.xy
dcl_temps 1
resinfo_uint r0.xy, l(0), t1.xyzw
utof r0.xy, r0.xyxx
mul r0.xy, r0.xyxx, v1.xyxx
ftou r0.xy, r0.xyxx
mov r0.zw, l(0,0,0,0)
ldms r0.x, r0.xyzw, t1.yxzw, l(0)
utof o0.y, r0.x
mov o0.x, l(0)
ret
// Approximately 9 instruction slots used
#endif
const BYTE g_PS_ResolveStencil[] = {
68, 88, 66, 67, 122, 29, 34, 146, 254, 203, 175, 97, 151, 254, 255, 190, 91, 40, 55,
118, 1, 0, 0, 0, 208, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 180, 0,
0, 0, 12, 1, 0, 0, 64, 1, 0, 0, 84, 2, 0, 0, 82, 68, 69, 70, 120,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
1, 4, 255, 255, 0, 1, 0, 0, 68, 0, 0, 0, 60, 0, 0, 0, 2, 0, 0,
0, 4, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 5, 0, 0, 0, 83, 116, 101, 110, 99, 105, 108, 0, 77, 105, 99, 114, 111,
115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48,
46, 49, 54, 51, 56, 52, 0, 171, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3,
0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95,
80, 111, 115, 105, 116, 105, 111, 110, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171,
171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
3, 12, 0, 0, 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171, 83, 72, 68,
82, 12, 1, 0, 0, 65, 0, 0, 0, 67, 0, 0, 0, 106, 8, 0, 1, 88, 32,
0, 4, 0, 112, 16, 0, 1, 0, 0, 0, 68, 68, 0, 0, 98, 16, 0, 3, 50,
16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 50, 32, 16, 0, 0, 0, 0, 0,
104, 0, 0, 2, 1, 0, 0, 0, 61, 16, 0, 7, 50, 0, 16, 0, 0, 0, 0,
0, 1, 64, 0, 0, 0, 0, 0, 0, 70, 126, 16, 0, 1, 0, 0, 0, 86, 0,
0, 5, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 56,
0, 0, 7, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0,
70, 16, 16, 0, 1, 0, 0, 0, 28, 0, 0, 5, 50, 0, 16, 0, 0, 0, 0,
0, 70, 0, 16, 0, 0, 0, 0, 0, 54, 0, 0, 8, 194, 0, 16, 0, 0, 0,
0, 0, 2, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 46, 0, 0, 9, 18, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0,
0, 0, 0, 0, 22, 126, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0,
0, 86, 0, 0, 5, 34, 32, 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0,
0, 0, 54, 0, 0, 5, 18, 32, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0,
0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 9, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
......@@ -20,7 +20,7 @@ if "%1" == "release" (
)
:: Shaders for OpenGL ES 2.0 and OpenGL ES 3.0+
:: | Input file | Entry point | Type | Output file | Debug |
:: | Input file | Entry point | Type | Output file | Debug |
call:BuildShader Passthrough2D11.hlsl VS_Passthrough2D vs_4_0_level_9_3 compiled\passthrough2d11vs.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBA2D ps_4_0_level_9_3 compiled\passthroughrgba2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGB2D ps_4_0_level_9_3 compiled\passthroughrgb2d11ps.h %debug%
......@@ -35,58 +35,61 @@ call:BuildShader Clear11.hlsl PS_ClearFloat ps_4_0
:: Shaders for OpenGL ES 3.0+ only
:: | Input file | Entry point | Type | Output file | Debug |
call:BuildShader Passthrough2D11.hlsl PS_PassthroughDepth2D ps_4_0 compiled\passthroughdepth2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBA2DUI ps_4_0 compiled\passthroughrgba2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBA2DI ps_4_0 compiled\passthroughrgba2di11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGB2DUI ps_4_0 compiled\passthroughrgb2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGB2DI ps_4_0 compiled\passthroughrgb2di11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRG2DUI ps_4_0 compiled\passthroughrg2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRG2DI ps_4_0 compiled\passthroughrg2di11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughR2DUI ps_4_0 compiled\passthroughr2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughR2DI ps_4_0 compiled\passthroughr2di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl VS_Passthrough3D vs_4_0 compiled\passthrough3d11vs.h %debug%
call:BuildShader Passthrough3D11.hlsl GS_Passthrough3D gs_4_0 compiled\passthrough3d11gs.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGBA3D ps_4_0 compiled\passthroughrgba3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGBA3DUI ps_4_0 compiled\passthroughrgba3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGBA3DI ps_4_0 compiled\passthroughrgba3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGB3D ps_4_0 compiled\passthroughrgb3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGB3DUI ps_4_0 compiled\passthroughrgb3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGB3DI ps_4_0 compiled\passthroughrgb3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRG3D ps_4_0 compiled\passthroughrg3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRG3DUI ps_4_0 compiled\passthroughrg3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRG3DI ps_4_0 compiled\passthroughrg3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughR3D ps_4_0 compiled\passthroughr3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughR3DUI ps_4_0 compiled\passthroughr3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughR3DI ps_4_0 compiled\passthroughr3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughLum3D ps_4_0 compiled\passthroughlum3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughLumAlpha3D ps_4_0 compiled\passthroughlumalpha3d11ps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleF2D ps_4_0 compiled\swizzlef2dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleI2D ps_4_0 compiled\swizzlei2dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI2D ps_4_0 compiled\swizzleui2dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleF3D ps_4_0 compiled\swizzlef3dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleI3D ps_4_0 compiled\swizzlei3dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI3D ps_4_0 compiled\swizzleui3dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleF2DArray ps_4_0 compiled\swizzlef2darrayps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleI2DArray ps_4_0 compiled\swizzlei2darrayps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI2DArray ps_4_0 compiled\swizzleui2darrayps.h %debug%
call:BuildShader Clear11.hlsl VS_ClearUint vs_4_0 compiled\clearuint11vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearUint ps_4_0 compiled\clearuint11ps.h %debug%
call:BuildShader Clear11.hlsl VS_ClearSint vs_4_0 compiled\clearsint11vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearSint ps_4_0 compiled\clearsint11ps.h %debug%
call:BuildShader BufferToTexture11.hlsl VS_BufferToTexture vs_4_0 compiled/buffertotexture11_vs.h %debug%
call:BuildShader BufferToTexture11.hlsl GS_BufferToTexture gs_4_0 compiled/buffertotexture11_gs.h %debug%
call:BuildShader BufferToTexture11.hlsl PS_BufferToTexture_4F ps_4_0 compiled/buffertotexture11_ps_4f.h %debug%
call:BuildShader BufferToTexture11.hlsl PS_BufferToTexture_4I ps_4_0 compiled/buffertotexture11_ps_4i.h %debug%
call:BuildShader BufferToTexture11.hlsl PS_BufferToTexture_4UI ps_4_0 compiled/buffertotexture11_ps_4ui.h %debug%
:: | Input file | Entry point | Type | Output file | Debug |
call:BuildShader Passthrough2D11.hlsl PS_PassthroughDepth2D ps_4_0 compiled\passthroughdepth2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBA2DUI ps_4_0 compiled\passthroughrgba2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBA2DI ps_4_0 compiled\passthroughrgba2di11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGB2DUI ps_4_0 compiled\passthroughrgb2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGB2DI ps_4_0 compiled\passthroughrgb2di11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRG2DUI ps_4_0 compiled\passthroughrg2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRG2DI ps_4_0 compiled\passthroughrg2di11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughR2DUI ps_4_0 compiled\passthroughr2dui11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughR2DI ps_4_0 compiled\passthroughr2di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl VS_Passthrough3D vs_4_0 compiled\passthrough3d11vs.h %debug%
call:BuildShader Passthrough3D11.hlsl GS_Passthrough3D gs_4_0 compiled\passthrough3d11gs.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGBA3D ps_4_0 compiled\passthroughrgba3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGBA3DUI ps_4_0 compiled\passthroughrgba3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGBA3DI ps_4_0 compiled\passthroughrgba3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGB3D ps_4_0 compiled\passthroughrgb3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGB3DUI ps_4_0 compiled\passthroughrgb3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRGB3DI ps_4_0 compiled\passthroughrgb3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRG3D ps_4_0 compiled\passthroughrg3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRG3DUI ps_4_0 compiled\passthroughrg3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughRG3DI ps_4_0 compiled\passthroughrg3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughR3D ps_4_0 compiled\passthroughr3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughR3DUI ps_4_0 compiled\passthroughr3dui11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughR3DI ps_4_0 compiled\passthroughr3di11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughLum3D ps_4_0 compiled\passthroughlum3d11ps.h %debug%
call:BuildShader Passthrough3D11.hlsl PS_PassthroughLumAlpha3D ps_4_0 compiled\passthroughlumalpha3d11ps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleF2D ps_4_0 compiled\swizzlef2dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleI2D ps_4_0 compiled\swizzlei2dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI2D ps_4_0 compiled\swizzleui2dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleF3D ps_4_0 compiled\swizzlef3dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleI3D ps_4_0 compiled\swizzlei3dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI3D ps_4_0 compiled\swizzleui3dps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleF2DArray ps_4_0 compiled\swizzlef2darrayps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleI2DArray ps_4_0 compiled\swizzlei2darrayps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI2DArray ps_4_0 compiled\swizzleui2darrayps.h %debug%
call:BuildShader Clear11.hlsl VS_ClearUint vs_4_0 compiled\clearuint11vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearUint ps_4_0 compiled\clearuint11ps.h %debug%
call:BuildShader Clear11.hlsl VS_ClearSint vs_4_0 compiled\clearsint11vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearSint ps_4_0 compiled\clearsint11ps.h %debug%
call:BuildShader BufferToTexture11.hlsl VS_BufferToTexture vs_4_0 compiled/buffertotexture11_vs.h %debug%
call:BuildShader BufferToTexture11.hlsl GS_BufferToTexture gs_4_0 compiled/buffertotexture11_gs.h %debug%
call:BuildShader BufferToTexture11.hlsl PS_BufferToTexture_4F ps_4_0 compiled/buffertotexture11_ps_4f.h %debug%
call:BuildShader BufferToTexture11.hlsl PS_BufferToTexture_4I ps_4_0 compiled/buffertotexture11_ps_4i.h %debug%
call:BuildShader BufferToTexture11.hlsl PS_BufferToTexture_4UI ps_4_0 compiled/buffertotexture11_ps_4ui.h %debug%
call:BuildShader ResolveDepthStencil.hlsl VS_ResolveDepthStencil vs_4_1 compiled/resolvedepthstencil11_vs.h %debug%
call:BuildShader ResolveDepthStencil.hlsl PS_ResolveDepthStencil ps_4_1 compiled/resolvedepthstencil11_ps.h %debug%
call:BuildShader ResolveDepthStencil.hlsl PS_ResolveStencil ps_4_1 compiled/resolvestencil11_ps.h %debug%
echo.
......
......@@ -200,21 +200,12 @@
1097 WIN : dEQP-GLES3.functional.fbo.msaa.2_samples.depth_component32f = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.2_samples.depth_component24 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.2_samples.depth_component16 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.2_samples.depth32f_stencil8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.2_samples.depth24_stencil8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.2_samples.stencil_index8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component32f = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component24 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.4_samples.depth_component16 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.4_samples.depth32f_stencil8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.4_samples.depth24_stencil8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.4_samples.stencil_index8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.8_samples.depth_component32f = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.8_samples.depth_component24 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.8_samples.depth_component16 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.8_samples.depth32f_stencil8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.8_samples.depth24_stencil8 = FAIL
1097 WIN : dEQP-GLES3.functional.fbo.msaa.8_samples.stencil_index8 = FAIL
1098 WIN : dEQP-GLES3.functional.uniform_api.random.8 = FAIL
1098 WIN : dEQP-GLES3.functional.uniform_api.random.81 = FAIL
1101 WIN : dEQP-GLES3.functional.polygon_offset.fixed16_render_with_units = FAIL
......
......@@ -6,6 +6,8 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
using namespace angle;
class BlitFramebufferANGLETest : public ANGLETest
......@@ -891,8 +893,96 @@ TEST_P(BlitFramebufferANGLETest, Errors)
// TODO(geofflang): Fix the dependence on glBlitFramebufferANGLE without checks and assuming the
// default framebuffer is BGRA to enable the GL and GLES backends. (http://anglebug.com/1289)
class BlitFramebufferTest : public ANGLETest
{
protected:
BlitFramebufferTest()
{
setWindowWidth(256);
setWindowHeight(256);
setConfigRedBits(8);
setConfigGreenBits(8);
setConfigBlueBits(8);
setConfigAlphaBits(8);
setConfigDepthBits(24);
setConfigStencilBits(8);
}
};
// Test resolving a multisampled stencil buffer.
TEST_P(BlitFramebufferTest, MultisampleStencil)
{
GLRenderbuffer renderbuf;
glBindRenderbuffer(GL_RENDERBUFFER, renderbuf.get());
glRenderbufferStorageMultisample(GL_RENDERBUFFER, 2, GL_STENCIL_INDEX8, 256, 256);
const std::string &vertex =
"#version 300 es\n"
"in vec2 position;\n"
"void main() {\n"
" gl_Position = vec4(position, 0.0, 1.0);\n"
"}";
const std::string &fragment =
"#version 300 es\n"
"out mediump vec4 red;\n"
"void main() {\n"
" red = vec4(1.0, 0.0, 0.0, 1.0);\n"
"}";
ANGLE_GL_PROGRAM(drawRed, vertex, fragment);
GLFramebuffer framebuffer;
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.get());
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
renderbuf.get());
ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
// fill the stencil buffer with 0x1
glStencilFunc(GL_ALWAYS, 0x1, 0xFF);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
glEnable(GL_STENCIL_TEST);
drawQuad(drawRed.get(), "position", 0.5f);
GLTexture destColorbuf;
glBindTexture(GL_TEXTURE_2D, destColorbuf.get());
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 256, 256);
GLRenderbuffer destRenderbuf;
glBindRenderbuffer(GL_RENDERBUFFER, destRenderbuf.get());
glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, 256, 256);
GLFramebuffer resolved;
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, resolved.get());
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
destColorbuf.get(), 0);
glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER,
destRenderbuf.get());
glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffer.get());
glBlitFramebuffer(0, 0, 256, 256, 0, 0, 256, 256, GL_STENCIL_BUFFER_BIT, GL_NEAREST);
glBindFramebuffer(GL_FRAMEBUFFER, resolved.get());
ASSERT_GL_NO_ERROR();
// Clear to green
glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
// Draw red if the stencil is 0x1, which should be true after the blit/resolve.
glStencilFunc(GL_EQUAL, 0x1, 0xFF);
drawQuad(drawRed.get(), "position", 0.5f);
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
ASSERT_GL_NO_ERROR();
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
ANGLE_INSTANTIATE_TEST(BlitFramebufferANGLETest,
ES2_D3D9(),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE),
ES2_D3D11(EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE));
ANGLE_INSTANTIATE_TEST(BlitFramebufferTest, ES3_D3D11());
\ No newline at end of file
......@@ -6,6 +6,9 @@
// gl_raii:
// Helper methods for containing GL objects like buffers and textures.
#ifndef ANGLE_TESTS_GL_RAII_H_
#define ANGLE_TESTS_GL_RAII_H_
#include <functional>
#include "angle_gl.h"
......@@ -44,4 +47,35 @@ using GLTexture = GLWrapper<glGenTextures, glDeleteTextures>;
using GLFramebuffer = GLWrapper<glGenFramebuffers, glDeleteFramebuffers>;
using GLRenderbuffer = GLWrapper<glGenRenderbuffers, glDeleteRenderbuffers>;
class GLProgram
{
public:
GLProgram(const std::string &vertexShader, const std::string &fragmentShader)
: mHandle(0), mVertexShader(vertexShader), mFragmentShader(fragmentShader)
{
}
~GLProgram() { glDeleteProgram(mHandle); }
GLuint get()
{
if (mHandle == 0)
{
mHandle = CompileProgram(mVertexShader, mFragmentShader);
}
return mHandle;
}
private:
GLuint mHandle;
const std::string mVertexShader;
const std::string mFragmentShader;
};
#define ANGLE_GL_PROGRAM(name, vertex, fragment) \
GLProgram name(vertex, fragment); \
ASSERT_NE(0u, name.get());
} // namespace angle
#endif // ANGLE_TESTS_GL_RAII_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment