Skip to content

Commit

Permalink
Address #2211: Improve the copy constructor of TVarLivePair.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkslang committed May 12, 2020
1 parent 55f9d97 commit f51bfa5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
22 changes: 3 additions & 19 deletions Test/310.inheritMemory.frag
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ struct S {
float buff[10];
};

layout(std430, binding=2) readonly buffer RoBuff {
float buff_ro[10];
layout(std140, binding=2) readonly buffer RoBuff {
S s_ro;
} ro_buffer;

layout(std430, binding=2) buffer Buff {
float buff[10];
S s;
} non_ro_buffer;

void non_ro_fun(float[10] buff) { }
void non_ro_funf(float el) { }
void non_ro_funS(S s) { }

out vec4 fragColor;
Expand All @@ -25,19 +21,7 @@ void main()
{
S s;

non_ro_fun(s.buff);
non_ro_funf(s.buff[3]);
non_ro_funS(s);

non_ro_fun(non_ro_buffer.buff);
non_ro_fun(non_ro_buffer.s.buff);
non_ro_funf(non_ro_buffer.buff[3]);
non_ro_funf(non_ro_buffer.s.buff[3]);
non_ro_funS(non_ro_buffer.s);

non_ro_fun(ro_buffer.buff_ro);
non_ro_fun(ro_buffer.s_ro.buff);
non_ro_funf(ro_buffer.buff_ro[3]);
non_ro_funf(ro_buffer.s_ro.buff[3]);
non_ro_funS(ro_buffer.s_ro);
non_ro_funS(non_ro_buffer.s);
non_ro_funS(s);
}
2 changes: 1 addition & 1 deletion glslang/MachineIndependent/iomapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ struct TVarLivePair : std::pair<const TString, TVarEntryInfo> {
second = _Right.second;
return (*this);
}
TVarLivePair(const TVarLivePair& src) { *this = src; }
TVarLivePair(const TVarLivePair& src) : pair(src) { }
};
typedef std::vector<TVarLivePair> TVarLiveVector;

Expand Down

0 comments on commit f51bfa5

Please sign in to comment.