Contribute to KhronosGroup/WebGL development by creating an account on GitHub. ...
WebGL Uniform Buffers Conformance Tests.
Skiptocontent
{{message}}
KhronosGroup
/
WebGL
Public
Notifications
Fork
643
Star
2.2k
Code
Issues
170
Pullrequests
23
Actions
Projects
0
Wiki
Security
Insights
More
Code
Issues
Pullrequests
Actions
Projects
Wiki
Security
Insights
Permalink
main
Branches
Tags
Couldnotloadbranches
Nothingtoshow
{{refName}}
default
Couldnotloadtags
Nothingtoshow
{{refName}}
default
WebGL/sdk/tests/conformance2/buffers/uniform-buffers.html
Gotofile
Gotofile
T
Gotoline
L
Copypath
Copypermalink
Thiscommitdoesnotbelongtoanybranchonthisrepository,andmaybelongtoaforkoutsideoftherepository.
Cannotretrievecontributorsatthistime
576lines(485sloc)
21KB
Raw
Blame
OpenwithDesktop
Viewraw
Viewblame
ThisfilecontainsbidirectionalUnicodetextthatmaybeinterpretedorcompileddifferentlythanwhatappearsbelow.Toreview,openthefileinaneditorthatrevealshiddenUnicodecharacters.
LearnmoreaboutbidirectionalUnicodecharacters
Showhiddencharacters
WebGLUniformBuffersConformanceTests
#version300es
layout(location=0)invec3p;
voidmain()
{
gl_Position=vec4(p.xyz,1.0);
}
#version300es
precisionmediumpfloat;
layout(location=0)outvec4oColor;
uniformUBOData{
floatUBORed;
floatUBOGreen;
floatUBOBlue;
};
uniformColor{
floatRed;
floatUBOGreen;
floatBlue;
};
voidmain()
{
oColor=vec4(UBORed*Red,UBOGreen*UBOGreen,UBOBlue*Blue,1.0);
}
#version300es
precisionmediumpfloat;
layout(location=0)outvec4oColor;
uniformUBOData{
floatUBORed;
floatUBOGreen;
floatUBOBlue;
};
uniformUBOD{
floatUBOR;
floatUBOG;
floatUBOB;
};
voidmain()
{
oColor=vec4(UBORed*UBOR,UBOGreen*UBOG,UBOBlue*UBOB,1.0);
}
#version300es
precisionmediumpfloat;
layout(location=0)outvec4oColor;
uniformUBOData{
floatRed;
floatGreen;
floatBlue;
}UBOA;
voidmain()
{
oColor=vec4(UBOA.Red,UBOA.Green,UBOA.Blue,1.0);
}
#version300es
precisionmediumpfloat;
layout(location=0)outvec4oColor;
uniformUBOData{
floatRed;
floatGreen;
floatBlue;
}UBOA[2];
voidmain()
{
oColor=vec4((UBOA[0].Red+UBOA[1].Red)/2.0,
(UBOA[0].Green+UBOA[1].Green)/2.0,
(UBOA[0].Blue+UBOA[1].Blue)/2.0,1.0);
}
#version300es
precisionmediumpfloat;
layout(location=0)outvec4oColor;
structcolor_t{
floatred;
floatgreen;
floatblue;
};
structwrapper_t{
color_tcolor;
};
uniformUBOData{
wrapper_tUBOStruct;
};
//ThisisintendedtoreproduceaspecificANGLEbugthattriggerswhenthewrapperstructispassedtoafunction.
//https://bugs.chromium.org/p/angleproject/issues/detail?id=2084
voidprocessColor(wrapper_twrapper){
oColor=vec4(wrapper.color.red,wrapper.color.green,wrapper.color.blue,1.0);
}
voidmain()
{
processColor(UBOStruct);
}
#version300es
precisionmediumpfloat;
layout(location=0)outvec4oColor;
structcolor_t{
floatred;
floatgreen;
floatblue;
};
uniformUBOData{
color_tUBOColors[2];
};
//ThisisintendedtoreproduceaspecificANGLEbugthattriggerswhenastructfromanarrayofstructsinaninterfaceblockispassedtoafunction.
//https://bugs.chromium.org/p/angleproject/issues/detail?id=2084
vec3processColor(color_tcolor){
returnvec3(color.red,color.green,color.blue);
}
voidmain()
{
oColor=vec4(processColor(UBOColors[0])+processColor(UBOColors[1]),1.0);
}
Copylines
Copypermalink
Viewgitblame
Referenceinnewissue
Go
Youcan’tperformthatactionatthistime.
Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession.
Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.