mirror of https://github.com/bjornbytes/lovr.git
Add missing check for sample usage in material textures;
This commit is contained in:
parent
b61dbab21b
commit
58dc7ee9dd
|
@ -2066,6 +2066,7 @@ Material* lovrMaterialCreate(const MaterialInfo* info) {
|
|||
lovrRetain(textures[i]);
|
||||
Texture* texture = textures[i] ? textures[i] : state.defaultTexture;
|
||||
lovrCheck(i == 0 || texture->info.type == TEXTURE_2D, "Material textures must be 2D");
|
||||
lovrCheck(texture->info.usage & TEXTURE_SAMPLE, "Textures must be created with the 'sample' usage to use them in Materials");
|
||||
bindings[i + 1] = (gpu_binding) { i + 1, GPU_SLOT_SAMPLED_TEXTURE, .texture = texture->gpu };
|
||||
material->hasWritableTexture |= texture->info.usage != TEXTURE_SAMPLE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue