diff options
author | Shinryuuji <shinryuuji2k@gmail.com> | 2018-12-23 15:25:46 +0100 |
---|---|---|
committer | Shinryuuji <shinryuuji2k@gmail.com> | 2018-12-23 15:25:46 +0100 |
commit | 7bfddbec3a21f332d89185ae6d703ccc4fdbe440 (patch) | |
tree | c95779fce61af74e790c9bce7481fd7d4d1d2801 /drivers/gles3 | |
parent | 10e9221c49eddc05cb36c0b582060cac9e4c8cef (diff) |
Fix wrong default target for sampler2DArray
Diffstat (limited to 'drivers/gles3')
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 7 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 8 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 183fe8c5f8..1897ef8863 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -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: {} diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 2b038fcc0e..5c2f2f62e5 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -7753,6 +7753,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); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 958086f6c7..15a7a05d6e 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -131,6 +131,7 @@ public: GLuint aniso_tex; GLuint white_tex_3d; + GLuint white_tex_array; GLuint quadie; GLuint quadie_array; |