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,16 +38,16 @@ ClearParameters GetClearParameters(const gl::State &state, GLbitfield mask) ...@@ -38,16 +38,16 @@ ClearParameters GetClearParameters(const gl::State &state, GLbitfield mask)
{ {
clearParams.clearColor[i] = false; clearParams.clearColor[i] = false;
} }
clearParams.colorFClearValue = state.getColorClearValue(); clearParams.colorF = state.getColorClearValue();
clearParams.colorClearType = GL_FLOAT; clearParams.colorType = GL_FLOAT;
clearParams.colorMaskRed = blendState.colorMaskRed; clearParams.colorMaskRed = blendState.colorMaskRed;
clearParams.colorMaskGreen = blendState.colorMaskGreen; clearParams.colorMaskGreen = blendState.colorMaskGreen;
clearParams.colorMaskBlue = blendState.colorMaskBlue; clearParams.colorMaskBlue = blendState.colorMaskBlue;
clearParams.colorMaskAlpha = blendState.colorMaskAlpha; clearParams.colorMaskAlpha = blendState.colorMaskAlpha;
clearParams.clearDepth = false; clearParams.clearDepth = false;
clearParams.depthClearValue = state.getDepthClearValue(); clearParams.depthValue = state.getDepthClearValue();
clearParams.clearStencil = false; clearParams.clearStencil = false;
clearParams.stencilClearValue = state.getStencilClearValue(); clearParams.stencilValue = state.getStencilClearValue();
clearParams.stencilWriteMask = state.getDepthStencilState().stencilWritemask; clearParams.stencilWriteMask = state.getDepthStencilState().stencilWritemask;
clearParams.scissorEnabled = state.isScissorTestEnabled(); clearParams.scissorEnabled = state.isScissorTestEnabled();
clearParams.scissor = state.getScissor(); clearParams.scissor = state.getScissor();
...@@ -116,14 +116,14 @@ gl::Error FramebufferD3D::clearBufferfv(ContextImpl *context, ...@@ -116,14 +116,14 @@ gl::Error FramebufferD3D::clearBufferfv(ContextImpl *context,
{ {
clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i)); clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i));
} }
clearParams.colorFClearValue = gl::ColorF(values[0], values[1], values[2], values[3]); clearParams.colorF = gl::ColorF(values[0], values[1], values[2], values[3]);
clearParams.colorClearType = GL_FLOAT; clearParams.colorType = GL_FLOAT;
} }
if (buffer == GL_DEPTH) if (buffer == GL_DEPTH)
{ {
clearParams.clearDepth = true; clearParams.clearDepth = true;
clearParams.depthClearValue = values[0]; clearParams.depthValue = values[0];
} }
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
...@@ -140,8 +140,8 @@ gl::Error FramebufferD3D::clearBufferuiv(ContextImpl *context, ...@@ -140,8 +140,8 @@ gl::Error FramebufferD3D::clearBufferuiv(ContextImpl *context,
{ {
clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i)); clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i));
} }
clearParams.colorUIClearValue = gl::ColorUI(values[0], values[1], values[2], values[3]); clearParams.colorUI = gl::ColorUI(values[0], values[1], values[2], values[3]);
clearParams.colorClearType = GL_UNSIGNED_INT; clearParams.colorType = GL_UNSIGNED_INT;
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
} }
...@@ -160,14 +160,14 @@ gl::Error FramebufferD3D::clearBufferiv(ContextImpl *context, ...@@ -160,14 +160,14 @@ gl::Error FramebufferD3D::clearBufferiv(ContextImpl *context,
{ {
clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i)); clearParams.clearColor[i] = (drawbuffer == static_cast<int>(i));
} }
clearParams.colorIClearValue = gl::ColorI(values[0], values[1], values[2], values[3]); clearParams.colorI = gl::ColorI(values[0], values[1], values[2], values[3]);
clearParams.colorClearType = GL_INT; clearParams.colorType = GL_INT;
} }
if (buffer == GL_STENCIL) if (buffer == GL_STENCIL)
{ {
clearParams.clearStencil = true; clearParams.clearStencil = true;
clearParams.stencilClearValue = values[1]; clearParams.stencilValue = values[1];
} }
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
...@@ -182,9 +182,9 @@ gl::Error FramebufferD3D::clearBufferfi(ContextImpl *context, ...@@ -182,9 +182,9 @@ gl::Error FramebufferD3D::clearBufferfi(ContextImpl *context,
// glClearBufferfi can only be called to clear a depth stencil buffer // glClearBufferfi can only be called to clear a depth stencil buffer
ClearParameters clearParams = GetClearParameters(context->getGLState(), 0); ClearParameters clearParams = GetClearParameters(context->getGLState(), 0);
clearParams.clearDepth = true; clearParams.clearDepth = true;
clearParams.depthClearValue = depth; clearParams.depthValue = depth;
clearParams.clearStencil = true; clearParams.clearStencil = true;
clearParams.stencilClearValue = stencil; clearParams.stencilValue = stencil;
return clearImpl(context, clearParams); return clearImpl(context, clearParams);
} }
......
...@@ -34,20 +34,20 @@ class RenderTargetD3D; ...@@ -34,20 +34,20 @@ class RenderTargetD3D;
struct ClearParameters struct ClearParameters
{ {
bool clearColor[gl::IMPLEMENTATION_MAX_DRAW_BUFFERS]; bool clearColor[gl::IMPLEMENTATION_MAX_DRAW_BUFFERS];
gl::ColorF colorFClearValue; gl::ColorF colorF;
gl::ColorI colorIClearValue; gl::ColorI colorI;
gl::ColorUI colorUIClearValue; gl::ColorUI colorUI;
GLenum colorClearType; GLenum colorType;
bool colorMaskRed; bool colorMaskRed;
bool colorMaskGreen; bool colorMaskGreen;
bool colorMaskBlue; bool colorMaskBlue;
bool colorMaskAlpha; bool colorMaskAlpha;
bool clearDepth; bool clearDepth;
float depthClearValue; float depthValue;
bool clearStencil; bool clearStencil;
GLint stencilClearValue; GLint stencilValue;
GLuint stencilWriteMask; GLuint stencilWriteMask;
bool scissorEnabled; bool scissorEnabled;
......
...@@ -20,89 +20,209 @@ ...@@ -20,89 +20,209 @@
#include "third_party/trace_event/trace_event.h" #include "third_party/trace_event/trace_event.h"
// Precompiled shaders // Precompiled shaders
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11vs.h" #include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11_fl9vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.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/clearfloat11_fl9ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11vs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.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" #include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h"
namespace rx 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> 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 = bool cacheDirty = false;
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);
}
Clear11::ClearShader::ClearShader(DXGI_FORMAT colorType, if (numRtvs > 0)
const char *inputLayoutName, {
const BYTE *vsByteCode, const bool writeRGB = (writeMask & ~D3D11_COLOR_WRITE_ENABLE_ALPHA) != 0;
size_t vsSize, if (writeRGB && memcmp(&dataCache->r, &color.red, sizeof(T) * 3) != 0)
const char *vsDebugName, {
const BYTE *psByteCode, dataCache->r = color.red;
size_t psSize, dataCache->g = color.green;
const char *psDebugName) dataCache->b = color.blue;
: inputLayout(nullptr), cacheDirty = true;
vertexShader(vsByteCode, vsSize, vsDebugName), }
pixelShader(psByteCode, psSize, psDebugName)
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;
}
}
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); if (featureLevel <= D3D_FEATURE_LEVEL_9_3)
vertexShader.release(); {
pixelShader.release(); 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) Clear11::Clear11(Renderer11 *renderer)
: mRenderer(renderer), : mRenderer(renderer),
mFloatClearShader(nullptr), mScissorEnabledRasterizerState(nullptr),
mUintClearShader(nullptr), mScissorDisabledRasterizerState(nullptr),
mIntClearShader(nullptr) mShaderManager(),
mConstantBuffer(nullptr),
mVertexBuffer(nullptr),
mShaderData({})
{ {
TRACE_EVENT0("gpu.angle", "Clear11::Clear11"); TRACE_EVENT0("gpu.angle", "Clear11::Clear11");
HRESULT result; HRESULT result;
ID3D11Device *device = renderer->getDevice(); ID3D11Device *device = renderer->getDevice();
D3D11_BUFFER_DESC vbDesc; static_assert((sizeof(RtvDsvClearInfo<float>) == sizeof(RtvDsvClearInfo<int>)),
vbDesc.ByteWidth = g_VertexSize * 4; "Size of rx::RtvDsvClearInfo<float> is not equal to rx::RtvDsvClearInfo<int>");
vbDesc.Usage = D3D11_USAGE_DYNAMIC;
vbDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; static_assert(
vbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; (sizeof(RtvDsvClearInfo<float>) == sizeof(RtvDsvClearInfo<uint32_t>)),
vbDesc.MiscFlags = 0; "Size of rx::RtvDsvClearInfo<float> is not equal to rx::RtvDsvClearInfo<uint32_t>");
vbDesc.StructureByteStride = 0;
static_assert((sizeof(RtvDsvClearInfo<float>) % 16 == 0),
"The size of RtvDsvClearInfo<float> should be a multiple of 16bytes.");
result = device->CreateBuffer(&vbDesc, nullptr, mVertexBuffer.GetAddressOf()); // Create constant buffer for color & depth data
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(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)); ASSERT(SUCCEEDED(result));
d3d11::SetDebugName(mVertexBuffer, "Clear11 masked clear vertex buffer"); d3d11::SetDebugName(mVertexBuffer, "Clear11 Vertex Buffer");
}
// Create Rasterizer States
D3D11_RASTERIZER_DESC rsDesc; D3D11_RASTERIZER_DESC rsDesc;
rsDesc.FillMode = D3D11_FILL_SOLID; rsDesc.FillMode = D3D11_FILL_SOLID;
rsDesc.CullMode = D3D11_CULL_NONE; rsDesc.CullMode = D3D11_CULL_NONE;
...@@ -126,34 +246,7 @@ Clear11::Clear11(Renderer11 *renderer) ...@@ -126,34 +246,7 @@ Clear11::Clear11(Renderer11 *renderer)
d3d11::SetDebugName(mScissorEnabledRasterizerState, d3d11::SetDebugName(mScissorEnabledRasterizerState,
"Clear11 Rasterizer State with scissor enabled"); "Clear11 Rasterizer State with scissor enabled");
if (mRenderer->getRenderer11DeviceCaps().featureLevel <= D3D_FEATURE_LEVEL_9_3) // Initialize Depthstencil state with defaults
{
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
mDepthStencilStateKey.depthTest = false; mDepthStencilStateKey.depthTest = false;
mDepthStencilStateKey.depthMask = false; mDepthStencilStateKey.depthMask = false;
mDepthStencilStateKey.depthFunc = GL_ALWAYS; mDepthStencilStateKey.depthFunc = GL_ALWAYS;
...@@ -187,9 +280,6 @@ Clear11::Clear11(Renderer11 *renderer) ...@@ -187,9 +280,6 @@ Clear11::Clear11(Renderer11 *renderer)
Clear11::~Clear11() Clear11::~Clear11()
{ {
SafeDelete(mFloatClearShader);
SafeDelete(mUintClearShader);
SafeDelete(mIntClearShader);
} }
gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
...@@ -220,15 +310,20 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -220,15 +310,20 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
// If these conditions are met, and: // If these conditions are met, and:
// - No scissored clear is needed, then clear using ID3D11DeviceContext::ClearRenderTargetView. // - No scissored clear is needed, then clear using ID3D11DeviceContext::ClearRenderTargetView.
// - A scissored clear is needed then clear using ID3D11DeviceContext1::ClearView if available. // - 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 // Also determine if the DSV can be cleared withID3D11DeviceContext::ClearDepthStencilView by
// ID3D11DeviceContext::ClearDepthStencilView // checking if the stencil write mask covers the entire stencil.
// 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 // To clear the remaining buffers, a shader based clear is performed:
// color // - The appropriate ShaderManagers (VS & PS) for the clearType is set
// attribute. // - 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; gl::Extents framebufferSize;
...@@ -293,7 +388,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -293,7 +388,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
const gl::InternalFormat &formatInfo = *attachment.getFormat().info; const gl::InternalFormat &formatInfo = *attachment.getFormat().info;
if (clearParams.colorClearType == GL_FLOAT && if (clearParams.colorType == GL_FLOAT &&
!(formatInfo.componentType == GL_FLOAT || !(formatInfo.componentType == GL_FLOAT ||
formatInfo.componentType == GL_UNSIGNED_NORMALIZED || formatInfo.componentType == GL_UNSIGNED_NORMALIZED ||
formatInfo.componentType == GL_SIGNED_NORMALIZED)) formatInfo.componentType == GL_SIGNED_NORMALIZED))
...@@ -322,7 +417,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -322,7 +417,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
} }
if ((!(mRenderer->getRenderer11DeviceCaps().supportsClearView) && needScissoredClear) || if ((!(mRenderer->getRenderer11DeviceCaps().supportsClearView) && needScissoredClear) ||
clearParams.colorClearType != GL_FLOAT || clearParams.colorType != GL_FLOAT ||
(formatInfo.redBits > 0 && !clearParams.colorMaskRed) || (formatInfo.redBits > 0 && !clearParams.colorMaskRed) ||
(formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) || (formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) ||
(formatInfo.blueBits > 0 && !clearParams.colorMaskBlue) || (formatInfo.blueBits > 0 && !clearParams.colorMaskBlue) ||
...@@ -344,16 +439,16 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -344,16 +439,16 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
float clearValues[4] = { float clearValues[4] = {
((formatInfo.redBits == 0 && nativeFormat.redBits > 0) ((formatInfo.redBits == 0 && nativeFormat.redBits > 0)
? 0.0f ? 0.0f
: clearParams.colorFClearValue.red), : clearParams.colorF.red),
((formatInfo.greenBits == 0 && nativeFormat.greenBits > 0) ((formatInfo.greenBits == 0 && nativeFormat.greenBits > 0)
? 0.0f ? 0.0f
: clearParams.colorFClearValue.green), : clearParams.colorF.green),
((formatInfo.blueBits == 0 && nativeFormat.blueBits > 0) ((formatInfo.blueBits == 0 && nativeFormat.blueBits > 0)
? 0.0f ? 0.0f
: clearParams.colorFClearValue.blue), : clearParams.colorF.blue),
((formatInfo.alphaBits == 0 && nativeFormat.alphaBits > 0) ((formatInfo.alphaBits == 0 && nativeFormat.alphaBits > 0)
? 1.0f ? 1.0f
: clearParams.colorFClearValue.alpha), : clearParams.colorF.alpha),
}; };
if (formatInfo.alphaBits == 1) if (formatInfo.alphaBits == 1)
...@@ -361,7 +456,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -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 // 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 // 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. // 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) if (needScissoredClear)
...@@ -421,8 +516,8 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -421,8 +516,8 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
{ {
const UINT clearFlags = (clearParams.clearDepth ? D3D11_CLEAR_DEPTH : 0) | const UINT clearFlags = (clearParams.clearDepth ? D3D11_CLEAR_DEPTH : 0) |
(clearParams.clearStencil ? D3D11_CLEAR_STENCIL : 0); (clearParams.clearStencil ? D3D11_CLEAR_STENCIL : 0);
const FLOAT depthClear = gl::clamp01(clearParams.depthClearValue); const FLOAT depthClear = gl::clamp01(clearParams.depthValue);
const UINT8 stencilClear = clearParams.stencilClearValue & 0xFF; const UINT8 stencilClear = clearParams.stencilValue & 0xFF;
deviceContext->ClearDepthStencilView(dsv, clearFlags, depthClear, stencilClear); deviceContext->ClearDepthStencilView(dsv, clearFlags, depthClear, stencilClear);
...@@ -430,21 +525,29 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -430,21 +525,29 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
} }
} }
if (numRtvs == 0 && !dsv) if (numRtvs == 0 && dsv == nullptr)
{ {
return gl::NoError(); 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.
//
// 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.
// //
// Render a quad clipped to the scissor rectangle which draws the clear color and a blend // DepthStencilTest: DepthTesting, DepthWrites, StencilMask and StencilWrites will be enabled or
// state that will perform the required color masking. // 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 quad's depth is equal to the depth clear value with a depth stencil state that // PS: Will write out the color values passed through from the previous stage to all outputs.
// will enable or disable depth test/writes if the depth buffer should be cleared or not.
// //
// The rasterizer state's stencil is set to always pass or fail based on if the stencil // OM: BlendState will perform the required color masking and output to RTV(s).
// should be cleared or not with a stencil write mask of the stencil clear value.
// //
// ====================================================================================== // ======================================================================================
// //
...@@ -477,7 +580,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -477,7 +580,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
ANGLE_TRY(mRenderer->getStateCache().getBlendState(mBlendStateKey, &blendState)); ANGLE_TRY(mRenderer->getStateCache().getBlendState(mBlendStateKey, &blendState));
} }
const UINT stencilValue = clearParams.stencilClearValue & 0xFF; const UINT stencilValue = clearParams.stencilValue & 0xFF;
ID3D11DepthStencilState *dsState = nullptr; ID3D11DepthStencilState *dsState = nullptr;
const float *zValue = nullptr; const float *zValue = nullptr;
...@@ -491,45 +594,46 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -491,45 +594,46 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
// Get DepthStencilState // Get DepthStencilState
ANGLE_TRY(mRenderer->getStateCache().getDepthStencilState(mDepthStencilStateKey, &dsState)); ANGLE_TRY(mRenderer->getStateCache().getDepthStencilState(mDepthStencilStateKey, &dsState));
zValue = clearParams.clearDepth ? &clearParams.depthClearValue : nullptr; zValue = clearParams.clearDepth ? &clearParams.depthValue : nullptr;
} }
// Set the vertices bool dirtyCb = false;
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;
}
switch (clearParams.colorClearType) // Compare the input color/z values against the CB cache and update it if necessary
switch (clearParams.colorType)
{ {
case GL_FLOAT: case GL_FLOAT:
ApplyVertices(clearParams.colorFClearValue, clearParams.depthClearValue, dirtyCb = UpdateDataCache(reinterpret_cast<RtvDsvClearInfo<float> *>(&mShaderData),
mappedResource.pData); clearParams.colorF, zValue, numRtvs, colorMask);
shader = mFloatClearShader;
break; break;
case GL_UNSIGNED_INT: case GL_UNSIGNED_INT:
ApplyVertices(clearParams.colorUIClearValue, clearParams.depthClearValue, dirtyCb = UpdateDataCache(reinterpret_cast<RtvDsvClearInfo<uint32_t> *>(&mShaderData),
mappedResource.pData); clearParams.colorUI, zValue, numRtvs, colorMask);
shader = mUintClearShader;
break; break;
case GL_INT: case GL_INT:
ApplyVertices(clearParams.colorIClearValue, clearParams.depthClearValue, dirtyCb = UpdateDataCache(reinterpret_cast<RtvDsvClearInfo<int> *>(&mShaderData),
mappedResource.pData); clearParams.colorI, zValue, numRtvs, colorMask);
shader = mIntClearShader;
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
break; 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 // Set the viewport to be the same size as the framebuffer
D3D11_VIEWPORT viewport; D3D11_VIEWPORT viewport;
...@@ -557,23 +661,43 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, ...@@ -557,23 +661,43 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
deviceContext->RSSetState(mScissorDisabledRasterizerState.Get()); deviceContext->RSSetState(mScissorDisabledRasterizerState.Get());
} }
// Apply shaders // Get Shaders
const D3D_FEATURE_LEVEL fl = mRenderer->getRenderer11DeviceCaps().featureLevel;
ID3D11Device *device = mRenderer->getDevice(); ID3D11Device *device = mRenderer->getDevice();
deviceContext->IASetInputLayout(shader->inputLayout->resolve(device)); ID3D11VertexShader *vs;
deviceContext->VSSetShader(shader->vertexShader.resolve(device), nullptr, 0); ID3D11InputLayout *il;
deviceContext->PSSetShader(shader->pixelShader.resolve(device), nullptr, 0); ID3D11PixelShader *ps;
mShaderManager.getShadersAndLayout(device, fl, clearParams.colorType, &il, &vs, &ps);
// Apply Shaders
deviceContext->VSSetShader(vs, nullptr, 0);
deviceContext->GSSetShader(nullptr, 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);
// Apply vertex buffer if (mVertexBuffer.Get())
{
const UINT offset = 0; const UINT offset = 0;
deviceContext->IASetVertexBuffers(0, 1, mVertexBuffer.GetAddressOf(), &g_VertexSize, &offset); deviceContext->IASetVertexBuffers(0, 1, mVertexBuffer.GetAddressOf(), &g_VertexSize,
deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); &offset);
}
else
{
deviceContext->IASetVertexBuffers(0, 0, nullptr, nullptr, nullptr);
}
deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
// Apply render targets // Apply render targets
mRenderer->getStateManager()->setOneTimeRenderTargets(&rtvs[0], numRtvs, dsv); mRenderer->getStateManager()->setOneTimeRenderTargets(&rtvs[0], numRtvs, dsv);
// Draw the clear quad // Draw the fullscreen quad
deviceContext->Draw(4, 0); deviceContext->Draw(6, 0);
// Clean up // Clean up
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty();
......
...@@ -23,6 +23,14 @@ class Renderer11; ...@@ -23,6 +23,14 @@ class Renderer11;
class RenderTarget11; class RenderTarget11;
struct ClearParameters; struct ClearParameters;
template <typename T>
struct RtvDsvClearInfo
{
T r, g, b, a;
float z;
float c1padding[3];
};
class Clear11 : angle::NonCopyable class Clear11 : angle::NonCopyable
{ {
public: public:
...@@ -34,33 +42,28 @@ class Clear11 : angle::NonCopyable ...@@ -34,33 +42,28 @@ class Clear11 : angle::NonCopyable
const gl::FramebufferState &fboData); const gl::FramebufferState &fboData);
private: private:
struct MaskedRenderTarget class ShaderManager final : public angle::NonCopyable
{ {
bool colorMask[4]; public:
RenderTarget11 *renderTarget; ShaderManager();
}; ~ShaderManager();
void getShadersAndLayout(ID3D11Device *device,
ID3D11BlendState *getBlendState(const std::vector<MaskedRenderTarget> &rts); D3D_FEATURE_LEVEL featureLevel,
ID3D11DepthStencilState *getDepthStencilState(const ClearParameters &clearParams); const INT clearType,
ID3D11InputLayout **il,
ID3D11VertexShader **vs,
ID3D11PixelShader **ps);
struct ClearShader final : public angle::NonCopyable private:
{ angle::ComPtr<ID3D11InputLayout> mIl9;
ClearShader(DXGI_FORMAT colorType, d3d11::LazyShader<ID3D11VertexShader> mVs9;
const char *inputLayoutName, d3d11::LazyShader<ID3D11PixelShader> mPsFloat9;
const BYTE *vsByteCode, d3d11::LazyShader<ID3D11VertexShader> mVs;
size_t vsSize, d3d11::LazyShader<ID3D11PixelShader> mPsFloat;
const char *vsDebugName, d3d11::LazyShader<ID3D11PixelShader> mPsUInt;
const BYTE *psByteCode, d3d11::LazyShader<ID3D11PixelShader> mPsSInt;
size_t psSize,
const char *psDebugName);
~ClearShader();
d3d11::LazyInputLayout *inputLayout;
d3d11::LazyShader<ID3D11VertexShader> vertexShader;
d3d11::LazyShader<ID3D11PixelShader> pixelShader;
}; };
Renderer11 *mRenderer; Renderer11 *mRenderer;
// States // States
...@@ -69,11 +72,13 @@ class Clear11 : angle::NonCopyable ...@@ -69,11 +72,13 @@ class Clear11 : angle::NonCopyable
gl::DepthStencilState mDepthStencilStateKey; gl::DepthStencilState mDepthStencilStateKey;
d3d11::BlendStateKey mBlendStateKey; d3d11::BlendStateKey mBlendStateKey;
// Shaders and Shader Resources // Shaders and shader resources
ClearShader *mFloatClearShader; ShaderManager mShaderManager;
ClearShader *mUintClearShader; angle::ComPtr<ID3D11Buffer> mConstantBuffer;
ClearShader *mIntClearShader;
angle::ComPtr<ID3D11Buffer> mVertexBuffer; angle::ComPtr<ID3D11Buffer> mVertexBuffer;
// Buffer data and draw parameters
RtvDsvClearInfo<float> mShaderData;
}; };
} }
......
...@@ -1920,14 +1920,17 @@ LazyInputLayout::LazyInputLayout(const D3D11_INPUT_ELEMENT_DESC *inputDesc, ...@@ -1920,14 +1920,17 @@ LazyInputLayout::LazyInputLayout(const D3D11_INPUT_ELEMENT_DESC *inputDesc,
mByteCode(byteCode), mByteCode(byteCode),
mDebugName(debugName) mDebugName(debugName)
{ {
if (inputDesc)
{
memcpy(&mInputDesc[0], inputDesc, sizeof(D3D11_INPUT_ELEMENT_DESC) * inputDescLen); memcpy(&mInputDesc[0], inputDesc, sizeof(D3D11_INPUT_ELEMENT_DESC) * inputDescLen);
}
} }
ID3D11InputLayout *LazyInputLayout::resolve(ID3D11Device *device) ID3D11InputLayout *LazyInputLayout::resolve(ID3D11Device *device)
{ {
checkAssociatedDevice(device); checkAssociatedDevice(device);
if (mResource == nullptr) if (mResource == nullptr && mByteCode != nullptr)
{ {
HRESULT result = HRESULT result =
device->CreateInputLayout(&mInputDesc[0], static_cast<UINT>(mInputDesc.size()), device->CreateInputLayout(&mInputDesc[0], static_cast<UINT>(mInputDesc.size()),
......
...@@ -114,26 +114,11 @@ struct PositionLayerTexCoord3DVertex ...@@ -114,26 +114,11 @@ struct PositionLayerTexCoord3DVertex
void SetPositionLayerTexCoord3DVertex(PositionLayerTexCoord3DVertex* vertex, float x, float y, void SetPositionLayerTexCoord3DVertex(PositionLayerTexCoord3DVertex* vertex, float x, float y,
unsigned int layer, float u, float v, float s); unsigned int layer, float u, float v, float s);
template <typename T> struct PositionVertex
struct PositionDepthColorVertex
{ {
float x, y, z; float x, y, z, w;
T r, g, b, a;
}; };
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 struct BlendStateKey
{ {
gl::BlendState blendState; 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, // Clear11.hlsl: Shaders for clearing RTVs and DSVs using draw calls and
out float4 outPosition : SV_POSITION, out float4 outColor : COLOR) // 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); float2 corner = g_Corners[id];
outColor = inColor; 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; outPosition = inPosition;
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;
};
PS_OutputFloat PS_ClearFloat(in float4 inPosition : SV_POSITION, in float4 inColor : COLOR) // Pixel Shader Constant Buffers
cbuffer ColorAndDepthDataFloat : register(b0)
{ {
PS_OutputFloat outColor; float4 color_Float : packoffset(c0);
outColor.color0 = inColor; float zValueF_Float : packoffset(c1);
outColor.color1 = inColor;
outColor.color2 = inColor;
outColor.color3 = inColor;
outColor.color4 = inColor;
outColor.color5 = inColor;
outColor.color6 = inColor;
outColor.color7 = inColor;
return outColor;
} }
cbuffer ColorAndDepthDataSint : register(b0)
{
int4 color_Sint : packoffset(c0);
float zValueF_Sint : packoffset(c1);
}
cbuffer ColorAndDepthDataUint : register(b0)
{
uint4 color_Uint : packoffset(c0);
float zValueF_Uint : packoffset(c1);
}
// Pixel Shader Output Structs
struct PS_OutputFloat_FL9 struct PS_OutputFloat_FL9
{ {
float4 color0 : SV_TARGET0; float4 color0 : SV_TARGET0;
float4 color1 : SV_TARGET1; float4 color1 : SV_TARGET1;
float4 color2 : SV_TARGET2; float4 color2 : SV_TARGET2;
float4 color3 : SV_TARGET3; float4 color3 : SV_TARGET3;
float depth : SV_DEPTH;
}; };
PS_OutputFloat_FL9 PS_ClearFloat_FL9(in float4 inPosition : SV_POSITION, in float4 inColor : COLOR) struct PS_OutputFloat
{
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)
{ {
outPosition = float4(inPosition, 1.0f); float4 color0 : SV_TARGET0;
outColor = inColor; 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 struct PS_OutputUint
{ {
...@@ -68,30 +88,9 @@ struct PS_OutputUint ...@@ -68,30 +88,9 @@ struct PS_OutputUint
uint4 color5 : SV_TARGET5; uint4 color5 : SV_TARGET5;
uint4 color6 : SV_TARGET6; uint4 color6 : SV_TARGET6;
uint4 color7 : SV_TARGET7; 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 struct PS_OutputSint
{ {
int4 color0 : SV_TARGET0; int4 color0 : SV_TARGET0;
...@@ -102,18 +101,62 @@ struct PS_OutputSint ...@@ -102,18 +101,62 @@ struct PS_OutputSint
int4 color5 : SV_TARGET5; int4 color5 : SV_TARGET5;
int4 color6 : SV_TARGET6; int4 color6 : SV_TARGET6;
int4 color7 : SV_TARGET7; 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_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 outColor; PS_OutputSint outData;
outColor.color0 = inColor; outData.color0 = color_Sint;
outColor.color1 = inColor; outData.color1 = color_Sint;
outColor.color2 = inColor; outData.color2 = color_Sint;
outColor.color3 = inColor; outData.color3 = color_Sint;
outColor.color4 = inColor; outData.color4 = color_Sint;
outColor.color5 = inColor; outData.color5 = color_Sint;
outColor.color6 = inColor; outData.color6 = color_Sint;
outColor.color7 = inColor; outData.color7 = color_Sint;
return outColor; 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 @@ ...@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 // 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: // Input signature:
// //
// Name Index Mask Register SysValue Format Used // Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------ // -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float // SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE float xyzw
// //
// //
// Output signature: // Output signature:
...@@ -20,91 +37,111 @@ ...@@ -20,91 +37,111 @@
// SV_TARGET 1 xyzw 1 TARGET float xyzw // SV_TARGET 1 xyzw 1 TARGET float xyzw
// SV_TARGET 2 xyzw 2 TARGET float xyzw // SV_TARGET 2 xyzw 2 TARGET float xyzw
// SV_TARGET 3 xyzw 3 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: // Level9 shader bytecode:
// //
ps_2_x ps_2_x
dcl t0 mov oC0, c0
mov oC0, t0 mov oC1, c0
mov oC1, t0 mov oC2, c0
mov oC2, t0 mov oC3, c0
mov oC3, t0 mov oDepth, c1.x
// approximately 4 instruction slots used // approximately 5 instruction slots used
ps_4_0 ps_4_0
dcl_input_ps linear v1.xyzw dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw dcl_output o0.xyzw
dcl_output o1.xyzw dcl_output o1.xyzw
dcl_output o2.xyzw dcl_output o2.xyzw
dcl_output o3.xyzw dcl_output o3.xyzw
mov o0.xyzw, v1.xyzw dcl_output oDepth
mov o1.xyzw, v1.xyzw mov o0.xyzw, cb0[0].xyzw
mov o2.xyzw, v1.xyzw mov o1.xyzw, cb0[0].xyzw
mov o3.xyzw, v1.xyzw mov o2.xyzw, cb0[0].xyzw
mov o3.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret ret
// Approximately 5 instruction slots used // Approximately 6 instruction slots used
#endif #endif
const BYTE g_PS_ClearFloat_FL9[] = const BYTE g_PS_ClearFloat_FL9[] =
{ {
68, 88, 66, 67, 36, 167, 68, 88, 66, 67, 50, 112,
59, 21, 253, 46, 206, 132, 200, 244, 43, 179, 42, 60,
254, 28, 18, 118, 51, 115, 1, 54, 148, 142, 159, 31,
45, 31, 1, 0, 0, 0, 160, 168, 1, 0, 0, 0,
236, 2, 0, 0, 6, 0, 228, 3, 0, 0, 6, 0,
0, 0, 56, 0, 0, 0, 0, 0, 56, 0, 0, 0,
168, 0, 0, 0, 72, 1, 180, 0, 0, 0, 132, 1,
0, 0, 196, 1, 0, 0, 0, 0, 0, 2, 0, 0,
28, 2, 0, 0, 112, 2, 20, 3, 0, 0, 72, 3,
0, 0, 65, 111, 110, 57, 0, 0, 65, 111, 110, 57,
104, 0, 0, 0, 104, 0, 116, 0, 0, 0, 116, 0,
0, 0, 0, 2, 255, 255, 0, 0, 0, 2, 255, 255,
68, 0, 0, 0, 36, 0, 68, 0, 0, 0, 48, 0,
0, 0, 0, 0, 36, 0, 0, 0, 1, 0, 36, 0,
0, 0, 36, 0, 0, 0, 0, 0, 48, 0, 0, 0,
36, 0, 0, 0, 36, 0, 48, 0, 0, 0, 36, 0,
0, 0, 36, 0, 1, 2, 0, 0, 48, 0, 0, 0,
255, 255, 31, 0, 0, 2, 0, 0, 2, 0, 0, 0,
0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 1, 2,
15, 176, 1, 0, 0, 2, 255, 255, 1, 0, 0, 2,
0, 8, 15, 128, 0, 0, 0, 8, 15, 128, 0, 0,
228, 176, 1, 0, 0, 2, 228, 160, 1, 0, 0, 2,
1, 8, 15, 128, 0, 0, 1, 8, 15, 128, 0, 0,
228, 176, 1, 0, 0, 2, 228, 160, 1, 0, 0, 2,
2, 8, 15, 128, 0, 0, 2, 8, 15, 128, 0, 0,
228, 176, 1, 0, 0, 2, 228, 160, 1, 0, 0, 2,
3, 8, 15, 128, 0, 0, 3, 8, 15, 128, 0, 0,
228, 176, 255, 255, 0, 0, 228, 160, 1, 0, 0, 2,
83, 72, 68, 82, 152, 0, 0, 8, 15, 144, 1, 0,
0, 160, 255, 255, 0, 0,
83, 72, 68, 82, 200, 0,
0, 0, 64, 0, 0, 0, 0, 0, 64, 0, 0, 0,
38, 0, 0, 0, 98, 16, 50, 0, 0, 0, 89, 0,
0, 3, 242, 16, 16, 0, 0, 4, 70, 142, 32, 0,
1, 0, 0, 0, 101, 0, 0, 0, 0, 0, 2, 0,
0, 3, 242, 32, 16, 0, 0, 0, 101, 0, 0, 3,
0, 0, 0, 0, 101, 0, 242, 32, 16, 0, 0, 0,
0, 3, 242, 32, 16, 0, 0, 0, 101, 0, 0, 3,
1, 0, 0, 0, 101, 0, 242, 32, 16, 0, 1, 0,
0, 3, 242, 32, 16, 0, 0, 0, 101, 0, 0, 3,
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,
242, 32, 16, 0, 2, 0, 242, 32, 16, 0, 2, 0,
0, 0, 70, 30, 16, 0, 0, 0, 101, 0, 0, 3,
1, 0, 0, 0, 54, 0, 242, 32, 16, 0, 3, 0,
0, 5, 242, 32, 16, 0, 0, 0, 101, 0, 0, 2,
3, 0, 0, 0, 70, 30, 1, 192, 0, 0, 54, 0,
16, 0, 1, 0, 0, 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, 62, 0, 0, 1, 83, 84,
65, 84, 116, 0, 0, 0, 65, 84, 116, 0, 0, 0,
5, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
...@@ -116,7 +153,7 @@ const BYTE g_PS_ClearFloat_FL9[] = ...@@ -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, 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, 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[] = ...@@ -124,53 +161,84 @@ 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, 0, 0,
0, 0, 82, 68, 69, 70, 0, 0, 82, 68, 69, 70,
80, 0, 0, 0, 0, 0, 12, 1, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 84, 0, 0, 0,
0, 0, 0, 0, 28, 0, 1, 0, 0, 0, 28, 0,
0, 0, 0, 4, 255, 255, 0, 0, 0, 4, 255, 255,
0, 1, 0, 0, 28, 0, 0, 1, 0, 0, 216, 0,
0, 0, 77, 105, 99, 114, 0, 0, 60, 0, 0, 0,
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, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 68, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
15, 15, 0, 0, 83, 86, 1, 0, 0, 0, 67, 111,
95, 80, 79, 83, 73, 84, 108, 111, 114, 65, 110, 100,
73, 79, 78, 0, 67, 79, 68, 101, 112, 116, 104, 68,
76, 79, 82, 0, 171, 171, 97, 116, 97, 70, 108, 111,
79, 83, 71, 78, 116, 0, 97, 116, 0, 171, 60, 0,
0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 0, 0,
8, 0, 0, 0, 104, 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, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 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, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 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, 2, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 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, 3, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0,
0, 0, 3, 0, 0, 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, 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 @@ ...@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 // 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: // Input signature:
// //
// Name Index Mask Register SysValue Format Used // Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------ // -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float // SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE float xyzw
// //
// //
// Output signature: // Output signature:
...@@ -24,9 +41,10 @@ ...@@ -24,9 +41,10 @@
// SV_TARGET 5 xyzw 5 TARGET float xyzw // SV_TARGET 5 xyzw 5 TARGET float xyzw
// SV_TARGET 6 xyzw 6 TARGET float xyzw // SV_TARGET 6 xyzw 6 TARGET float xyzw
// SV_TARGET 7 xyzw 7 TARGET float xyzw // SV_TARGET 7 xyzw 7 TARGET float xyzw
// SV_DEPTH 0 N/A oDepth DEPTH float YES
// //
ps_4_0 ps_4_0
dcl_input_ps linear v1.xyzw dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw dcl_output o0.xyzw
dcl_output o1.xyzw dcl_output o1.xyzw
dcl_output o2.xyzw dcl_output o2.xyzw
...@@ -35,99 +53,133 @@ dcl_output o4.xyzw ...@@ -35,99 +53,133 @@ dcl_output o4.xyzw
dcl_output o5.xyzw dcl_output o5.xyzw
dcl_output o6.xyzw dcl_output o6.xyzw
dcl_output o7.xyzw dcl_output o7.xyzw
mov o0.xyzw, v1.xyzw dcl_output oDepth
mov o1.xyzw, v1.xyzw mov o0.xyzw, cb0[0].xyzw
mov o2.xyzw, v1.xyzw mov o1.xyzw, cb0[0].xyzw
mov o3.xyzw, v1.xyzw mov o2.xyzw, cb0[0].xyzw
mov o4.xyzw, v1.xyzw mov o3.xyzw, cb0[0].xyzw
mov o5.xyzw, v1.xyzw mov o4.xyzw, cb0[0].xyzw
mov o6.xyzw, v1.xyzw mov o5.xyzw, cb0[0].xyzw
mov o7.xyzw, v1.xyzw mov o6.xyzw, cb0[0].xyzw
mov o7.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret ret
// Approximately 9 instruction slots used // Approximately 10 instruction slots used
#endif #endif
const BYTE g_PS_ClearFloat[] = const BYTE g_PS_ClearFloat[] =
{ {
68, 88, 66, 67, 19, 30, 68, 88, 66, 67, 0, 45,
102, 69, 166, 219, 165, 14, 15, 86, 227, 217, 47, 173,
173, 41, 171, 133, 144, 58, 72, 182, 197, 224, 178, 165,
14, 224, 1, 0, 0, 0, 77, 73, 1, 0, 0, 0,
88, 3, 0, 0, 5, 0, 84, 4, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0, 0, 0, 52, 0, 0, 0,
140, 0, 0, 0, 224, 0, 72, 1, 0, 0, 124, 1,
0, 0, 188, 1, 0, 0, 0, 0, 120, 2, 0, 0,
220, 2, 0, 0, 82, 68, 216, 3, 0, 0, 82, 68,
69, 70, 80, 0, 0, 0, 69, 70, 12, 1, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 84, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
28, 0, 0, 0, 0, 4, 28, 0, 0, 0, 0, 4,
255, 255, 0, 1, 0, 0, 255, 255, 0, 1, 0, 0,
28, 0, 0, 0, 77, 105, 216, 0, 0, 0, 60, 0,
99, 114, 111, 115, 111, 102, 0, 0, 0, 0, 0, 0,
116, 32, 40, 82, 41, 32, 0, 0, 0, 0, 0, 0,
72, 76, 83, 76, 32, 83, 0, 0, 0, 0, 0, 0,
104, 97, 100, 101, 114, 32, 0, 0, 0, 0, 1, 0,
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,
0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0, 67, 111, 108, 111, 114, 65,
0, 0, 15, 0, 0, 0, 110, 100, 68, 101, 112, 116,
68, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0, 156, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0, 0, 0, 16, 0, 0, 0,
83, 86, 95, 80, 79, 83, 2, 0, 0, 0, 168, 0,
73, 84, 73, 79, 78, 0, 0, 0, 0, 0, 0, 0,
67, 79, 76, 79, 82, 0, 184, 0, 0, 0, 16, 0,
171, 171, 79, 83, 71, 78, 0, 0, 4, 0, 0, 0,
212, 0, 0, 0, 8, 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, 0, 0, 8, 0, 0, 0,
200, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
0, 0, 15, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0, 3, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0, 3, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 3, 0, 3, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 4, 0, 3, 0, 0, 0, 4, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 5, 0, 3, 0, 0, 0, 5, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 6, 0, 3, 0, 0, 0, 6, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 7, 0, 3, 0, 0, 0, 7, 0,
0, 0, 15, 0, 0, 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, 83, 86, 95, 84, 65, 82,
71, 69, 84, 0, 171, 171, 71, 69, 84, 0, 83, 86,
83, 72, 68, 82, 24, 1, 95, 68, 69, 80, 84, 72,
0, 0, 64, 0, 0, 0, 0, 171, 83, 72, 68, 82,
70, 0, 0, 0, 98, 16, 88, 1, 0, 0, 64, 0,
0, 3, 242, 16, 16, 0, 0, 0, 86, 0, 0, 0,
1, 0, 0, 0, 101, 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, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
...@@ -143,36 +195,46 @@ const BYTE g_PS_ClearFloat[] = ...@@ -143,36 +195,46 @@ const BYTE g_PS_ClearFloat[] =
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
6, 0, 0, 0, 101, 0, 6, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
7, 0, 0, 0, 54, 0, 7, 0, 0, 0, 101, 0,
0, 5, 242, 32, 16, 0, 0, 2, 1, 192, 0, 0,
0, 0, 0, 0, 70, 30, 54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0, 16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 242, 32, 70, 142, 32, 0, 0, 0,
16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
70, 30, 16, 0, 1, 0, 54, 0, 0, 6, 242, 32,
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,
16, 0, 1, 0, 0, 0, 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, 16, 0, 4, 0, 0, 0,
70, 30, 16, 0, 1, 0, 70, 142, 32, 0, 0, 0,
0, 0, 54, 0, 0, 5, 0, 0, 0, 0, 0, 0,
242, 32, 16, 0, 5, 0, 54, 0, 0, 6, 242, 32,
0, 0, 70, 30, 16, 0, 16, 0, 5, 0, 0, 0,
1, 0, 0, 0, 54, 0, 70, 142, 32, 0, 0, 0,
0, 5, 242, 32, 16, 0, 0, 0, 0, 0, 0, 0,
6, 0, 0, 0, 70, 30, 54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0, 16, 0, 6, 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, 7, 0, 0, 0, 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, 0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0, 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, 0, 0, 0, 0,
0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
...@@ -185,7 +247,7 @@ const BYTE g_PS_ClearFloat[] = ...@@ -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, 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, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
......
...@@ -3,13 +3,30 @@ ...@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 // 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: // Input signature:
// //
// Name Index Mask Register SysValue Format Used // Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------ // -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float // SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE int xyzw
// //
// //
// Output signature: // Output signature:
...@@ -24,9 +41,10 @@ ...@@ -24,9 +41,10 @@
// SV_TARGET 5 xyzw 5 TARGET int xyzw // SV_TARGET 5 xyzw 5 TARGET int xyzw
// SV_TARGET 6 xyzw 6 TARGET int xyzw // SV_TARGET 6 xyzw 6 TARGET int xyzw
// SV_TARGET 7 xyzw 7 TARGET int xyzw // SV_TARGET 7 xyzw 7 TARGET int xyzw
// SV_DEPTH 0 N/A oDepth DEPTH float YES
// //
ps_4_0 ps_4_0
dcl_input_ps constant v1.xyzw dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw dcl_output o0.xyzw
dcl_output o1.xyzw dcl_output o1.xyzw
dcl_output o2.xyzw dcl_output o2.xyzw
...@@ -35,99 +53,133 @@ dcl_output o4.xyzw ...@@ -35,99 +53,133 @@ dcl_output o4.xyzw
dcl_output o5.xyzw dcl_output o5.xyzw
dcl_output o6.xyzw dcl_output o6.xyzw
dcl_output o7.xyzw dcl_output o7.xyzw
mov o0.xyzw, v1.xyzw dcl_output oDepth
mov o1.xyzw, v1.xyzw mov o0.xyzw, cb0[0].xyzw
mov o2.xyzw, v1.xyzw mov o1.xyzw, cb0[0].xyzw
mov o3.xyzw, v1.xyzw mov o2.xyzw, cb0[0].xyzw
mov o4.xyzw, v1.xyzw mov o3.xyzw, cb0[0].xyzw
mov o5.xyzw, v1.xyzw mov o4.xyzw, cb0[0].xyzw
mov o6.xyzw, v1.xyzw mov o5.xyzw, cb0[0].xyzw
mov o7.xyzw, v1.xyzw mov o6.xyzw, cb0[0].xyzw
mov o7.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret ret
// Approximately 9 instruction slots used // Approximately 10 instruction slots used
#endif #endif
const BYTE g_PS_ClearSint[] = const BYTE g_PS_ClearSint[] =
{ {
68, 88, 66, 67, 206, 129, 68, 88, 66, 67, 40, 80,
255, 236, 115, 217, 216, 20, 87, 20, 166, 137, 87, 18,
88, 47, 155, 195, 145, 179, 79, 10, 71, 118, 4, 27,
183, 28, 1, 0, 0, 0, 31, 113, 1, 0, 0, 0,
88, 3, 0, 0, 5, 0, 84, 4, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0, 0, 0, 52, 0, 0, 0,
140, 0, 0, 0, 224, 0, 72, 1, 0, 0, 124, 1,
0, 0, 188, 1, 0, 0, 0, 0, 120, 2, 0, 0,
220, 2, 0, 0, 82, 68, 216, 3, 0, 0, 82, 68,
69, 70, 80, 0, 0, 0, 69, 70, 12, 1, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 84, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
28, 0, 0, 0, 0, 4, 28, 0, 0, 0, 0, 4,
255, 255, 0, 1, 0, 0, 255, 255, 0, 1, 0, 0,
28, 0, 0, 0, 77, 105, 216, 0, 0, 0, 60, 0,
99, 114, 111, 115, 111, 102, 0, 0, 0, 0, 0, 0,
116, 32, 40, 82, 41, 32, 0, 0, 0, 0, 0, 0,
72, 76, 83, 76, 32, 83, 0, 0, 0, 0, 0, 0,
104, 97, 100, 101, 114, 32, 0, 0, 0, 0, 1, 0,
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,
0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0, 67, 111, 108, 111, 114, 65,
0, 0, 15, 0, 0, 0, 110, 100, 68, 101, 112, 116,
68, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 1, 0, 156, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0, 0, 0, 16, 0, 0, 0,
83, 86, 95, 80, 79, 83, 2, 0, 0, 0, 168, 0,
73, 84, 73, 79, 78, 0, 0, 0, 0, 0, 0, 0,
67, 79, 76, 79, 82, 0, 184, 0, 0, 0, 16, 0,
171, 171, 79, 83, 71, 78, 0, 0, 4, 0, 0, 0,
212, 0, 0, 0, 8, 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, 0, 0, 8, 0, 0, 0,
200, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
0, 0, 15, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 3, 0, 2, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 4, 0, 2, 0, 0, 0, 4, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 5, 0, 2, 0, 0, 0, 5, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 6, 0, 2, 0, 0, 0, 6, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 7, 0, 2, 0, 0, 0, 7, 0,
0, 0, 15, 0, 0, 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, 83, 86, 95, 84, 65, 82,
71, 69, 84, 0, 171, 171, 71, 69, 84, 0, 83, 86,
83, 72, 68, 82, 24, 1, 95, 68, 69, 80, 84, 72,
0, 0, 64, 0, 0, 0, 0, 171, 83, 72, 68, 82,
70, 0, 0, 0, 98, 8, 88, 1, 0, 0, 64, 0,
0, 3, 242, 16, 16, 0, 0, 0, 86, 0, 0, 0,
1, 0, 0, 0, 101, 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, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
...@@ -143,36 +195,46 @@ const BYTE g_PS_ClearSint[] = ...@@ -143,36 +195,46 @@ const BYTE g_PS_ClearSint[] =
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
6, 0, 0, 0, 101, 0, 6, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
7, 0, 0, 0, 54, 0, 7, 0, 0, 0, 101, 0,
0, 5, 242, 32, 16, 0, 0, 2, 1, 192, 0, 0,
0, 0, 0, 0, 70, 30, 54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0, 16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 242, 32, 70, 142, 32, 0, 0, 0,
16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
70, 30, 16, 0, 1, 0, 54, 0, 0, 6, 242, 32,
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,
16, 0, 1, 0, 0, 0, 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, 16, 0, 4, 0, 0, 0,
70, 30, 16, 0, 1, 0, 70, 142, 32, 0, 0, 0,
0, 0, 54, 0, 0, 5, 0, 0, 0, 0, 0, 0,
242, 32, 16, 0, 5, 0, 54, 0, 0, 6, 242, 32,
0, 0, 70, 30, 16, 0, 16, 0, 5, 0, 0, 0,
1, 0, 0, 0, 54, 0, 70, 142, 32, 0, 0, 0,
0, 5, 242, 32, 16, 0, 0, 0, 0, 0, 0, 0,
6, 0, 0, 0, 70, 30, 54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0, 16, 0, 6, 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, 7, 0, 0, 0, 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, 0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0, 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, 0, 0, 0, 0,
0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
...@@ -185,7 +247,7 @@ const BYTE g_PS_ClearSint[] = ...@@ -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, 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, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
......
...@@ -3,13 +3,30 @@ ...@@ -3,13 +3,30 @@
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 // 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: // Input signature:
// //
// Name Index Mask Register SysValue Format Used // Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------ // -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float // SV_POSITION 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE uint xyzw
// //
// //
// Output signature: // Output signature:
...@@ -24,9 +41,10 @@ ...@@ -24,9 +41,10 @@
// SV_TARGET 5 xyzw 5 TARGET uint xyzw // SV_TARGET 5 xyzw 5 TARGET uint xyzw
// SV_TARGET 6 xyzw 6 TARGET uint xyzw // SV_TARGET 6 xyzw 6 TARGET uint xyzw
// SV_TARGET 7 xyzw 7 TARGET uint xyzw // SV_TARGET 7 xyzw 7 TARGET uint xyzw
// SV_DEPTH 0 N/A oDepth DEPTH float YES
// //
ps_4_0 ps_4_0
dcl_input_ps constant v1.xyzw dcl_constantbuffer cb0[2], immediateIndexed
dcl_output o0.xyzw dcl_output o0.xyzw
dcl_output o1.xyzw dcl_output o1.xyzw
dcl_output o2.xyzw dcl_output o2.xyzw
...@@ -35,99 +53,133 @@ dcl_output o4.xyzw ...@@ -35,99 +53,133 @@ dcl_output o4.xyzw
dcl_output o5.xyzw dcl_output o5.xyzw
dcl_output o6.xyzw dcl_output o6.xyzw
dcl_output o7.xyzw dcl_output o7.xyzw
mov o0.xyzw, v1.xyzw dcl_output oDepth
mov o1.xyzw, v1.xyzw mov o0.xyzw, cb0[0].xyzw
mov o2.xyzw, v1.xyzw mov o1.xyzw, cb0[0].xyzw
mov o3.xyzw, v1.xyzw mov o2.xyzw, cb0[0].xyzw
mov o4.xyzw, v1.xyzw mov o3.xyzw, cb0[0].xyzw
mov o5.xyzw, v1.xyzw mov o4.xyzw, cb0[0].xyzw
mov o6.xyzw, v1.xyzw mov o5.xyzw, cb0[0].xyzw
mov o7.xyzw, v1.xyzw mov o6.xyzw, cb0[0].xyzw
mov o7.xyzw, cb0[0].xyzw
mov oDepth, cb0[1].x
ret ret
// Approximately 9 instruction slots used // Approximately 10 instruction slots used
#endif #endif
const BYTE g_PS_ClearUint[] = const BYTE g_PS_ClearUint[] =
{ {
68, 88, 66, 67, 117, 209, 68, 88, 66, 67, 31, 50,
142, 159, 65, 29, 212, 206, 232, 254, 182, 197, 174, 161,
242, 37, 169, 58, 35, 236, 39, 175, 44, 65, 71, 251,
222, 73, 1, 0, 0, 0, 37, 230, 1, 0, 0, 0,
88, 3, 0, 0, 5, 0, 84, 4, 0, 0, 5, 0,
0, 0, 52, 0, 0, 0, 0, 0, 52, 0, 0, 0,
140, 0, 0, 0, 224, 0, 72, 1, 0, 0, 124, 1,
0, 0, 188, 1, 0, 0, 0, 0, 120, 2, 0, 0,
220, 2, 0, 0, 82, 68, 216, 3, 0, 0, 82, 68,
69, 70, 80, 0, 0, 0, 69, 70, 12, 1, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 84, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
28, 0, 0, 0, 0, 4, 28, 0, 0, 0, 0, 4,
255, 255, 0, 1, 0, 0, 255, 255, 0, 1, 0, 0,
28, 0, 0, 0, 77, 105, 216, 0, 0, 0, 60, 0,
99, 114, 111, 115, 111, 102, 0, 0, 0, 0, 0, 0,
116, 32, 40, 82, 41, 32, 0, 0, 0, 0, 0, 0,
72, 76, 83, 76, 32, 83, 0, 0, 0, 0, 0, 0,
104, 97, 100, 101, 114, 32, 0, 0, 0, 0, 1, 0,
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,
0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0, 67, 111, 108, 111, 114, 65,
0, 0, 15, 0, 0, 0, 110, 100, 68, 101, 112, 116,
68, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0, 156, 0, 0, 0, 0, 0,
0, 0, 15, 15, 0, 0, 0, 0, 16, 0, 0, 0,
83, 86, 95, 80, 79, 83, 2, 0, 0, 0, 168, 0,
73, 84, 73, 79, 78, 0, 0, 0, 0, 0, 0, 0,
67, 79, 76, 79, 82, 0, 184, 0, 0, 0, 16, 0,
171, 171, 79, 83, 71, 78, 0, 0, 4, 0, 0, 0,
212, 0, 0, 0, 8, 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, 0, 0, 8, 0, 0, 0,
200, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 15, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 2, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0, 1, 0, 0, 0, 3, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 4, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 5, 0, 1, 0, 0, 0, 5, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 6, 0, 1, 0, 0, 0, 6, 0,
0, 0, 15, 0, 0, 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, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 7, 0, 1, 0, 0, 0, 7, 0,
0, 0, 15, 0, 0, 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, 83, 86, 95, 84, 65, 82,
71, 69, 84, 0, 171, 171, 71, 69, 84, 0, 83, 86,
83, 72, 68, 82, 24, 1, 95, 68, 69, 80, 84, 72,
0, 0, 64, 0, 0, 0, 0, 171, 83, 72, 68, 82,
70, 0, 0, 0, 98, 8, 88, 1, 0, 0, 64, 0,
0, 3, 242, 16, 16, 0, 0, 0, 86, 0, 0, 0,
1, 0, 0, 0, 101, 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, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
...@@ -143,36 +195,46 @@ const BYTE g_PS_ClearUint[] = ...@@ -143,36 +195,46 @@ const BYTE g_PS_ClearUint[] =
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
6, 0, 0, 0, 101, 0, 6, 0, 0, 0, 101, 0,
0, 3, 242, 32, 16, 0, 0, 3, 242, 32, 16, 0,
7, 0, 0, 0, 54, 0, 7, 0, 0, 0, 101, 0,
0, 5, 242, 32, 16, 0, 0, 2, 1, 192, 0, 0,
0, 0, 0, 0, 70, 30, 54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0, 16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 242, 32, 70, 142, 32, 0, 0, 0,
16, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
70, 30, 16, 0, 1, 0, 54, 0, 0, 6, 242, 32,
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,
16, 0, 1, 0, 0, 0, 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, 16, 0, 4, 0, 0, 0,
70, 30, 16, 0, 1, 0, 70, 142, 32, 0, 0, 0,
0, 0, 54, 0, 0, 5, 0, 0, 0, 0, 0, 0,
242, 32, 16, 0, 5, 0, 54, 0, 0, 6, 242, 32,
0, 0, 70, 30, 16, 0, 16, 0, 5, 0, 0, 0,
1, 0, 0, 0, 54, 0, 70, 142, 32, 0, 0, 0,
0, 5, 242, 32, 16, 0, 0, 0, 0, 0, 0, 0,
6, 0, 0, 0, 70, 30, 54, 0, 0, 6, 242, 32,
16, 0, 1, 0, 0, 0, 16, 0, 6, 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, 7, 0, 0, 0, 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, 0, 0, 62, 0, 0, 1,
83, 84, 65, 84, 116, 0, 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, 0, 0, 0, 0,
0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
...@@ -185,7 +247,7 @@ const BYTE g_PS_ClearUint[] = ...@@ -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, 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, 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 ...@@ -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_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 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 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 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 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 :: Shaders for OpenGL ES 3.0+ only
:: | Input file | Entry point | Type | Output file | Debug | :: | Input file | Entry point | Type | Output file | Debug |
...@@ -81,10 +82,7 @@ call:BuildShader Swizzle11.hlsl PS_SwizzleF2DArray ps_4_0 co ...@@ -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_SwizzleI2DArray ps_4_0 compiled\swizzlei2darrayps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI2DArray ps_4_0 compiled\swizzleui2darrayps.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 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 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 VS_BufferToTexture vs_4_0 compiled/buffertotexture11_vs.h %debug%
......
...@@ -1879,7 +1879,7 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams, ...@@ -1879,7 +1879,7 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
const gl::FramebufferAttachment *colorBuffer, const gl::FramebufferAttachment *colorBuffer,
const gl::FramebufferAttachment *depthStencilBuffer) 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 // Clearing buffers with non-float values is not supported by Renderer9 and ES 2.0
UNREACHABLE(); UNREACHABLE();
...@@ -1897,8 +1897,8 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams, ...@@ -1897,8 +1897,8 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
} }
} }
float depth = gl::clamp01(clearParams.depthClearValue); float depth = gl::clamp01(clearParams.depthValue);
DWORD stencil = clearParams.stencilClearValue & 0x000000FF; DWORD stencil = clearParams.stencilValue & 0x000000FF;
unsigned int stencilUnmasked = 0x0; unsigned int stencilUnmasked = 0x0;
if (clearParams.clearStencil && depthStencilBuffer->getStencilSize() > 0) if (clearParams.clearStencil && depthStencilBuffer->getStencilSize() > 0)
...@@ -1944,16 +1944,16 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams, ...@@ -1944,16 +1944,16 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
color = color =
D3DCOLOR_ARGB(gl::unorm<8>((formatInfo.alphaBits == 0 && d3dFormatInfo.alphaBits > 0) D3DCOLOR_ARGB(gl::unorm<8>((formatInfo.alphaBits == 0 && d3dFormatInfo.alphaBits > 0)
? 1.0f ? 1.0f
: clearParams.colorFClearValue.alpha), : clearParams.colorF.alpha),
gl::unorm<8>((formatInfo.redBits == 0 && d3dFormatInfo.redBits > 0) gl::unorm<8>((formatInfo.redBits == 0 && d3dFormatInfo.redBits > 0)
? 0.0f ? 0.0f
: clearParams.colorFClearValue.red), : clearParams.colorF.red),
gl::unorm<8>((formatInfo.greenBits == 0 && d3dFormatInfo.greenBits > 0) gl::unorm<8>((formatInfo.greenBits == 0 && d3dFormatInfo.greenBits > 0)
? 0.0f ? 0.0f
: clearParams.colorFClearValue.green), : clearParams.colorF.green),
gl::unorm<8>((formatInfo.blueBits == 0 && d3dFormatInfo.blueBits > 0) gl::unorm<8>((formatInfo.blueBits == 0 && d3dFormatInfo.blueBits > 0)
? 0.0f ? 0.0f
: clearParams.colorFClearValue.blue)); : clearParams.colorF.blue));
if ((formatInfo.redBits > 0 && !clearParams.colorMaskRed) || if ((formatInfo.redBits > 0 && !clearParams.colorMaskRed) ||
(formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) || (formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) ||
......
...@@ -420,12 +420,12 @@ ...@@ -420,12 +420,12 @@
'libANGLE/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_ps_4i.h', '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_ps_4ui.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_vs.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/clearfloat11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.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/clearuint11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough2d11vs.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough2d11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11gs.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11gs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11vs.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