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) ...@@ -38,19 +38,19 @@ 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();
const gl::Framebuffer *framebufferObject = state.getDrawFramebuffer(); const gl::Framebuffer *framebufferObject = state.getDrawFramebuffer();
if (mask & GL_COLOR_BUFFER_BIT) if (mask & GL_COLOR_BUFFER_BIT)
...@@ -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);
...@@ -181,10 +181,10 @@ gl::Error FramebufferD3D::clearBufferfi(ContextImpl *context, ...@@ -181,10 +181,10 @@ 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;
......
...@@ -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,
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; 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)
{ {
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) 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; // Pixel Shader Constant Buffers
float4 color4 : SV_TARGET4; cbuffer ColorAndDepthDataFloat : register(b0)
float4 color5 : SV_TARGET5; {
float4 color6 : SV_TARGET6; float4 color_Float : packoffset(c0);
float4 color7 : SV_TARGET7; 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; uint4 color_Uint : packoffset(c0);
outColor.color0 = inColor; float zValueF_Uint : 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;
} }
// 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_OutputSint outColor; PS_OutputUint outData;
outColor.color0 = inColor; outData.color0 = color_Uint;
outColor.color1 = inColor; outData.color1 = color_Uint;
outColor.color2 = inColor; outData.color2 = color_Uint;
outColor.color3 = inColor; outData.color3 = color_Uint;
outColor.color4 = inColor; outData.color4 = color_Uint;
outColor.color5 = inColor; outData.color5 = color_Uint;
outColor.color6 = inColor; outData.color6 = color_Uint;
outColor.color7 = inColor; outData.color7 = color_Uint;
return outColor; 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
};
...@@ -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