Home | History | Annotate | Download | only in glshared

Lines Matching refs:rnd

44 static Vec4 getRandomColor (de::Random& rnd)
47 float r = rnd.choose<float>(DE_ARRAY_BEGIN(components), DE_ARRAY_END(components));
48 float g = rnd.choose<float>(DE_ARRAY_BEGIN(components), DE_ARRAY_END(components));
49 float b = rnd.choose<float>(DE_ARRAY_BEGIN(components), DE_ARRAY_END(components));
50 float a = rnd.choose<float>(DE_ARRAY_BEGIN(components), DE_ARRAY_END(components));
54 void computeRandomRenderState (de::Random& rnd, RenderState& state, glu::ApiType apiType, int targetWidth, int targetHeight)
149 state.scissorTestEnabled = rnd.getFloat() < scissorTestProbability;
150 state.stencilTestEnabled = rnd.getFloat() < stencilTestProbability;
151 state.depthTestEnabled = rnd.getFloat() < depthTestProbability;
152 state.blendEnabled = rnd.getFloat() < blendProbability;
153 state.ditherEnabled = rnd.getFloat() < ditherProbability;
162 int scissorW = rnd.getInt(minScissorW, maxScissorW);
163 int scissorH = rnd.getInt(minScissorH, maxScissorH);
164 int scissorX = rnd.getInt(-maxScissorOutOfBounds, targetWidth+maxScissorOutOfBounds-scissorW);
165 int scissorY = rnd.getInt(-maxScissorOutOfBounds, targetHeight+maxScissorOutOfBounds-scissorH);
174 state.stencil[ndx].function = rnd.choose<deUint32>(DE_ARRAY_BEGIN(compareFuncs), DE_ARRAY_END(compareFuncs));
175 state.stencil[ndx].reference = rnd.getInt(minStencilVal, maxStencilVal);
176 state.stencil[ndx].compareMask = rnd.getUint32();
177 state.stencil[ndx].stencilFailOp = rnd.choose<deUint32>(DE_ARRAY_BEGIN(stencilOps), DE_ARRAY_END(stencilOps));
178 state.stencil[ndx].depthFailOp = rnd.choose<deUint32>(DE_ARRAY_BEGIN(stencilOps), DE_ARRAY_END(stencilOps));
179 state.stencil[ndx].depthPassOp = rnd.choose<deUint32>(DE_ARRAY_BEGIN(stencilOps), DE_ARRAY_END(stencilOps));
180 state.stencil[ndx].writeMask = rnd.getUint32();
186 state.depthFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(compareFuncs), DE_ARRAY_END(compareFuncs));
187 state.depthWriteMask = rnd.getFloat() < depthWriteProbability;
194 state.blendRGBState.equation = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendEquationsES2), DE_ARRAY_END(blendEquationsES2));
195 state.blendRGBState.srcFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncs), DE_ARRAY_END(blendFuncs));
196 state.blendRGBState.dstFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncsDstES2), DE_ARRAY_END(blendFuncsDstES2));
198 state.blendAState.equation = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendEquationsES2), DE_ARRAY_END(blendEquationsES2));
199 state.blendAState.srcFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncs), DE_ARRAY_END(blendFuncs));
200 state.blendAState.dstFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncsDstES2), DE_ARRAY_END(blendFuncsDstES2));
204 state.blendRGBState.equation = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendEquations), DE_ARRAY_END(blendEquations));
205 state.blendRGBState.srcFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncs), DE_ARRAY_END(blendFuncs));
206 state.blendRGBState.dstFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncs), DE_ARRAY_END(blendFuncs));
208 state.blendAState.equation = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendEquations), DE_ARRAY_END(blendEquations));
209 state.blendAState.srcFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncs), DE_ARRAY_END(blendFuncs));
210 state.blendAState.dstFunc = rnd.choose<deUint32>(DE_ARRAY_BEGIN(blendFuncs), DE_ARRAY_END(blendFuncs));
213 state.blendColor = getRandomColor(rnd);
217 state.colorMask[ndx] = rnd.getFloat() < colorWriteProbability;
220 void computeRandomQuad (de::Random& rnd, gls::FragmentOpUtil::IntegerQuad& quad, int targetWidth, int targetHeight)
235 int width = rnd.getInt(minW, maxW);
236 int height = rnd.getInt(minH, maxH);
237 int x = rnd.getInt(-maxOutOfBounds, targetWidth+maxOutOfBounds-width);
238 int y = rnd.getInt(-maxOutOfBounds, targetHeight+maxOutOfBounds-height);
240 bool flipX = rnd.getBool();
241 bool flipY = rnd.getBool();
243 float depth = rnd.choose<float>(DE_ARRAY_BEGIN(depthValues), DE_ARRAY_END(depthValues));
249 quad.color[ndx] = getRandomColor(rnd);
254 void computeRandomRenderCommands (de::Random& rnd, glu::ApiType apiType, int numCommands, int targetW, int targetH, vector<RenderCommand>& dst)
261 computeRandomRenderState(rnd, cmd->state, apiType, targetW, targetH);
262 computeRandomQuad(rnd, cmd->quad, targetW, targetH);