Lines Matching defs:variable
1110 /** Query program resource for given variable and verify that everything is as expected
1113 * @param variable Variable object
1119 bool checkVarying(Program& program, Shader::STAGES stage, const Variable& variable, std::stringstream& stream, bool is_input)
1123 if (variable.IsBlock())
1125 Utils::Interface* interface = variable.m_descriptor.m_interface;
1140 To query the the location of struct member by glGetProgramResource, we need pass the variable name "gs_fs_output[0].single",
1148 else if (variable.IsStruct())
1150 Utils::Interface* interface = variable.m_descriptor.m_interface;
1152 std::string structVariable = variable.m_descriptor.m_name;
1164 // If struct variable is an array
1165 if (0 != variable.m_descriptor.m_n_array_elements)
1167 for (GLuint i = 0; i < variable.m_descriptor.m_n_array_elements; i++)
1202 result = verifyVarying(program, "", variable.m_descriptor, stream, is_input);
1207 /** Query program resource for given variable and verify that everything is as expected
1210 * @param variable Variable object
1215 bool checkUniform(Program& program, const Utils::Variable& variable, std::stringstream& stream)
1219 if (false == variable.IsBlock())
1225 Utils::Interface* interface = variable.m_descriptor.m_interface;
1269 stream << "Failed to query program for uniforms in block: " << variable.m_descriptor.m_name
1291 /** Query program resource for given variable and verify that everything is as expected
1294 * @param variable Variable object
1299 bool checkSSB(Program& program, const Utils::Variable& variable, std::stringstream& stream)
1303 if (false == variable.IsBlock())
1309 Utils::Interface* interface = variable.m_descriptor.m_interface;
1342 stream << "Failed to query program for buffer variable: " << variable.m_descriptor.m_name
3836 /** Get code that defines variable
3838 * @param flavour Provides info if variable is array or not
3847 /** Calcualtes stride of variable
3867 /** Check if variable is block
3869 * @return true if variable type is block, false otherwise
3887 /** Check if variable is struct
3889 * @return true if variable type is struct, false otherwise
3906 /** Get code that reference variable
3909 * @param variable Descriptor of variable
3910 * @param flavour Provides info about how variable should be referenced
3911 * @param array_index Index of array, ignored when variable is not array
3915 std::string Variable::GetReference(const std::string& parent_name, const Descriptor& variable, FLAVOUR flavour,
3925 name.append(variable.m_name);
3929 name = variable.m_name;
3948 if (0 != variable.m_n_array_elements)
3994 * @param expected_component Expected component of variable
4022 * @param expected_component Expected component of variable
4024 * @param interface Interface of variable
4045 /** Get definition of variable
4047 * @param flavour Flavour of variable
4048 * @param storage Storage used for variable
4282 * @param expected_component Expected component of variable
4304 * @param expected_component Expected component of variable
4406 * @param in Input variable
4407 * @param out Output variable
4660 /** Clone variable for specific stage
4662 * @param variable Variable
4664 * @param prefix Prefix used in variable name that is specific for original stage
4667 void ProgramInterface::cloneVariableForStage(const Variable& variable, Shader::STAGES stage, const GLchar* prefix,
4670 switch (variable.m_storage)
4674 Variable* in = cloneVariableForStage(variable, stage, Variable::VARYING_INPUT, prefix);
4678 Variable* out = cloneVariableForStage(variable, stage, Variable::VARYING_OUTPUT, prefix);
4685 cloneVariableForStage(variable, stage, variable.m_storage, prefix);
4692 /** Clone variable for specific stage
4694 * @param variable Variable
4696 * @param storage Storage used by variable
4697 * @param prefix Prefix used in variable name that is specific for original stage
4699 * @return New variable
4701 Variable* ProgramInterface::cloneVariableForStage(const Variable& variable, Shader::STAGES stage,
4704 /* Initialize with original variable */
4705 Variable* var = new Variable(variable);
4715 std::string name = variable.m_descriptor.m_name;
4727 const bool is_block = variable.IsBlock();
4730 const Interface* interface = variable.m_descriptor.m_interface;
4737 /* Store variable */
4965 * @param variable Variable to modify
4968 void ProgramInterface::replaceBinding(Variable& variable, Shader::STAGES stage)
4972 replaceAllTokens("BINDING", binding, variable.m_descriptor.m_qualifiers);
5306 * @param storage Storage of variable
6560 /* For each in variable insert verification code */
6571 /* For each unifrom variable insert verification code */
6581 /* For each ssb variable insert verification code */
6642 * @param in_parent_name Name of parent in variable
6643 * @param in_variable Descriptor of in variable
6644 * @param in_flavour Flavoud of in variable
6645 * @param out_parent_name Name of parent out variable
6646 * @param out_variable Descriptor of out variable
6647 * @param out_flavour Flavoud of out variable
6728 /** Get verification of single variable
6730 * @param parent_name Name of parent variable
6732 * @param variable Descriptor of variable
6733 * @param flavour Flavour of variable
6738 const Utils::Variable::Descriptor& variable,
6742 const GLuint n_elements = (0 == variable.m_n_array_elements) ? 1 : variable.m_n_array_elements;
6745 GLint stride = variable.m_expected_stride_of_element;
6750 const std::string name = Utils::Variable::GetReference(parent_name, variable, flavour, element);
6756 if (Utils::Variable::BUILTIN == variable.m_type)
6758 const std::string& expected = variable.m_builtin.GetGLSLConstructor(data_ptr);
6771 const Utils::Interface* interface = variable.m_interface;
6838 const Utils::Variable& variable = *si.m_inputs[i];
6840 const GLuint variable_size = static_cast<GLuint>(variable.m_data_size);
6842 const GLuint base_slot = variable.m_descriptor.m_expected_location + variable.m_descriptor.m_offset / 16;
6843 const GLuint ends_at = variable.m_descriptor.m_offset % 16 + variable_size;
6845 const GLuint array_length = std::max(1u, variable.m_descriptor.m_n_array_elements);
6871 const Utils::Variable& variable = *si.m_inputs[i];
6873 const GLuint base_slot = variable.m_descriptor.m_expected_location + variable.m_descriptor.m_offset / 16;
6874 const GLuint variable_offset = variable.m_descriptor.m_offset % 16;
6875 const GLuint array_length = std::max(1u, variable.m_descriptor.m_n_array_elements);
6879 memcpy(ptr + slot_offsets[slot] + variable_offset, variable.m_data, variable.m_data_size);
6884 vao.Attribute(variable.m_descriptor.m_expected_location, variable.m_descriptor.m_builtin,
6885 variable.m_descriptor.m_n_array_elements, variable.m_descriptor.m_normalized,
6886 variable.GetStride(), (GLvoid*)(intptr_t)(slot_offsets[base_slot] + variable_offset));
6888 else if (0 == variable.m_descriptor.m_expected_component)
6895 const GLuint n_component_size = Utils::Type::Double == variable.m_descriptor.m_builtin.m_basic_type ? 8 : 4;
6898 const Utils::Type& type = Utils::Type::GetType(variable.m_descriptor.m_builtin.m_basic_type,
6901 vao.Attribute(variable.m_descriptor.m_expected_location, type, variable.m_descriptor.m_n_array_elements,
6902 variable.m_descriptor.m_normalized, variable.GetStride(),
7015 Utils::Variable& variable = *si.m_ssb_blocks[i];
7017 if (false == variable.IsBlock())
7022 GLint variable_stride = variable.GetStride();
7024 GLint ends_at = variable_stride + variable.m_descriptor.m_offset;
7039 Utils::Variable& variable = *si.m_ssb_blocks[i];
7042 prepareUniform(program, variable, buffer);
7105 /** Updates buffer data with variable
7108 * @param variable Variable
7111 void TextureTestBase::prepareUniform(Utils::Program& program, Utils::Variable& variable, Utils::Buffer& buffer)
7115 GLsizei count = variable.m_descriptor.m_n_array_elements;
7121 if (Utils::Variable::BUILTIN == variable.m_descriptor.m_type)
7123 program.Uniform(gl, variable.m_descriptor.m_builtin, count, variable.m_descriptor.m_expected_location,
7124 variable.m_data);
7128 const bool is_block = variable.IsBlock();
7136 buffer.SubData(variable.m_descriptor.m_offset, variable.m_descriptor.m_expected_stride_of_element * count,
7137 variable.m_data);
7163 Utils::Variable& variable = *si.m_uniforms[i];
7165 if (false == variable.IsBlock())
7170 GLint variable_stride = variable.GetStride();
7172 GLint ends_at = variable_stride + variable.m_descriptor.m_offset;
7187 Utils::Variable& variable = *si.m_uniforms[i];
7189 prepareUniform(program, variable, buffer);
17622 * @return false for VS that use only single variable, true otherwise
21224 // The test considers gohan overflows the buffer 0, but according to spec, it is valid to declare the variable with qualifier "layout (xfb_offset = 16, xfb_stride = 32) out vec4 gohan;"
23090 // No data will be recorded for such strings, but the offset assigned to the next variable in varyings and the stride of the assigned bingding point will be affected.
23100 Note: the type can be float, double, mat2, mat3x2, dmat2, dmat3x2..., so to make the each variable of "captured_varyings" has the same xfb_offset with the above shaders,
23163 // the MAX_VARYING_COMPONENTS is 32 in our driver, but when the variable type is dmat4 or dmat4x3, the number of output component is 33, to make the
23620 Fixed incorrect usage of in/out qualifier, the following variable should be input symbols for fragment shader
24901 Note: If xfb varying output from vertex shader, the variable "goku" will only output once to transform feedback buffer,
24903 the primitive type is line which make the variable "goku" will output twice to transform feedback buffer, so for vertex shader
25719 * qualified variable or block member, or a compile-time error results.
27782 Note: If xfb varying output from vertex shader, the variable "goku" will only output once to transform feedback buffer,
27784 the primitive type is line which make the variable "goku" will output twice to transform feedback buffer, so for vertex shader
28221 Note: If xfb varying output from vertex shader, the variable "goku" will only output once to transform feedback buffer,
28223 the primitive type is line which make the variable "goku" will output twice to transform feedback buffer, so for vertex shader