mirror of
https://github.com/godotengine/godot.git
synced 2025-01-27 04:12:02 +00:00
Merge pull request #24568 from Shinryuuji/fix-wrong-texture-array-target
Fix wrong default target for sampler2DArray
This commit is contained in:
commit
d8f0087dc8
@ -1268,7 +1268,14 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
|
||||
case ShaderLanguage::TYPE_ISAMPLER2DARRAY:
|
||||
case ShaderLanguage::TYPE_USAMPLER2DARRAY:
|
||||
case ShaderLanguage::TYPE_SAMPLER2DARRAY: {
|
||||
|
||||
target = GL_TEXTURE_2D_ARRAY;
|
||||
tex = storage->resources.white_tex_array;
|
||||
|
||||
//switch (texture_hints[i]) {
|
||||
// TODO
|
||||
//}
|
||||
|
||||
} break;
|
||||
|
||||
default: {}
|
||||
|
@ -7776,6 +7776,14 @@ void RasterizerStorageGLES3::initialize() {
|
||||
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_BASE_LEVEL, 0);
|
||||
glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAX_LEVEL, 0);
|
||||
|
||||
glGenTextures(1, &resources.white_tex_array);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D_ARRAY, resources.white_tex_array);
|
||||
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGB, 8, 8, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, 0, 8, 8, 1, GL_RGB, GL_UNSIGNED_BYTE, whitetexdata);
|
||||
glGenerateMipmap(GL_TEXTURE_2D_ARRAY);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &config.max_texture_image_units);
|
||||
|
@ -133,6 +133,7 @@ public:
|
||||
GLuint aniso_tex;
|
||||
|
||||
GLuint white_tex_3d;
|
||||
GLuint white_tex_array;
|
||||
|
||||
GLuint quadie;
|
||||
GLuint quadie_array;
|
||||
|
Loading…
Reference in New Issue
Block a user