mirror of https://github.com/bjornbytes/lovr.git
Details;
This commit is contained in:
parent
ad5d00fb2f
commit
116d14cdf8
|
@ -80,16 +80,16 @@ layout(location = 0) out vec4 PixelColor;
|
|||
#ifdef GL_VERTEX_SHADER
|
||||
layout(location = 10) out vec3 PositionWorld;
|
||||
layout(location = 11) out vec3 Normal;
|
||||
layout(location = 12) out vec4 Color;
|
||||
layout(location = 13) out vec2 UV;
|
||||
layout(location = 12) out vec2 UV;
|
||||
layout(location = 13) out vec4 Color;
|
||||
layout(location = 14) out vec3 Tangent;
|
||||
#endif
|
||||
|
||||
#ifdef GL_FRAGMENT_SHADER
|
||||
layout(location = 10) in vec3 PositionWorld;
|
||||
layout(location = 11) in vec3 Normal;
|
||||
layout(location = 12) in vec4 Color;
|
||||
layout(location = 13) in vec2 UV;
|
||||
layout(location = 12) in vec2 UV;
|
||||
layout(location = 13) in vec4 Color;
|
||||
layout(location = 14) in vec3 Tangent;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2857,11 +2857,18 @@ bool lovrShaderHasStage(Shader* shader, ShaderStage stage) {
|
|||
}
|
||||
|
||||
bool lovrShaderHasAttribute(Shader* shader, const char* name, uint32_t location) {
|
||||
uint32_t hash = name ? (uint32_t) hash64(name, strlen(name)) : 0;
|
||||
for (uint32_t i = 0; i < shader->attributeCount; i++) {
|
||||
ShaderAttribute* attribute = &shader->attributes[i];
|
||||
if (name ? (attribute->hash == hash) : (attribute->location == location)) {
|
||||
return true;
|
||||
if (name) {
|
||||
uint32_t hash = (uint32_t) hash64(name, strlen(name));
|
||||
for (uint32_t i = 0; i < shader->attributeCount; i++) {
|
||||
if (shader->attributes[i].hash == hash) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (uint32_t i = 0; i < shader->attributeCount; i++) {
|
||||
if (shader->attributes[i].location == location) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -148,7 +148,8 @@ typedef enum {
|
|||
TYPE_MAT3,
|
||||
TYPE_MAT4,
|
||||
TYPE_INDEX16,
|
||||
TYPE_INDEX32
|
||||
TYPE_INDEX32,
|
||||
TYPE_COUNT
|
||||
} DataType;
|
||||
|
||||
typedef enum {
|
||||
|
|
Loading…
Reference in New Issue