[Coverity] Fix uninitialised members in replay API structures

This commit is contained in:
baldurk
2016-05-06 23:15:42 +02:00
parent 2486936742
commit 6437137aba
5 changed files with 23 additions and 11 deletions
+3 -3
View File
@@ -31,7 +31,7 @@ struct D3D11PipelineState
struct InputAssembler
{
InputAssembler() : Bytecode(NULL) {}
InputAssembler() : Bytecode(NULL), customName(false) {}
struct LayoutInput
{
@@ -69,7 +69,7 @@ struct D3D11PipelineState
struct ShaderStage
{
ShaderStage() : Shader(), ShaderDetails(NULL) {}
ShaderStage() : Shader(), customName(false), ShaderDetails(NULL), stage(eShaderStage_Vertex) {}
ResourceId Shader;
rdctype::str ShaderName;
bool32 customName;
@@ -220,7 +220,7 @@ struct D3D11PipelineState
struct DepthStencilState
{
DepthStencilState()
: State(), DepthEnable(false), StencilEnable(false),
: State(), DepthEnable(false), DepthWrites(false), StencilEnable(false),
StencilReadMask(0), StencilWriteMask(0), StencilRef(0) {}
ResourceId State;
bool32 DepthEnable;
+3 -2
View File
@@ -27,7 +27,8 @@
struct FloatVector
{
FloatVector() {}
FloatVector()
: x(0.0f), y(0.0f), z(0.0f), w(0.0f) {}
FloatVector(float X, float Y, float Z, float W)
: x(X), y(Y), z(Z), w(W) {}
float x, y, z, w;
@@ -421,7 +422,7 @@ struct CounterDescription
struct CounterResult
{
CounterResult() : eventID(0) { value.u64 = 0; }
CounterResult() : eventID(0), counterID(0) { value.u64 = 0; }
CounterResult(uint32_t EID, uint32_t c, float data) : eventID(EID), counterID(c) { value.f = data; }
CounterResult(uint32_t EID, uint32_t c, double data) : eventID(EID), counterID(c) { value.d = data; }
CounterResult(uint32_t EID, uint32_t c, uint32_t data) : eventID(EID), counterID(c) { value.u32 = data; }
+12 -5
View File
@@ -75,7 +75,8 @@ struct GLPipelineState
ShaderStage()
: Shader()
, customShaderName(false), customProgramName(false)
, customPipelineName(false), ShaderDetails(NULL) {}
, PipelineActive(false), customPipelineName(false)
, ShaderDetails(NULL), stage(eShaderStage_Vertex) {}
ResourceId Shader;
rdctype::str ShaderName;
@@ -226,9 +227,14 @@ struct GLPipelineState
struct RasterizerState
{
RasterizerState()
: FillMode(eFill_Solid), CullMode(eCull_None), FrontCCW(false), DepthBias(0),
SlopeScaledDepthBias(0.0f), OffsetClamp(0.0f), DepthClamp(false),
MultisampleEnable(false) {}
: FillMode(eFill_Solid), CullMode(eCull_None), FrontCCW(false), DepthBias(0)
, SlopeScaledDepthBias(0.0f), OffsetClamp(0.0f), DepthClamp(false)
, MultisampleEnable(false), SampleShading(false), SampleMask(false)
, SampleMaskValue(~0U), SampleCoverage(false), SampleCoverageInvert(false)
, SampleCoverageValue(1.0f), SampleAlphaToCoverage(false), SampleAlphaToOne(false)
, MinSampleShadingRate(0.0f), ProgrammablePointSize(false), PointSize(1.0f)
, LineWidth(1.0f), PointFadeThreshold(0.0f), PointOriginUpperLeft(false)
{}
TriangleFillMode FillMode;
TriangleCullMode CullMode;
bool32 FrontCCW;
@@ -296,6 +302,7 @@ struct GLPipelineState
struct Attachment
{
Attachment() : Obj(), Layer(0), Mip(0) {}
ResourceId Obj;
uint32_t Layer;
uint32_t Mip;
@@ -303,7 +310,7 @@ struct GLPipelineState
struct FBO
{
FBO() : Obj(), Depth(), Stencil() {}
FBO() : Obj(), Depth(), Stencil(), ReadBuffer(0) {}
ResourceId Obj;
rdctype::array<Attachment> Color;
Attachment Depth;
+4
View File
@@ -35,12 +35,14 @@ struct ShaderVariable
ShaderVariable()
{
name = ""; rows = columns = 0;
isStruct = false;
type = eVar_Float;
for(int i=0; i < 16; i++) value.uv[i] = 0;
}
ShaderVariable(const char *n, float x, float y, float z, float w)
{
name = n; rows = 1; columns = 4;
isStruct = false;
for(int i=0; i < 16; i++) value.uv[i] = 0;
type = eVar_Float;
value.f.x = x; value.f.y = y; value.f.z = z; value.f.w = w;
@@ -48,6 +50,7 @@ struct ShaderVariable
ShaderVariable(const char *n, int x, int y, int z, int w)
{
name = n; rows = 1; columns = 4;
isStruct = false;
for(int i=0; i < 16; i++) value.uv[i] = 0;
type = eVar_Int;
value.i.x = x; value.i.y = y; value.i.z = z; value.i.w = w;
@@ -55,6 +58,7 @@ struct ShaderVariable
ShaderVariable(const char *n, uint32_t x, uint32_t y, uint32_t z, uint32_t w)
{
name = n; rows = 1; columns = 4;
isStruct = false;
for(int i=0; i < 16; i++) value.uv[i] = 0;
type = eVar_UInt;
value.u.x = x; value.u.y = y; value.u.z = z; value.u.w = w;
+1 -1
View File
@@ -126,7 +126,7 @@ struct VulkanPipelineState
struct ShaderStage
{
ShaderStage() : Shader(), ShaderDetails(NULL), customName(false) {}
ShaderStage() : Shader(), ShaderDetails(NULL), customName(false), stage(eShaderStage_Vertex) {}
ResourceId Shader;
rdctype::str entryPoint;