mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -04:00
glgsg: Don't use simple RAM image in shaders for non-sampler2D types
Simple RAM images are always 2D right now, so this would otherwise cause an error.
This commit is contained in:
parent
8f9d23ff29
commit
5cad0eb973
@ -2952,10 +2952,13 @@ update_shader_texture_bindings(ShaderContext *prev) {
|
||||
|
||||
// Bindless texturing wasn't supported or didn't work, so let's just bind
|
||||
// the texture normally.
|
||||
// Note that simple RAM images are always 2-D for now, so to avoid errors,
|
||||
// we must load the real texture if this is not for a sampler2D.
|
||||
bool force = (spec._desired_type != Texture::TT_2d_texture);
|
||||
#ifndef OPENGLES
|
||||
if (multi_bind) {
|
||||
// Multi-bind case.
|
||||
if (!_glgsg->update_texture(gtc, false)) {
|
||||
if (!_glgsg->update_texture(gtc, force)) {
|
||||
textures[i] = 0;
|
||||
} else {
|
||||
gtc->set_active(true);
|
||||
@ -2975,7 +2978,7 @@ update_shader_texture_bindings(ShaderContext *prev) {
|
||||
{
|
||||
// Non-multibind case.
|
||||
_glgsg->set_active_texture_stage(i);
|
||||
if (!_glgsg->update_texture(gtc, false)) {
|
||||
if (!_glgsg->update_texture(gtc, force)) {
|
||||
continue;
|
||||
}
|
||||
_glgsg->apply_texture(gtc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user