Commit 5416f753 by Shahmeer Esmail Committed by Commit Bot

Clear11 Shader Optimizations and Shader Management Rework

- ClearShader made into a class that manages all required shaders and input layouts for clears - ClearShader reuses VS for all clear types. This reduces shader compilation time and memory usage significantly - Use constantBuffer for color/z values instead of VB to decouple VB & VS from clearType and allowing for the same VS to be used for multiple clear types - FL10+ Devices: Generate positions using SV_VertexID in VS to avoid having to bind VB. - FL93 Devices: Use an immutable VB containing only position data (SV_VertexID not supported) - Implement CB cache. Incoming color/Z values checked against cache and CB/cache only updated if there is a mismatch. Significantly reduces the frequency of expensive CB map/rename operations especially in common scenarios where most/all clears use the same color/z values BUG=angleproject:1935 Change-Id: I2015fbdcc135ba08b65dbecbe9c62499c2801037 Reviewed-on: https://chromium-review.googlesource.com/453882 Commit-Queue: Shahmeer Esmail <shahmeer.esmail@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ae39958a
......@@ -38,19 +38,19 @@ ClearParameters GetClearParameters(const gl::State &state, GLbitfield mask)
{
clearParams.clearColor[i] = false;
}
clearParams.colorFClearValue = state.getColorClearValue();
clearParams.colorClearType = GL_FLOAT;
clearParams.colorMaskRed = blendState.colorMaskRed;
clearParams.colorMaskGreen = blendState.colorMaskGreen;
clearParams.colorMaskBlue = blendState.colorMaskBlue;
clearParams.colorMaskAlpha = blendState.colorMaskAlpha;
clearParams.clearDepth = false;
clearParams.depthClearValue = state.getDepthClearValue();
clearParams.clearStencil = false;
clearParams.stencilClearValue = state.getStencilClearValue();
clearParams.colorF = state.getColorClearValue();
clearParams.colorType = GL_FLOAT;
clearParams.colorMaskRed = blendState.colorMaskRed;
clearParams.colorMaskGreen = blendState.colorMaskGreen;
clearParams.colorMaskBlue = blendState.colorMaskBlue;
clearParams.colorMaskAlpha = blendState.colorMaskAlpha;
clearParams.clearDepth = false;
clearParams.depthValue = state.getDepthClearValue();
clearParams.clearStencil = false;
clearParams.stencilValue = state.getStencilClearValue();
clearParams.stencilWriteMask = state.getDepthStencilState().stencilWritemask;
clearParams.scissorEnabled = state.isScissorTestEnabled();
clearParams.scissor = state.getScissor();
clearParams.scissorEnabled = state.isScissorTestEnabled();
clearParams.scissor = state.getScissor();
const gl::Framebuffer *framebufferObject = state.getDrawFramebuffer();
if (mask & GL_COLOR_BUFFER_BIT)
......@@ -116,14 +116,14 @@ gl::Error FramebufferD3D::clearBufferfv(ContextImpl *context,
{
clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i));
}
clearParams.colorFClearValue = gl::ColorF(values[0], values[1], values[2], values[3]);
clearParams.colorClearType = GL_FLOAT;
clearParams.colorF = gl::ColorF(values[0], values[1], values[2], values[3]);
clearParams.colorType = GL_FLOAT;
}
if (buffer == GL_DEPTH)
{
clearParams.clearDepth = true;
clearParams.depthClearValue = values[0];
clearParams.depthValue = values[0];
}
return clearImpl(context, clearParams);
......@@ -140,8 +140,8 @@ gl::Error FramebufferD3D::clearBufferuiv(ContextImpl *context,
{
clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i));
}
clearParams.colorUIClearValue = gl::ColorUI(values[0], values[1], values[2], values[3]);
clearParams.colorClearType = GL_UNSIGNED_INT;
clearParams.colorUI = gl::ColorUI(values[0], values[1], values[2], values[3]);
clearParams.colorType = GL_UNSIGNED_INT;
return clearImpl(context, clearParams);
}
......@@ -160,14 +160,14 @@ gl::Error FramebufferD3D::clearBufferiv(ContextImpl *context,
{
clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i));
}
clearParams.colorIClearValue = gl::ColorI(values[0], values[1], values[2], values[3]);
clearParams.colorClearType = GL_INT;
clearParams.colorI = gl::ColorI(values[0], values[1], values[2], values[3]);
clearParams.colorType = GL_INT;
}
if (buffer == GL_STENCIL)
{
clearParams.clearStencil = true;
clearParams.stencilClearValue = values[1];
clearParams.stencilValue = values[1];
}
return clearImpl(context, clearParams);
......@@ -181,10 +181,10 @@ gl::Error FramebufferD3D::clearBufferfi(ContextImpl *context,
{
// glClearBufferfi can only be called to clear a depth stencil buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
clearParams.clearDepth = true;
clearParams.depthClearValue = depth;
clearParams.clearStencil = true;
clearParams.stencilClearValue = stencil;
clearParams.clearDepth = true;
clearParams.depthValue = depth;
clearParams.clearStencil = true;
clearParams.stencilValue = stencil;
return clearImpl(context, clearParams);
}
......
......@@ -34,20 +34,20 @@ class RenderTargetD3D;
struct ClearParameters
{
bool clearColor[gl::IMPLEMENTATION_MAX_DRAW_BUFFERS];
gl::ColorF colorFClearValue;
gl::ColorI colorIClearValue;
gl::ColorUI colorUIClearValue;
GLenum colorClearType;
gl::ColorF colorF;
gl::ColorI colorI;
gl::ColorUI colorUI;
GLenum colorType;
bool colorMaskRed;
bool colorMaskGreen;
bool colorMaskBlue;
bool colorMaskAlpha;
bool clearDepth;
float depthClearValue;
float depthValue;
bool clearStencil;
GLint stencilClearValue;
GLint stencilValue;
GLuint stencilWriteMask;
bool scissorEnabled;
......
......@@ -20,89 +20,209 @@
#include "third_party/trace_event/trace_event.h"
// Precompiled shaders
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11_fl9vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11_fl9ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h"
namespace rx
{
static constexpr uint32_t g_VertexSize = sizeof(d3d11::PositionDepthColorVertex<float>);
namespace
{
static constexpr uint32_t g_ConstantBufferSize = sizeof(RtvDsvClearInfo<float>);
static constexpr uint32_t g_VertexSize = sizeof(d3d11::PositionVertex);
// Updates color, depth and alpha components of cached CB if necessary.
// Returns true if any constants are updated, false otherwise.
template <typename T>
static void ApplyVertices(const gl::Color<T> &color, const float depth, void *buffer)
bool UpdateDataCache(RtvDsvClearInfo<T> *dataCache,
const gl::Color<T> &color,
const float *zValue,
const uint32_t numRtvs,
const uint8_t writeMask)
{
d3d11::PositionDepthColorVertex<T> *vertices =
reinterpret_cast<d3d11::PositionDepthColorVertex<T> *>(buffer);
const float z = gl::clamp01(depth);
const float left = -1.0f;
const float right = 1.0f;
const float top = -1.0f;
const float bottom = 1.0f;
d3d11::SetPositionDepthColorVertex<T>(vertices + 0, left, bottom, z, color);
d3d11::SetPositionDepthColorVertex<T>(vertices + 1, left, top, z, color);
d3d11::SetPositionDepthColorVertex<T>(vertices + 2, right, bottom, z, color);
d3d11::SetPositionDepthColorVertex<T>(vertices + 3, right, top, z, color);
}
bool cacheDirty = false;
if (numRtvs > 0)
{
const bool writeRGB = (writeMask & ~D3D11_COLOR_WRITE_ENABLE_ALPHA) != 0;
if (writeRGB && memcmp(&dataCache->r, &color.red, sizeof(T) * 3) != 0)
{
dataCache->r = color.red;
dataCache->g = color.green;
dataCache->b = color.blue;
cacheDirty = true;
}
const bool writeAlpha = (writeMask & D3D11_COLOR_WRITE_ENABLE_ALPHA) != 0;
if (writeAlpha && (dataCache->a != color.alpha))
{
dataCache->a = color.alpha;
cacheDirty = true;
}
}
if (zValue)
{
const float clampedZValue = gl::clamp01(*zValue);
if (clampedZValue != dataCache->z)
{
dataCache->z = clampedZValue;
cacheDirty = true;
}
}
Clear11::ClearShader::ClearShader(DXGI_FORMAT colorType,
const char *inputLayoutName,
const BYTE *vsByteCode,
size_t vsSize,
const char *vsDebugName,
const BYTE *psByteCode,
size_t psSize,
const char *psDebugName)
: inputLayout(nullptr),
vertexShader(vsByteCode, vsSize, vsDebugName),
pixelShader(psByteCode, psSize, psDebugName)
return cacheDirty;
}
} // anonymous namespace
Clear11::ShaderManager::ShaderManager()
: mIl9(nullptr),
mVs9(g_VS_Clear_FL9, ArraySize(g_VS_Clear_FL9), "Clear11 VS FL9"),
mPsFloat9(g_PS_ClearFloat_FL9, ArraySize(g_PS_ClearFloat_FL9), "Clear11 PS FloatFL9"),
mVs(g_VS_Clear, ArraySize(g_VS_Clear), "Clear11 VS"),
mPsFloat(g_PS_ClearFloat, ArraySize(g_PS_ClearFloat), "Clear11 PS Float"),
mPsUInt(g_PS_ClearUint, ArraySize(g_PS_ClearUint), "Clear11 PS UINT"),
mPsSInt(g_PS_ClearSint, ArraySize(g_PS_ClearSint), "Clear11 PS SINT")
{
D3D11_INPUT_ELEMENT_DESC quadLayout[] = {
{"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},
{"COLOR", 0, colorType, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0},
};
}
inputLayout = new d3d11::LazyInputLayout(quadLayout, 2, vsByteCode, vsSize, inputLayoutName);
Clear11::ShaderManager::~ShaderManager()
{
mVs9.release();
mPsFloat9.release();
mVs.release();
mPsFloat.release();
mPsUInt.release();
mPsSInt.release();
}
Clear11::ClearShader::~ClearShader()
void Clear11::ShaderManager::getShadersAndLayout(ID3D11Device *device,
D3D_FEATURE_LEVEL featureLevel,
const INT clearType,
ID3D11InputLayout **il,
ID3D11VertexShader **vs,
ID3D11PixelShader **ps)
{
SafeDelete(inputLayout);
vertexShader.release();
pixelShader.release();
if (featureLevel <= D3D_FEATURE_LEVEL_9_3)
{
ASSERT(clearType == GL_FLOAT);
*vs = mVs9.resolve(device);
if (mIl9.Get() == nullptr)
{
const D3D11_INPUT_ELEMENT_DESC ilDesc = {
"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0};
device->CreateInputLayout(&ilDesc, 1, g_VS_Clear_FL9, ArraySize(g_PS_ClearFloat_FL9),
mIl9.GetAddressOf());
}
*il = mIl9.Get();
*ps = mPsFloat9.resolve(device);
return;
}
*vs = mVs.resolve(device);
*il = nullptr;
switch (clearType)
{
case GL_FLOAT:
*ps = mPsFloat.resolve(device);
break;
case GL_UNSIGNED_INT:
*ps = mPsUInt.resolve(device);
break;
case GL_INT:
*ps = mPsSInt.resolve(device);
break;
default:
UNREACHABLE();
break;
}
}
Clear11::Clear11(Renderer11 *renderer)
: mRenderer(renderer),
mFloatClearShader(nullptr),
mUintClearShader(nullptr),
mIntClearShader(nullptr)
mScissorEnabledRasterizerState(nullptr),
mScissorDisabledRasterizerState(nullptr),
mShaderManager(),
mConstantBuffer(nullptr),
mVertexBuffer(nullptr),
mShaderData({})
{
TRACE_EVENT0("gpu.angle", "Clear11::Clear11");
HRESULT result;
ID3D11Device *device = renderer->getDevice();
D3D11_BUFFER_DESC vbDesc;
vbDesc.ByteWidth = g_VertexSize * 4;
vbDesc.Usage = D3D11_USAGE_DYNAMIC;
vbDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
vbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
vbDesc.MiscFlags = 0;
vbDesc.StructureByteStride = 0;
static_assert((sizeof(RtvDsvClearInfo<float>) == sizeof(RtvDsvClearInfo<int>)),
"Size of rx::RtvDsvClearInfo<float> is not equal to rx::RtvDsvClearInfo<int>");
static_assert(
(sizeof(RtvDsvClearInfo<float>) == sizeof(RtvDsvClearInfo<uint32_t>)),
"Size of rx::RtvDsvClearInfo<float> is not equal to rx::RtvDsvClearInfo<uint32_t>");
static_assert((sizeof(RtvDsvClearInfo<float>) % 16 == 0),
"The size of RtvDsvClearInfo<float> should be a multiple of 16bytes.");
// Create constant buffer for color & depth data
result = device->CreateBuffer(&vbDesc, nullptr, mVertexBuffer.GetAddressOf());
D3D11_BUFFER_DESC bufferDesc;
bufferDesc.ByteWidth = g_ConstantBufferSize;
bufferDesc.Usage = D3D11_USAGE_DYNAMIC;
bufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
bufferDesc.MiscFlags = 0;
bufferDesc.StructureByteStride = 0;
D3D11_SUBRESOURCE_DATA initialData;
initialData.pSysMem = &mShaderData;
initialData.SysMemPitch = g_ConstantBufferSize;
initialData.SysMemSlicePitch = g_ConstantBufferSize;
result = device->CreateBuffer(&bufferDesc, &initialData, mConstantBuffer.GetAddressOf());
ASSERT(SUCCEEDED(result));
d3d11::SetDebugName(mVertexBuffer, "Clear11 masked clear vertex buffer");
d3d11::SetDebugName(mConstantBuffer, "Clear11 Constant Buffer");
const D3D_FEATURE_LEVEL featureLevel = mRenderer->getRenderer11DeviceCaps().featureLevel;
if (featureLevel <= D3D_FEATURE_LEVEL_9_3)
{
// Create vertex buffer with vertices for a quad covering the entire surface
static_assert((sizeof(d3d11::PositionVertex) % 16) == 0,
"d3d11::PositionVertex should be a multiple of 16 bytes");
const d3d11::PositionVertex vbData[6] = {
{-1.0f, 1.0f, 0.0f, 1.0f}, {1.0f, -1.0f, 0.0f, 1.0f}, {-1.0f, -1.0f, 0.0f, 1.0f},
{-1.0f, 1.0f, 0.0f, 1.0f}, {1.0f, 1.0f, 0.0f, 1.0f}, {1.0f, -1.0f, 0.0f, 1.0f}};
const UINT vbSize = sizeof(vbData);
bufferDesc.ByteWidth = vbSize;
bufferDesc.Usage = D3D11_USAGE_IMMUTABLE;
bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
bufferDesc.CPUAccessFlags = 0;
bufferDesc.MiscFlags = 0;
bufferDesc.StructureByteStride = 0;
initialData.pSysMem = vbData;
initialData.SysMemPitch = vbSize;
initialData.SysMemSlicePitch = initialData.SysMemPitch;
result = device->CreateBuffer(&bufferDesc, &initialData, mVertexBuffer.GetAddressOf());
ASSERT(SUCCEEDED(result));
d3d11::SetDebugName(mVertexBuffer, "Clear11 Vertex Buffer");
}
// Create Rasterizer States
D3D11_RASTERIZER_DESC rsDesc;
rsDesc.FillMode = D3D11_FILL_SOLID;
rsDesc.CullMode = D3D11_CULL_NONE;
......@@ -126,34 +246,7 @@ Clear11::Clear11(Renderer11 *renderer)
d3d11::SetDebugName(mScissorEnabledRasterizerState,
"Clear11 Rasterizer State with scissor enabled");
if (mRenderer->getRenderer11DeviceCaps().featureLevel <= D3D_FEATURE_LEVEL_9_3)
{
mFloatClearShader =
new ClearShader(DXGI_FORMAT_R32G32B32A32_FLOAT, "Clear11 Float IL", g_VS_ClearFloat,
ArraySize(g_VS_ClearFloat), "Clear11 Float VS", g_PS_ClearFloat_FL9,
ArraySize(g_PS_ClearFloat_FL9), "Clear11 Float PS");
}
else
{
mFloatClearShader =
new ClearShader(DXGI_FORMAT_R32G32B32A32_FLOAT, "Clear11 Float IL", g_VS_ClearFloat,
ArraySize(g_VS_ClearFloat), "Clear11 Float VS", g_PS_ClearFloat,
ArraySize(g_PS_ClearFloat), "Clear11 Float PS");
}
if (renderer->isES3Capable())
{
mUintClearShader =
new ClearShader(DXGI_FORMAT_R32G32B32A32_UINT, "Clear11 UINT IL", g_VS_ClearUint,
ArraySize(g_VS_ClearUint), "Clear11 UINT VS", g_PS_ClearUint,
ArraySize(g_PS_ClearUint), "Clear11 UINT PS");
mIntClearShader =
new ClearShader(DXGI_FORMAT_R32G32B32A32_UINT, "Clear11 SINT IL", g_VS_ClearSint,
ArraySize(g_VS_ClearSint), "Clear11 SINT VS", g_PS_ClearSint,
ArraySize(g_PS_ClearSint), "Clear11 SINT PS");
}
// Initialize DepthstencilStateKey with defaults
// Initialize Depthstencil state with defaults
mDepthStencilStateKey.depthTest = false;
mDepthStencilStateKey.depthMask = false;
mDepthStencilStateKey.depthFunc = GL_ALWAYS;
......@@ -187,9 +280,6 @@ Clear11::Clear11(Renderer11 *renderer)
Clear11::~Clear11()
{
SafeDelete(mFloatClearShader);
SafeDelete(mUintClearShader);
SafeDelete(mIntClearShader);
}
gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
......@@ -220,15 +310,20 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
// If these conditions are met, and:
// - No scissored clear is needed, then clear using ID3D11DeviceContext::ClearRenderTargetView.
// - A scissored clear is needed then clear using ID3D11DeviceContext1::ClearView if available.
// Otherwise draw a quad.
// Otherwise perform a shader based clear.
//
// Also determine if the depth stencil can be cleared with
// ID3D11DeviceContext::ClearDepthStencilView
// by checking if the stencil write mask covers the entire stencil.
// Also determine if the DSV can be cleared withID3D11DeviceContext::ClearDepthStencilView by
// checking if the stencil write mask covers the entire stencil.
//
// To clear the remaining buffers, quads must be drawn containing an int, uint or float vertex
// color
// attribute.
// To clear the remaining buffers, a shader based clear is performed:
// - The appropriate ShaderManagers (VS & PS) for the clearType is set
// - A CB containing the clear color and Z values is bound
// - An IL and VB are bound (for FL93 and below)
// - ScissorRect/Raststate/Viewport set as required
// - Blendstate set containing appropriate colorMasks
// - DepthStencilState set with appropriate parameters for a z or stencil clear if required
// - Color and/or Z buffers to be cleared are bound
// - Primitive covering entire clear area is drawn
gl::Extents framebufferSize;
......@@ -293,7 +388,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
const gl::InternalFormat &formatInfo = *attachment.getFormat().info;
if (clearParams.colorClearType == GL_FLOAT &&
if (clearParams.colorType == GL_FLOAT &&
!(formatInfo.componentType == GL_FLOAT ||
formatInfo.componentType == GL_UNSIGNED_NORMALIZED ||
formatInfo.componentType == GL_SIGNED_NORMALIZED))
......@@ -322,7 +417,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
}
if ((!(mRenderer->getRenderer11DeviceCaps().supportsClearView) && needScissoredClear) ||
clearParams.colorClearType != GL_FLOAT ||
clearParams.colorType != GL_FLOAT ||
(formatInfo.redBits > 0 && !clearParams.colorMaskRed) ||
(formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) ||
(formatInfo.blueBits > 0 && !clearParams.colorMaskBlue) ||
......@@ -344,16 +439,16 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
float clearValues[4] = {
((formatInfo.redBits == 0 && nativeFormat.redBits > 0)
? 0.0f
: clearParams.colorFClearValue.red),
: clearParams.colorF.red),
((formatInfo.greenBits == 0 && nativeFormat.greenBits > 0)
? 0.0f
: clearParams.colorFClearValue.green),
: clearParams.colorF.green),
((formatInfo.blueBits == 0 && nativeFormat.blueBits > 0)
? 0.0f
: clearParams.colorFClearValue.blue),
: clearParams.colorF.blue),
((formatInfo.alphaBits == 0 && nativeFormat.alphaBits > 0)
? 1.0f
: clearParams.colorFClearValue.alpha),
: clearParams.colorF.alpha),
};
if (formatInfo.alphaBits == 1)
......@@ -361,7 +456,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
// Some drivers do not correctly handle calling Clear() on a format with 1-bit
// alpha. They can incorrectly round all non-zero values up to 1.0f. Note that
// WARP does not do this. We should handle the rounding for them instead.
clearValues[3] = (clearParams.colorFClearValue.alpha >= 0.5f) ? 1.0f : 0.0f;
clearValues[3] = (clearParams.colorF.alpha >= 0.5f) ? 1.0f : 0.0f;
}
if (needScissoredClear)
......@@ -421,8 +516,8 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
{
const UINT clearFlags = (clearParams.clearDepth ? D3D11_CLEAR_DEPTH : 0) |
(clearParams.clearStencil ? D3D11_CLEAR_STENCIL : 0);
const FLOAT depthClear = gl::clamp01(clearParams.depthClearValue);
const UINT8 stencilClear = clearParams.stencilClearValue & 0xFF;
const FLOAT depthClear = gl::clamp01(clearParams.depthValue);
const UINT8 stencilClear = clearParams.stencilValue & 0xFF;
deviceContext->ClearDepthStencilView(dsv, clearFlags, depthClear, stencilClear);
......@@ -430,21 +525,29 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
}
}
if (numRtvs == 0 && !dsv)
if (numRtvs == 0 && dsv == nullptr)
{
return gl::NoError();
}
// To clear the render targets and depth stencil in one pass:
// Clear the remaining render targets and depth stencil in one pass by rendering a quad:
//
// IA/VS: Vertices containing position and color members are passed through to the next stage.
// The vertex position has XY coordinates equal to clip extents and a Z component equal to the
// Z clear value. The vertex color contains the clear color.
//
// Render a quad clipped to the scissor rectangle which draws the clear color and a blend
// state that will perform the required color masking.
// Rasterizer: Viewport scales the VS output over the entire surface and depending on whether
// or not scissoring is enabled the appropriate scissor rect and rasterizerState with or without
// the scissor test enabled is set as well.
//
// The quad's depth is equal to the depth clear value with a depth stencil state that
// will enable or disable depth test/writes if the depth buffer should be cleared or not.
// DepthStencilTest: DepthTesting, DepthWrites, StencilMask and StencilWrites will be enabled or
// disabled or set depending on what the input depthStencil clear parameters are. Since the PS
// is not writing out depth or rejecting pixels, this should happen prior to the PS stage.
//
// The rasterizer state's stencil is set to always pass or fail based on if the stencil
// should be cleared or not with a stencil write mask of the stencil clear value.
// PS: Will write out the color values passed through from the previous stage to all outputs.
//
// OM: BlendState will perform the required color masking and output to RTV(s).
//
// ======================================================================================
//
......@@ -477,7 +580,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
ANGLE_TRY(mRenderer->getStateCache().getBlendState(mBlendStateKey, &blendState));
}
const UINT stencilValue = clearParams.stencilClearValue & 0xFF;
const UINT stencilValue = clearParams.stencilValue & 0xFF;
ID3D11DepthStencilState *dsState = nullptr;
const float *zValue = nullptr;
......@@ -491,45 +594,46 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
// Get DepthStencilState
ANGLE_TRY(mRenderer->getStateCache().getDepthStencilState(mDepthStencilStateKey, &dsState));
zValue = clearParams.clearDepth ? &clearParams.depthClearValue : nullptr;
zValue = clearParams.clearDepth ? &clearParams.depthValue : nullptr;
}
// Set the vertices
ClearShader *shader = nullptr;
D3D11_MAPPED_SUBRESOURCE mappedResource;
HRESULT result =
deviceContext->Map(mVertexBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
if (FAILED(result))
{
return gl::OutOfMemory() << "Clear11: Failed to map internal VB, " << result;
}
bool dirtyCb = false;
switch (clearParams.colorClearType)
// Compare the input color/z values against the CB cache and update it if necessary
switch (clearParams.colorType)
{
case GL_FLOAT:
ApplyVertices(clearParams.colorFClearValue, clearParams.depthClearValue,
mappedResource.pData);
shader = mFloatClearShader;
dirtyCb = UpdateDataCache(reinterpret_cast<RtvDsvClearInfo<float> *>(&mShaderData),
clearParams.colorF, zValue, numRtvs, colorMask);
break;
case GL_UNSIGNED_INT:
ApplyVertices(clearParams.colorUIClearValue, clearParams.depthClearValue,
mappedResource.pData);
shader = mUintClearShader;
dirtyCb = UpdateDataCache(reinterpret_cast<RtvDsvClearInfo<uint32_t> *>(&mShaderData),
clearParams.colorUI, zValue, numRtvs, colorMask);
break;
case GL_INT:
ApplyVertices(clearParams.colorIClearValue, clearParams.depthClearValue,
mappedResource.pData);
shader = mIntClearShader;
dirtyCb = UpdateDataCache(reinterpret_cast<RtvDsvClearInfo<int> *>(&mShaderData),
clearParams.colorI, zValue, numRtvs, colorMask);
break;
default:
UNREACHABLE();
break;
}
deviceContext->Unmap(mVertexBuffer.Get(), 0);
if (dirtyCb)
{
// Update the constant buffer with the updated cache contents
// TODO(Shahmeer): Consider using UpdateSubresource1 D3D11_COPY_DISCARD where possible.
D3D11_MAPPED_SUBRESOURCE mappedResource;
HRESULT result = deviceContext->Map(mConstantBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0,
&mappedResource);
if (FAILED(result))
{
return gl::OutOfMemory() << "Clear11: Failed to map CB, " << result;
}
memcpy(mappedResource.pData, &mShaderData, g_ConstantBufferSize);
deviceContext->Unmap(mConstantBuffer.Get(), 0);
}
// Set the viewport to be the same size as the framebuffer
D3D11_VIEWPORT viewport;
......@@ -557,23 +661,43 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
deviceContext->RSSetState(mScissorDisabledRasterizerState.Get());
}
// Apply shaders
// Get Shaders
const D3D_FEATURE_LEVEL fl = mRenderer->getRenderer11DeviceCaps().featureLevel;
ID3D11Device *device = mRenderer->getDevice();
deviceContext->IASetInputLayout(shader->inputLayout->resolve(device));
deviceContext->VSSetShader(shader->vertexShader.resolve(device), nullptr, 0);
deviceContext->PSSetShader(shader->pixelShader.resolve(device), nullptr, 0);
ID3D11VertexShader *vs;
ID3D11InputLayout *il;
ID3D11PixelShader *ps;
mShaderManager.getShadersAndLayout(device, fl, clearParams.colorType, &il, &vs, &ps);
// Apply Shaders
deviceContext->VSSetShader(vs, nullptr, 0);
deviceContext->GSSetShader(nullptr, nullptr, 0);
deviceContext->PSSetShader(ps, nullptr, 0);
deviceContext->PSSetConstantBuffers(0, 1, mConstantBuffer.GetAddressOf());
// Bind IL & VB if needed
deviceContext->IASetIndexBuffer(nullptr, DXGI_FORMAT_UNKNOWN, 0);
deviceContext->IASetInputLayout(il);
if (mVertexBuffer.Get())
{
const UINT offset = 0;
deviceContext->IASetVertexBuffers(0, 1, mVertexBuffer.GetAddressOf(), &g_VertexSize,
&offset);
}
else
{
deviceContext->IASetVertexBuffers(0, 0, nullptr, nullptr, nullptr);
}
// Apply vertex buffer
const UINT offset = 0;
deviceContext->IASetVertexBuffers(0, 1, mVertexBuffer.GetAddressOf(), &g_VertexSize, &offset);
deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
// Apply render targets
mRenderer->getStateManager()->setOneTimeRenderTargets(&rtvs[0], numRtvs, dsv);
// Draw the clear quad
deviceContext->Draw(4, 0);
// Draw the fullscreen quad
deviceContext->Draw(6, 0);
// Clean up
mRenderer->markAllStateDirty();
......
......@@ -23,6 +23,14 @@ class Renderer11;
class RenderTarget11;
struct ClearParameters;
template <typename T>
struct RtvDsvClearInfo
{
T r, g, b, a;
float z;
float c1padding[3];
};
class Clear11 : angle::NonCopyable
{
public:
......@@ -34,33 +42,28 @@ class Clear11 : angle::NonCopyable
const gl::FramebufferState &fboData);
private:
struct MaskedRenderTarget
class ShaderManager final : public angle::NonCopyable
{
bool colorMask[4];
RenderTarget11 *renderTarget;
public:
ShaderManager();
~ShaderManager();
void getShadersAndLayout(ID3D11Device *device,
D3D_FEATURE_LEVEL featureLevel,
const INT clearType,
ID3D11InputLayout **il,
ID3D11VertexShader **vs,
ID3D11PixelShader **ps);
private:
angle::ComPtr<ID3D11InputLayout> mIl9;
d3d11::LazyShader<ID3D11VertexShader> mVs9;
d3d11::LazyShader<ID3D11PixelShader> mPsFloat9;
d3d11::LazyShader<ID3D11VertexShader> mVs;
d3d11::LazyShader<ID3D11PixelShader> mPsFloat;
d3d11::LazyShader<ID3D11PixelShader> mPsUInt;
d3d11::LazyShader<ID3D11PixelShader> mPsSInt;
};
ID3D11BlendState *getBlendState(const std::vector<MaskedRenderTarget> &rts);
ID3D11DepthStencilState *getDepthStencilState(const ClearParameters &clearParams);
struct ClearShader final : public angle::NonCopyable
{
ClearShader(DXGI_FORMAT colorType,
const char *inputLayoutName,
const BYTE *vsByteCode,
size_t vsSize,
const char *vsDebugName,
const BYTE *psByteCode,
size_t psSize,
const char *psDebugName);
~ClearShader();
d3d11::LazyInputLayout *inputLayout;
d3d11::LazyShader<ID3D11VertexShader> vertexShader;
d3d11::LazyShader<ID3D11PixelShader> pixelShader;
};
Renderer11 *mRenderer;
// States
......@@ -69,11 +72,13 @@ class Clear11 : angle::NonCopyable
gl::DepthStencilState mDepthStencilStateKey;
d3d11::BlendStateKey mBlendStateKey;
// Shaders and Shader Resources
ClearShader *mFloatClearShader;
ClearShader *mUintClearShader;
ClearShader *mIntClearShader;
// Shaders and shader resources
ShaderManager mShaderManager;
angle::ComPtr<ID3D11Buffer> mConstantBuffer;
angle::ComPtr<ID3D11Buffer> mVertexBuffer;
// Buffer data and draw parameters
RtvDsvClearInfo<float> mShaderData;
};
}
......
......@@ -1920,14 +1920,17 @@ LazyInputLayout::LazyInputLayout(const D3D11_INPUT_ELEMENT_DESC *inputDesc,
mByteCode(byteCode),
mDebugName(debugName)
{
memcpy(&mInputDesc[0], inputDesc, sizeof(D3D11_INPUT_ELEMENT_DESC) * inputDescLen);
if (inputDesc)
{
memcpy(&mInputDesc[0], inputDesc, sizeof(D3D11_INPUT_ELEMENT_DESC) * inputDescLen);
}
}
ID3D11InputLayout *LazyInputLayout::resolve(ID3D11Device *device)
{
checkAssociatedDevice(device);
if (mResource == nullptr)
if (mResource == nullptr && mByteCode != nullptr)
{
HRESULT result =
device->CreateInputLayout(&mInputDesc[0], static_cast<UINT>(mInputDesc.size()),
......
......@@ -114,26 +114,11 @@ struct PositionLayerTexCoord3DVertex
void SetPositionLayerTexCoord3DVertex(PositionLayerTexCoord3DVertex* vertex, float x, float y,
unsigned int layer, float u, float v, float s);
template <typename T>
struct PositionDepthColorVertex
struct PositionVertex
{
float x, y, z;
T r, g, b, a;
float x, y, z, w;
};
template <typename T>
void SetPositionDepthColorVertex(PositionDepthColorVertex<T>* vertex, float x, float y, float z,
const gl::Color<T> &color)
{
vertex->x = x;
vertex->y = y;
vertex->z = z;
vertex->r = color.red;
vertex->g = color.green;
vertex->b = color.blue;
vertex->a = color.alpha;
}
struct BlendStateKey
{
gl::BlendState blendState;
......
// Assume we are in SM4+, which has 8 color outputs
//
// Copyright (c) 2017 The ANGLE Project. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
void VS_ClearFloat( in float3 inPosition : POSITION, in float4 inColor : COLOR,
out float4 outPosition : SV_POSITION, out float4 outColor : COLOR)
// Clear11.hlsl: Shaders for clearing RTVs and DSVs using draw calls and
// specifying float depth values and either float, uint or sint clear colors.
// Notes:
// - UINT & SINT clears can only be compiled with FL10+
// - VS_Clear_FL9 requires a VB to be bound with vertices to create
// a primitive covering the entire surface (in clip co-ordinates)
// Constants
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),
};
// Vertex Shaders
void VS_Clear(in uint id : SV_VertexID,
out float4 outPosition : SV_POSITION)
{
outPosition = float4(inPosition, 1.0f);
outColor = inColor;
float2 corner = g_Corners[id];
outPosition = float4(corner.x, corner.y, 0.0f, 1.0f);
}
struct PS_OutputFloat
void VS_Clear_FL9( in float4 inPosition : POSITION,
out float4 outPosition : SV_POSITION)
{
float4 color0 : SV_TARGET0;
float4 color1 : SV_TARGET1;
float4 color2 : SV_TARGET2;
float4 color3 : SV_TARGET3;
float4 color4 : SV_TARGET4;
float4 color5 : SV_TARGET5;
float4 color6 : SV_TARGET6;
float4 color7 : SV_TARGET7;
};
outPosition = inPosition;
}
// Pixel Shader Constant Buffers
cbuffer ColorAndDepthDataFloat : register(b0)
{
float4 color_Float : packoffset(c0);
float zValueF_Float : packoffset(c1);
}
cbuffer ColorAndDepthDataSint : register(b0)
{
int4 color_Sint : packoffset(c0);
float zValueF_Sint : packoffset(c1);
}
PS_OutputFloat PS_ClearFloat(in float4 inPosition : SV_POSITION, in float4 inColor : COLOR)
cbuffer ColorAndDepthDataUint : register(b0)
{
PS_OutputFloat outColor;
outColor.color0 = inColor;
outColor.color1 = inColor;
outColor.color2 = inColor;
outColor.color3 = inColor;
outColor.color4 = inColor;
outColor.color5 = inColor;
outColor.color6 = inColor;
outColor.color7 = inColor;
return outColor;
uint4 color_Uint : packoffset(c0);
float zValueF_Uint : packoffset(c1);
}
// Pixel Shader Output Structs
struct PS_OutputFloat_FL9
{
float4 color0 : SV_TARGET0;
float4 color1 : SV_TARGET1;
float4 color2 : SV_TARGET2;
float4 color3 : SV_TARGET3;
float depth : SV_DEPTH;
};
PS_OutputFloat_FL9 PS_ClearFloat_FL9(in float4 inPosition : SV_POSITION, in float4 inColor : COLOR)
{
PS_OutputFloat_FL9 outColor;
outColor.color0 = inColor;
outColor.color1 = inColor;
outColor.color2 = inColor;
outColor.color3 = inColor;
return outColor;
}
void VS_ClearUint( in float3 inPosition : POSITION, in uint4 inColor : COLOR,
out float4 outPosition : SV_POSITION, out uint4 outColor : COLOR)
struct PS_OutputFloat
{
outPosition = float4(inPosition, 1.0f);
outColor = inColor;
}
float4 color0 : SV_TARGET0;
float4 color1 : SV_TARGET1;
float4 color2 : SV_TARGET2;
float4 color3 : SV_TARGET3;
float4 color4 : SV_TARGET4;
float4 color5 : SV_TARGET5;
float4 color6 : SV_TARGET6;
float4 color7 : SV_TARGET7;
float depth : SV_DEPTH;
};
struct PS_OutputUint
{
......@@ -68,30 +88,9 @@ struct PS_OutputUint
uint4 color5 : SV_TARGET5;
uint4 color6 : SV_TARGET6;
uint4 color7 : SV_TARGET7;
float depth : SV_DEPTH;
};
PS_OutputUint PS_ClearUint(in float4 inPosition : SV_POSITION, in uint4 inColor : COLOR)
{
PS_OutputUint outColor;
outColor.color0 = inColor;
outColor.color1 = inColor;
outColor.color2 = inColor;
outColor.color3 = inColor;
outColor.color4 = inColor;
outColor.color5 = inColor;
outColor.color6 = inColor;
outColor.color7 = inColor;
return outColor;
}
void VS_ClearSint( in float3 inPosition : POSITION, in int4 inColor : COLOR,
out float4 outPosition : SV_POSITION, out int4 outColor : COLOR)
{
outPosition = float4(inPosition, 1.0f);
outColor = inColor;
}
struct PS_OutputSint
{
int4 color0 : SV_TARGET0;
......@@ -102,18 +101,62 @@ struct PS_OutputSint
int4 color5 : SV_TARGET5;
int4 color6 : SV_TARGET6;
int4 color7 : SV_TARGET7;
float depth : SV_DEPTH;
};
PS_OutputSint PS_ClearSint(in float4 inPosition : SV_POSITION, in int4 inColor : COLOR)
// Pixel Shaders
PS_OutputFloat_FL9 PS_ClearFloat_FL9(in float4 inPosition : SV_POSITION)
{
PS_OutputFloat_FL9 outData;
outData.color0 = color_Float;
outData.color1 = color_Float;
outData.color2 = color_Float;
outData.color3 = color_Float;
outData.depth = zValueF_Float;
return outData;
}
PS_OutputFloat PS_ClearFloat(in float4 inPosition : SV_POSITION)
{
PS_OutputFloat outData;
outData.color0 = color_Float;
outData.color1 = color_Float;
outData.color2 = color_Float;
outData.color3 = color_Float;
outData.color4 = color_Float;
outData.color5 = color_Float;
outData.color6 = color_Float;
outData.color7 = color_Float;
outData.depth = zValueF_Float;
return outData;
}
PS_OutputUint PS_ClearUint(in float4 inPosition : SV_POSITION)
{
PS_OutputSint outColor;
outColor.color0 = inColor;
outColor.color1 = inColor;
outColor.color2 = inColor;
outColor.color3 = inColor;
outColor.color4 = inColor;
outColor.color5 = inColor;
outColor.color6 = inColor;
outColor.color7 = inColor;
return outColor;
PS_OutputUint outData;
outData.color0 = color_Uint;
outData.color1 = color_Uint;
outData.color2 = color_Uint;
outData.color3 = color_Uint;
outData.color4 = color_Uint;
outData.color5 = color_Uint;
outData.color6 = color_Uint;
outData.color7 = color_Uint;
outData.depth = zValueF_Uint;
return outData;
}
PS_OutputSint PS_ClearSint(in float4 inPosition : SV_POSITION)
{
PS_OutputSint outData;
outData.color0 = color_Sint;
outData.color1 = color_Sint;
outData.color2 = color_Sint;
outData.color3 = color_Sint;
outData.color4 = color_Sint;
outData.color5 = color_Sint;
outData.color6 = color_Sint;
outData.color7 = color_Sint;
outData.depth = zValueF_Sint;
return outData;
}
\ No newline at end of file
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xyzw 0 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xyzw
//
//
// Runtime generated constant mappings:
//
// Target Reg Constant Description
// ---------- --------------------------------------------------
// c0 Vertex Shader position offset
//
//
// Level9 shader bytecode:
//
vs_2_x
dcl_texcoord v0
mad oPos.xy, v0.w, c0, v0
mov oPos.zw, v0
// approximately 2 instruction slots used
vs_4_0
dcl_input v0.xyzw
dcl_output_siv o0.xyzw, position
mov o0.xyzw, v0.xyzw
ret
// Approximately 2 instruction slots used
#endif
const BYTE g_VS_Clear_FL9[] =
{
68, 88, 66, 67, 176, 74,
193, 175, 25, 51, 252, 39,
176, 214, 107, 38, 137, 209,
240, 189, 1, 0, 0, 0,
28, 2, 0, 0, 6, 0,
0, 0, 56, 0, 0, 0,
156, 0, 0, 0, 224, 0,
0, 0, 92, 1, 0, 0,
180, 1, 0, 0, 232, 1,
0, 0, 65, 111, 110, 57,
92, 0, 0, 0, 92, 0,
0, 0, 0, 2, 254, 255,
52, 0, 0, 0, 40, 0,
0, 0, 0, 0, 36, 0,
0, 0, 36, 0, 0, 0,
36, 0, 0, 0, 36, 0,
1, 0, 36, 0, 0, 0,
0, 0, 1, 2, 254, 255,
31, 0, 0, 2, 5, 0,
0, 128, 0, 0, 15, 144,
4, 0, 0, 4, 0, 0,
3, 192, 0, 0, 255, 144,
0, 0, 228, 160, 0, 0,
228, 144, 1, 0, 0, 2,
0, 0, 12, 192, 0, 0,
228, 144, 255, 255, 0, 0,
83, 72, 68, 82, 60, 0,
0, 0, 64, 0, 1, 0,
15, 0, 0, 0, 95, 0,
0, 3, 242, 16, 16, 0,
0, 0, 0, 0, 103, 0,
0, 4, 242, 32, 16, 0,
0, 0, 0, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 0, 0,
0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84,
116, 0, 0, 0, 2, 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, 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, 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,
82, 68, 69, 70, 80, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 28, 0, 0, 0,
0, 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, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15,
0, 0, 80, 79, 83, 73,
84, 73, 79, 78, 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, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 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
//
vs_4_0
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_temps 1
mov r0.x, v0.x
mov o0.xy, icb[r0.x + 0].xyxx
mov o0.zw, l(0,0,0,1.000000)
ret
// Approximately 4 instruction slots used
#endif
const BYTE g_VS_Clear[] =
{
68, 88, 66, 67, 170, 97,
47, 88, 112, 76, 249, 40,
248, 151, 133, 76, 228, 131,
60, 115, 1, 0, 0, 0,
96, 2, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0,
140, 0, 0, 0, 192, 0,
0, 0, 244, 0, 0, 0,
228, 1, 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, 0, 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, 44, 0,
0, 0, 1, 0, 0, 0,
8, 0, 0, 0, 32, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 83, 86,
95, 80, 79, 83, 73, 84,
73, 79, 78, 0, 83, 72,
68, 82, 232, 0, 0, 0,
64, 0, 1, 0, 58, 0,
0, 0, 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,
104, 0, 0, 2, 1, 0,
0, 0, 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, 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,
62, 0, 0, 1, 83, 84,
65, 84, 116, 0, 0, 0,
4, 0, 0, 0, 1, 0,
0, 0, 6, 0, 0, 0,
2, 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, 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
};
......@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Buffer Definitions:
//
// cbuffer ColorAndDepthDataFloat
// {
//
// float4 color_Float; // Offset: 0 Size: 16
// float zValueF_Float; // Offset: 16 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// ColorAndDepthDataFloat cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE float xyzw
//
//
// Output signature:
......@@ -20,91 +37,111 @@
// SV_TARGET 1 xyzw 1 TARGET float xyzw
// SV_TARGET 2 xyzw 2 TARGET float xyzw
// SV_TARGET 3 xyzw 3 TARGET float xyzw
// SV_DEPTH 0 N/A oDepth DEPTH float YES
//
//
// Constant buffer to DX9 shader constant mappings:
//
// Target Reg Buffer Start Reg # of Regs Data Conversion
// ---------- ------- --------- --------- ----------------------
// c0 cb0 0 2 ( FLT, FLT, FLT, FLT)
//
//
// Level9 shader bytecode:
//
ps_2_x
dcl t0
mov oC0, t0
mov oC1, t0
mov oC2, t0
mov oC3, t0
mov oC0, c0
mov oC1, c0
mov oC2, c0
mov oC3, c0
mov oDepth, c1.x
// approximately 4 instruction slots used
// approximately 5 instruction slots used
ps_4_0
dcl_input_ps linear v1.xyzw
dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
mov o0.xyzw, v1.xyzw
mov o1.xyzw, v1.xyzw
mov o2.xyzw, v1.xyzw
mov o3.xyzw, v1.xyzw
dcl_output oDepth
mov o0.xyzw, cb0[0].xyzw
mov o1.xyzw, cb0[0].xyzw
mov o2.xyzw, cb0[0].xyzw
mov o3.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret
// Approximately 5 instruction slots used
// Approximately 6 instruction slots used
#endif
const BYTE g_PS_ClearFloat_FL9[] =
{
68, 88, 66, 67, 36, 167,
59, 21, 253, 46, 206, 132,
254, 28, 18, 118, 51, 115,
45, 31, 1, 0, 0, 0,
236, 2, 0, 0, 6, 0,
68, 88, 66, 67, 50, 112,
200, 244, 43, 179, 42, 60,
1, 54, 148, 142, 159, 31,
160, 168, 1, 0, 0, 0,
228, 3, 0, 0, 6, 0,
0, 0, 56, 0, 0, 0,
168, 0, 0, 0, 72, 1,
0, 0, 196, 1, 0, 0,
28, 2, 0, 0, 112, 2,
180, 0, 0, 0, 132, 1,
0, 0, 0, 2, 0, 0,
20, 3, 0, 0, 72, 3,
0, 0, 65, 111, 110, 57,
104, 0, 0, 0, 104, 0,
116, 0, 0, 0, 116, 0,
0, 0, 0, 2, 255, 255,
68, 0, 0, 0, 36, 0,
0, 0, 0, 0, 36, 0,
0, 0, 36, 0, 0, 0,
36, 0, 0, 0, 36, 0,
0, 0, 36, 0, 1, 2,
255, 255, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 176, 1, 0, 0, 2,
68, 0, 0, 0, 48, 0,
0, 0, 1, 0, 36, 0,
0, 0, 48, 0, 0, 0,
48, 0, 0, 0, 36, 0,
0, 0, 48, 0, 0, 0,
0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 1, 2,
255, 255, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0,
228, 176, 1, 0, 0, 2,
228, 160, 1, 0, 0, 2,
1, 8, 15, 128, 0, 0,
228, 176, 1, 0, 0, 2,
228, 160, 1, 0, 0, 2,
2, 8, 15, 128, 0, 0,
228, 176, 1, 0, 0, 2,
228, 160, 1, 0, 0, 2,
3, 8, 15, 128, 0, 0,
228, 176, 255, 255, 0, 0,
83, 72, 68, 82, 152, 0,
228, 160, 1, 0, 0, 2,
0, 8, 15, 144, 1, 0,
0, 160, 255, 255, 0, 0,
83, 72, 68, 82, 200, 0,
0, 0, 64, 0, 0, 0,
38, 0, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
1, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
3, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5,
50, 0, 0, 0, 89, 0,
0, 4, 70, 142, 32, 0,
0, 0, 0, 0, 2, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
3, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 3, 0,
0, 0, 101, 0, 0, 2,
1, 192, 0, 0, 54, 0,
0, 6, 242, 32, 16, 0,
0, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 54, 0,
0, 6, 242, 32, 16, 0,
1, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 54, 0,
0, 6, 242, 32, 16, 0,
2, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 54, 0,
0, 6, 242, 32, 16, 0,
3, 0, 0, 0, 70, 142,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 54, 0,
0, 5, 1, 192, 0, 0,
10, 128, 32, 0, 0, 0,
0, 0, 1, 0, 0, 0,
62, 0, 0, 1, 83, 84,
65, 84, 116, 0, 0, 0,
5, 0, 0, 0, 0, 0,
6, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......@@ -116,7 +153,7 @@ const BYTE g_PS_ClearFloat_FL9[] =
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 4, 0,
0, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......@@ -124,53 +161,84 @@ const BYTE g_PS_ClearFloat_FL9[] =
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 82, 68, 69, 70,
80, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 28, 0,
12, 1, 0, 0, 1, 0,
0, 0, 84, 0, 0, 0,
1, 0, 0, 0, 28, 0,
0, 0, 0, 4, 255, 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, 76, 0,
0, 0, 2, 0, 0, 0,
8, 0, 0, 0, 56, 0,
0, 1, 0, 0, 216, 0,
0, 0, 60, 0, 0, 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,
15, 15, 0, 0, 83, 86,
95, 80, 79, 83, 73, 84,
73, 79, 78, 0, 67, 79,
76, 79, 82, 0, 171, 171,
79, 83, 71, 78, 116, 0,
0, 0, 4, 0, 0, 0,
8, 0, 0, 0, 104, 0,
1, 0, 0, 0, 67, 111,
108, 111, 114, 65, 110, 100,
68, 101, 112, 116, 104, 68,
97, 116, 97, 70, 108, 111,
97, 116, 0, 171, 60, 0,
0, 0, 2, 0, 0, 0,
108, 0, 0, 0, 32, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 156, 0,
0, 0, 0, 0, 0, 0,
16, 0, 0, 0, 2, 0,
0, 0, 168, 0, 0, 0,
0, 0, 0, 0, 184, 0,
0, 0, 16, 0, 0, 0,
4, 0, 0, 0, 2, 0,
0, 0, 200, 0, 0, 0,
0, 0, 0, 0, 99, 111,
108, 111, 114, 95, 70, 108,
111, 97, 116, 0, 1, 0,
3, 0, 1, 0, 4, 0,
0, 0, 0, 0, 0, 0,
0, 0, 122, 86, 97, 108,
117, 101, 70, 95, 70, 108,
111, 97, 116, 0, 171, 171,
0, 0, 3, 0, 1, 0,
1, 0, 0, 0, 0, 0,
0, 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, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 0,
79, 83, 71, 78, 148, 0,
0, 0, 5, 0, 0, 0,
8, 0, 0, 0, 128, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 104, 0,
15, 0, 0, 0, 128, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
15, 0, 0, 0, 104, 0,
15, 0, 0, 0, 128, 0,
0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
15, 0, 0, 0, 104, 0,
15, 0, 0, 0, 128, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 3, 0, 0, 0,
15, 0, 0, 0, 83, 86,
15, 0, 0, 0, 138, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 255, 255, 255, 255,
1, 14, 0, 0, 83, 86,
95, 84, 65, 82, 71, 69,
84, 0, 171, 171
84, 0, 83, 86, 95, 68,
69, 80, 84, 72, 0, 171
};
......@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Buffer Definitions:
//
// cbuffer ColorAndDepthDataFloat
// {
//
// float4 color_Float; // Offset: 0 Size: 16
// float zValueF_Float; // Offset: 16 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// ColorAndDepthDataFloat cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE float xyzw
//
//
// Output signature:
......@@ -24,9 +41,10 @@
// SV_TARGET 5 xyzw 5 TARGET float xyzw
// SV_TARGET 6 xyzw 6 TARGET float xyzw
// SV_TARGET 7 xyzw 7 TARGET float xyzw
// SV_DEPTH 0 N/A oDepth DEPTH float YES
//
ps_4_0
dcl_input_ps linear v1.xyzw
dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
......@@ -35,99 +53,133 @@ dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
mov o0.xyzw, v1.xyzw
mov o1.xyzw, v1.xyzw
mov o2.xyzw, v1.xyzw
mov o3.xyzw, v1.xyzw
mov o4.xyzw, v1.xyzw
mov o5.xyzw, v1.xyzw
mov o6.xyzw, v1.xyzw
mov o7.xyzw, v1.xyzw
dcl_output oDepth
mov o0.xyzw, cb0[0].xyzw
mov o1.xyzw, cb0[0].xyzw
mov o2.xyzw, cb0[0].xyzw
mov o3.xyzw, cb0[0].xyzw
mov o4.xyzw, cb0[0].xyzw
mov o5.xyzw, cb0[0].xyzw
mov o6.xyzw, cb0[0].xyzw
mov o7.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret
// Approximately 9 instruction slots used
// Approximately 10 instruction slots used
#endif
const BYTE g_PS_ClearFloat[] =
{
68, 88, 66, 67, 19, 30,
102, 69, 166, 219, 165, 14,
173, 41, 171, 133, 144, 58,
14, 224, 1, 0, 0, 0,
88, 3, 0, 0, 5, 0,
68, 88, 66, 67, 0, 45,
15, 86, 227, 217, 47, 173,
72, 182, 197, 224, 178, 165,
77, 73, 1, 0, 0, 0,
84, 4, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0,
140, 0, 0, 0, 224, 0,
0, 0, 188, 1, 0, 0,
220, 2, 0, 0, 82, 68,
69, 70, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
72, 1, 0, 0, 124, 1,
0, 0, 120, 2, 0, 0,
216, 3, 0, 0, 82, 68,
69, 70, 12, 1, 0, 0,
1, 0, 0, 0, 84, 0,
0, 0, 1, 0, 0, 0,
28, 0, 0, 0, 0, 4,
255, 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,
76, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
216, 0, 0, 0, 60, 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, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
68, 0, 0, 0, 0, 0,
67, 111, 108, 111, 114, 65,
110, 100, 68, 101, 112, 116,
104, 68, 97, 116, 97, 70,
108, 111, 97, 116, 0, 171,
60, 0, 0, 0, 2, 0,
0, 0, 108, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 0,
67, 79, 76, 79, 82, 0,
171, 171, 79, 83, 71, 78,
212, 0, 0, 0, 8, 0,
156, 0, 0, 0, 0, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 168, 0,
0, 0, 0, 0, 0, 0,
184, 0, 0, 0, 16, 0,
0, 0, 4, 0, 0, 0,
2, 0, 0, 0, 200, 0,
0, 0, 0, 0, 0, 0,
99, 111, 108, 111, 114, 95,
70, 108, 111, 97, 116, 0,
1, 0, 3, 0, 1, 0,
4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 122, 86,
97, 108, 117, 101, 70, 95,
70, 108, 111, 97, 116, 0,
171, 171, 0, 0, 3, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 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, 1, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 80,
79, 83, 73, 84, 73, 79,
78, 0, 79, 83, 71, 78,
244, 0, 0, 0, 9, 0,
0, 0, 8, 0, 0, 0,
200, 0, 0, 0, 0, 0,
224, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 1, 0,
224, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 2, 0,
224, 0, 0, 0, 2, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 3, 0,
224, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 4, 0,
224, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 4, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 5, 0,
224, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 5, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 6, 0,
224, 0, 0, 0, 6, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 6, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 7, 0,
224, 0, 0, 0, 7, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 7, 0,
0, 0, 15, 0, 0, 0,
234, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 255, 255,
255, 255, 1, 14, 0, 0,
83, 86, 95, 84, 65, 82,
71, 69, 84, 0, 171, 171,
83, 72, 68, 82, 24, 1,
0, 0, 64, 0, 0, 0,
70, 0, 0, 0, 98, 16,
0, 3, 242, 16, 16, 0,
1, 0, 0, 0, 101, 0,
71, 69, 84, 0, 83, 86,
95, 68, 69, 80, 84, 72,
0, 171, 83, 72, 68, 82,
88, 1, 0, 0, 64, 0,
0, 0, 86, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
......@@ -143,36 +195,46 @@ const BYTE g_PS_ClearFloat[] =
0, 3, 242, 32, 16, 0,
6, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
7, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
3, 0, 0, 0, 70, 30,
7, 0, 0, 0, 101, 0,
0, 2, 1, 192, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 2, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 3, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 4, 0, 0, 0,
70, 30, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 5, 0,
0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
6, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 5, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 6, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 7, 0, 0, 0,
70, 30, 16, 0, 1, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 5, 1, 192,
0, 0, 10, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0,
0, 0, 9, 0, 0, 0,
0, 0, 10, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 9, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......@@ -185,7 +247,7 @@ const BYTE g_PS_ClearFloat[] =
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0,
9, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......
......@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Buffer Definitions:
//
// cbuffer ColorAndDepthDataSint
// {
//
// int4 color_Sint; // Offset: 0 Size: 16
// float zValueF_Sint; // Offset: 16 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// ColorAndDepthDataSint cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE int xyzw
//
//
// Output signature:
......@@ -24,9 +41,10 @@
// SV_TARGET 5 xyzw 5 TARGET int xyzw
// SV_TARGET 6 xyzw 6 TARGET int xyzw
// SV_TARGET 7 xyzw 7 TARGET int xyzw
// SV_DEPTH 0 N/A oDepth DEPTH float YES
//
ps_4_0
dcl_input_ps constant v1.xyzw
dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
......@@ -35,99 +53,133 @@ dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
mov o0.xyzw, v1.xyzw
mov o1.xyzw, v1.xyzw
mov o2.xyzw, v1.xyzw
mov o3.xyzw, v1.xyzw
mov o4.xyzw, v1.xyzw
mov o5.xyzw, v1.xyzw
mov o6.xyzw, v1.xyzw
mov o7.xyzw, v1.xyzw
dcl_output oDepth
mov o0.xyzw, cb0[0].xyzw
mov o1.xyzw, cb0[0].xyzw
mov o2.xyzw, cb0[0].xyzw
mov o3.xyzw, cb0[0].xyzw
mov o4.xyzw, cb0[0].xyzw
mov o5.xyzw, cb0[0].xyzw
mov o6.xyzw, cb0[0].xyzw
mov o7.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret
// Approximately 9 instruction slots used
// Approximately 10 instruction slots used
#endif
const BYTE g_PS_ClearSint[] =
{
68, 88, 66, 67, 206, 129,
255, 236, 115, 217, 216, 20,
88, 47, 155, 195, 145, 179,
183, 28, 1, 0, 0, 0,
88, 3, 0, 0, 5, 0,
68, 88, 66, 67, 40, 80,
87, 20, 166, 137, 87, 18,
79, 10, 71, 118, 4, 27,
31, 113, 1, 0, 0, 0,
84, 4, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0,
140, 0, 0, 0, 224, 0,
0, 0, 188, 1, 0, 0,
220, 2, 0, 0, 82, 68,
69, 70, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
72, 1, 0, 0, 124, 1,
0, 0, 120, 2, 0, 0,
216, 3, 0, 0, 82, 68,
69, 70, 12, 1, 0, 0,
1, 0, 0, 0, 84, 0,
0, 0, 1, 0, 0, 0,
28, 0, 0, 0, 0, 4,
255, 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,
76, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
216, 0, 0, 0, 60, 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, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
68, 0, 0, 0, 0, 0,
67, 111, 108, 111, 114, 65,
110, 100, 68, 101, 112, 116,
104, 68, 97, 116, 97, 83,
105, 110, 116, 0, 171, 171,
60, 0, 0, 0, 2, 0,
0, 0, 108, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 1, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 0,
67, 79, 76, 79, 82, 0,
171, 171, 79, 83, 71, 78,
212, 0, 0, 0, 8, 0,
156, 0, 0, 0, 0, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 168, 0,
0, 0, 0, 0, 0, 0,
184, 0, 0, 0, 16, 0,
0, 0, 4, 0, 0, 0,
2, 0, 0, 0, 200, 0,
0, 0, 0, 0, 0, 0,
99, 111, 108, 111, 114, 95,
83, 105, 110, 116, 0, 171,
1, 0, 2, 0, 1, 0,
4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 122, 86,
97, 108, 117, 101, 70, 95,
83, 105, 110, 116, 0, 171,
171, 171, 0, 0, 3, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 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, 1, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 80,
79, 83, 73, 84, 73, 79,
78, 0, 79, 83, 71, 78,
244, 0, 0, 0, 9, 0,
0, 0, 8, 0, 0, 0,
200, 0, 0, 0, 0, 0,
224, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 1, 0,
224, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 2, 0,
224, 0, 0, 0, 2, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 3, 0,
224, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 4, 0,
224, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 4, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 5, 0,
224, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 5, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 6, 0,
224, 0, 0, 0, 6, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 6, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 7, 0,
224, 0, 0, 0, 7, 0,
0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 7, 0,
0, 0, 15, 0, 0, 0,
234, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 255, 255,
255, 255, 1, 14, 0, 0,
83, 86, 95, 84, 65, 82,
71, 69, 84, 0, 171, 171,
83, 72, 68, 82, 24, 1,
0, 0, 64, 0, 0, 0,
70, 0, 0, 0, 98, 8,
0, 3, 242, 16, 16, 0,
1, 0, 0, 0, 101, 0,
71, 69, 84, 0, 83, 86,
95, 68, 69, 80, 84, 72,
0, 171, 83, 72, 68, 82,
88, 1, 0, 0, 64, 0,
0, 0, 86, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
......@@ -143,36 +195,46 @@ const BYTE g_PS_ClearSint[] =
0, 3, 242, 32, 16, 0,
6, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
7, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
3, 0, 0, 0, 70, 30,
7, 0, 0, 0, 101, 0,
0, 2, 1, 192, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 2, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 3, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 4, 0, 0, 0,
70, 30, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 5, 0,
0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
6, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 5, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 6, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 7, 0, 0, 0,
70, 30, 16, 0, 1, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 5, 1, 192,
0, 0, 10, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0,
0, 0, 9, 0, 0, 0,
0, 0, 10, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 9, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......@@ -185,7 +247,7 @@ const BYTE g_PS_ClearSint[] =
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0,
9, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......
......@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Buffer Definitions:
//
// cbuffer ColorAndDepthDataUint
// {
//
// uint4 color_Uint; // Offset: 0 Size: 16
// float zValueF_Uint; // Offset: 16 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// ColorAndDepthDataUint cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE uint xyzw
//
//
// Output signature:
......@@ -24,9 +41,10 @@
// SV_TARGET 5 xyzw 5 TARGET uint xyzw
// SV_TARGET 6 xyzw 6 TARGET uint xyzw
// SV_TARGET 7 xyzw 7 TARGET uint xyzw
// SV_DEPTH 0 N/A oDepth DEPTH float YES
//
ps_4_0
dcl_input_ps constant v1.xyzw
dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
......@@ -35,99 +53,133 @@ dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
mov o0.xyzw, v1.xyzw
mov o1.xyzw, v1.xyzw
mov o2.xyzw, v1.xyzw
mov o3.xyzw, v1.xyzw
mov o4.xyzw, v1.xyzw
mov o5.xyzw, v1.xyzw
mov o6.xyzw, v1.xyzw
mov o7.xyzw, v1.xyzw
dcl_output oDepth
mov o0.xyzw, cb0[0].xyzw
mov o1.xyzw, cb0[0].xyzw
mov o2.xyzw, cb0[0].xyzw
mov o3.xyzw, cb0[0].xyzw
mov o4.xyzw, cb0[0].xyzw
mov o5.xyzw, cb0[0].xyzw
mov o6.xyzw, cb0[0].xyzw
mov o7.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret
// Approximately 9 instruction slots used
// Approximately 10 instruction slots used
#endif
const BYTE g_PS_ClearUint[] =
{
68, 88, 66, 67, 117, 209,
142, 159, 65, 29, 212, 206,
242, 37, 169, 58, 35, 236,
222, 73, 1, 0, 0, 0,
88, 3, 0, 0, 5, 0,
68, 88, 66, 67, 31, 50,
232, 254, 182, 197, 174, 161,
39, 175, 44, 65, 71, 251,
37, 230, 1, 0, 0, 0,
84, 4, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0,
140, 0, 0, 0, 224, 0,
0, 0, 188, 1, 0, 0,
220, 2, 0, 0, 82, 68,
69, 70, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
72, 1, 0, 0, 124, 1,
0, 0, 120, 2, 0, 0,
216, 3, 0, 0, 82, 68,
69, 70, 12, 1, 0, 0,
1, 0, 0, 0, 84, 0,
0, 0, 1, 0, 0, 0,
28, 0, 0, 0, 0, 4,
255, 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,
76, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0,
216, 0, 0, 0, 60, 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, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
68, 0, 0, 0, 0, 0,
67, 111, 108, 111, 114, 65,
110, 100, 68, 101, 112, 116,
104, 68, 97, 116, 97, 85,
105, 110, 116, 0, 171, 171,
60, 0, 0, 0, 2, 0,
0, 0, 108, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0,
0, 0, 15, 15, 0, 0,
83, 86, 95, 80, 79, 83,
73, 84, 73, 79, 78, 0,
67, 79, 76, 79, 82, 0,
171, 171, 79, 83, 71, 78,
212, 0, 0, 0, 8, 0,
156, 0, 0, 0, 0, 0,
0, 0, 16, 0, 0, 0,
2, 0, 0, 0, 168, 0,
0, 0, 0, 0, 0, 0,
184, 0, 0, 0, 16, 0,
0, 0, 4, 0, 0, 0,
2, 0, 0, 0, 200, 0,
0, 0, 0, 0, 0, 0,
99, 111, 108, 111, 114, 95,
85, 105, 110, 116, 0, 171,
1, 0, 19, 0, 1, 0,
4, 0, 0, 0, 0, 0,
0, 0, 0, 0, 122, 86,
97, 108, 117, 101, 70, 95,
85, 105, 110, 116, 0, 171,
171, 171, 0, 0, 3, 0,
1, 0, 1, 0, 0, 0,
0, 0, 0, 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, 1, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 80,
79, 83, 73, 84, 73, 79,
78, 0, 79, 83, 71, 78,
244, 0, 0, 0, 9, 0,
0, 0, 8, 0, 0, 0,
200, 0, 0, 0, 0, 0,
224, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 1, 0,
224, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 2, 0,
224, 0, 0, 0, 2, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 3, 0,
224, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 4, 0,
224, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 4, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 5, 0,
224, 0, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 5, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 6, 0,
224, 0, 0, 0, 6, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 6, 0,
0, 0, 15, 0, 0, 0,
200, 0, 0, 0, 7, 0,
224, 0, 0, 0, 7, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 7, 0,
0, 0, 15, 0, 0, 0,
234, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 255, 255,
255, 255, 1, 14, 0, 0,
83, 86, 95, 84, 65, 82,
71, 69, 84, 0, 171, 171,
83, 72, 68, 82, 24, 1,
0, 0, 64, 0, 0, 0,
70, 0, 0, 0, 98, 8,
0, 3, 242, 16, 16, 0,
1, 0, 0, 0, 101, 0,
71, 69, 84, 0, 83, 86,
95, 68, 69, 80, 84, 72,
0, 171, 83, 72, 68, 82,
88, 1, 0, 0, 64, 0,
0, 0, 86, 0, 0, 0,
89, 0, 0, 4, 70, 142,
32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
......@@ -143,36 +195,46 @@ const BYTE g_PS_ClearUint[] =
0, 3, 242, 32, 16, 0,
6, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0,
7, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
3, 0, 0, 0, 70, 30,
7, 0, 0, 0, 101, 0,
0, 2, 1, 192, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 2, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 3, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 4, 0, 0, 0,
70, 30, 16, 0, 1, 0,
0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 5, 0,
0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0,
0, 5, 242, 32, 16, 0,
6, 0, 0, 0, 70, 30,
16, 0, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 5, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 6, 0, 0, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 6, 242, 32,
16, 0, 7, 0, 0, 0,
70, 30, 16, 0, 1, 0,
70, 142, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
54, 0, 0, 5, 1, 192,
0, 0, 10, 128, 32, 0,
0, 0, 0, 0, 1, 0,
0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0,
0, 0, 9, 0, 0, 0,
0, 0, 10, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 9, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......@@ -185,7 +247,7 @@ const BYTE g_PS_ClearUint[] =
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0,
9, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
......
......@@ -35,10 +35,11 @@ call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBAUnmultiply2D ps_4_0_lev
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBPremultiply2D ps_4_0_level_9_3 compiled\passthroughrgbpremultiply2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBUnmultiply2D ps_4_0_level_9_3 compiled\passthroughrgbunmultiply2d11ps.h %debug%
call:BuildShader Clear11.hlsl VS_ClearFloat vs_4_0_level_9_3 compiled\clearfloat11vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearFloat_FL9 ps_4_0_level_9_3 compiled\clearfloat11_fl9ps.h %debug%
call:BuildShader Clear11.hlsl PS_ClearFloat ps_4_0 compiled\clearfloat11ps.h %debug%
call:BuildShader Clear11.hlsl VS_Clear_FL9 vs_4_0_level_9_3 compiled\clear11_fl9vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearFloat_FL9 ps_4_0_level_9_3 compiled\clearfloat11_fl9ps.h %debug%
call:BuildShader Clear11.hlsl VS_Clear vs_4_0 compiled\clear11vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearFloat ps_4_0 compiled\clearfloat11ps.h %debug%
:: Shaders for OpenGL ES 3.0+ only
:: | Input file | Entry point | Type | Output file | Debug |
......@@ -81,10 +82,7 @@ call:BuildShader Swizzle11.hlsl PS_SwizzleF2DArray ps_4_0 co
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%
......
......@@ -1879,7 +1879,7 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
const gl::FramebufferAttachment *colorBuffer,
const gl::FramebufferAttachment *depthStencilBuffer)
{
if (clearParams.colorClearType != GL_FLOAT)
if (clearParams.colorType != GL_FLOAT)
{
// Clearing buffers with non-float values is not supported by Renderer9 and ES 2.0
UNREACHABLE();
......@@ -1897,8 +1897,8 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
}
}
float depth = gl::clamp01(clearParams.depthClearValue);
DWORD stencil = clearParams.stencilClearValue & 0x000000FF;
float depth = gl::clamp01(clearParams.depthValue);
DWORD stencil = clearParams.stencilValue & 0x000000FF;
unsigned int stencilUnmasked = 0x0;
if (clearParams.clearStencil && depthStencilBuffer->getStencilSize() > 0)
......@@ -1944,16 +1944,16 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
color =
D3DCOLOR_ARGB(gl::unorm<8>((formatInfo.alphaBits == 0 && d3dFormatInfo.alphaBits > 0)
? 1.0f
: clearParams.colorFClearValue.alpha),
: clearParams.colorF.alpha),
gl::unorm<8>((formatInfo.redBits == 0 && d3dFormatInfo.redBits > 0)
? 0.0f
: clearParams.colorFClearValue.red),
: clearParams.colorF.red),
gl::unorm<8>((formatInfo.greenBits == 0 && d3dFormatInfo.greenBits > 0)
? 0.0f
: clearParams.colorFClearValue.green),
: clearParams.colorF.green),
gl::unorm<8>((formatInfo.blueBits == 0 && d3dFormatInfo.blueBits > 0)
? 0.0f
: clearParams.colorFClearValue.blue));
: clearParams.colorF.blue));
if ((formatInfo.redBits > 0 && !clearParams.colorMaskRed) ||
(formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) ||
......
......@@ -420,12 +420,12 @@
'libANGLE/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_ps_4i.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_ps_4ui.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11_fl9vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11_fl9ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough2d11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11gs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11vs.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