我正在尝试撤回一组具有特定类型项目的项目列表.
例如:
<class name="Owner" table="OWNER">
<id name="id" column="OWNER_ID" />
<set name="cats" table="OWNER_CATS" lazy="false">
<key column="OWNER_ID" />
<many-to-many class="Cat" />
</set>
Run Code Online (Sandbox Code Playgroud)
<class name="Cat" table="CAT" discriminator-value="C">
<id name="id" column="CAT_ID" />
<discriminator column="type" type="character" />
<subclass name="Lion" discriminator-value="L">
<property name="teeth" />
</subclass>
</class>
Run Code Online (Sandbox Code Playgroud)
使用限制如何获得有狮子作为宠物的所有者列表?
我尝试过以下几点无济于事:
criteria.createCriteria("cats").add(Restrictions.eq("class", Lion.class));
Run Code Online (Sandbox Code Playgroud) 我试图使用着色器管道(OpenGL ES 2.0)将我的固定管道代码(OpenGL ES 1.1)转换为一个.但是只有一个纹理似乎工作,我得到错误:
Validation Failed: Sampler error:
Samplers of different types use the same texture image unit.
- or -
A sampler's texture unit is out of range (greater than max allowed or negative).
Run Code Online (Sandbox Code Playgroud)
在我的片段着色器中,我有一个统一的纹理ID和从我的顶点着色器传来的纹理坐标:
varying lowp vec4 colorVarying;
varying lowp vec2 texCoordsVarying;
uniform sampler2D texID;
void main()
{
lowp vec4 colour = texture2D(texID, texCoordsVarying);
gl_FragColor = colour * colorVarying;
}
Run Code Online (Sandbox Code Playgroud)
据我了解,因为我只使用一个纹理,我只需要一个活动的纹理单元.因此,在我的管道中,我通过激活适当的纹理单元,绑定当前纹理并将纹理ID的统一值设置为纹理单元来设置纹理.然后我继续绘制顶点.
这是我的管道的纹理部分:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, ((MNTexturedRect*)object).texID);
glUniform1i(uniforms[UNIFORM_TEXTURE], GL_TEXTURE0);
glVertexAttribPointer(ATTRIB_TEXTURE_COORDS, 2, GL_FLOAT, GL_FALSE, object.dataPerPoint*sizeof(GLfloat), &points[((MNTexturedRect*)object).texCoordOffset]);
glEnableVertexAttribArray(ATTRIB_TEXTURE_COORDS);
Run Code Online (Sandbox Code Playgroud)
我有一个想法,纹理ID是统一的是导致问题,但不知道如何解决它.我有几个对象,看起来只有第一个纹理加载实际上似乎工作.我只有取样器而且不太确定为什么它会抱怨使用相同的纹理单元,而我的纹理单元在范围内,因为它只是GL_TEXTURE0.
任何有关为什么会发生这种情况的想法?