Changeset 500 for trunk/src/gl
- Timestamp:
- 06/08/16 20:14:43 (9 years ago)
- Location:
- trunk/src/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_context.cc
r499 r500 132 132 } 133 133 134 void nv::gl_context::attach( framebuffer f, output_slot slot, texture t )134 void nv::gl_context::attach( framebuffer f, output_slot slot, texture t, int layer /* = -1*/ ) 135 135 { 136 136 // TODO: framebuffer variable, so no re-binding? … … 143 143 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 144 144 unsigned gl_type = texture_type_to_enum( tinfo->type ); 145 146 if ( tinfo ) 147 { 148 // if ( tinfo->size.y == 0 ) 149 // glFramebufferTexture1D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, GL_TEXTURE_1D, tinfo->glid, 0 ); 150 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+unsigned( slot ), gl_type, tinfo->glid, 0 ); 145 unsigned tglid = tinfo ? tinfo->glid : 0; 146 147 if ( layer >= 0 ) 148 { 149 glFramebufferTextureLayer( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + unsigned( slot ), tglid, 0, layer ); 151 150 } 152 151 else 153 152 { 154 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 +unsigned( slot ), gl_type, 0, 0 );153 glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + unsigned( slot ), gl_type, tglid, 0 ); 155 154 } 156 155 … … 171 170 if ( layer >= 0 ) 172 171 { 173 glFramebufferTextureLayer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, tinfo->glid, 0, layer );172 glFramebufferTextureLayer( GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, glid, 0, layer ); 174 173 } 175 174 else -
trunk/src/gl/gl_enum.cc
r499 r500 202 202 case R32I : return GL_RED_INTEGER; 203 203 case R32UI : return GL_RED_INTEGER; 204 case RGBA8I : return GL_RGBA; 205 case RGBA8UI : return GL_RGBA; 206 case RGBA16I : return GL_RGBA; 207 case RGBA16UI: return GL_RGBA; 208 case RGBA32I : return GL_RGBA; 209 case RGBA32UI: return GL_RGBA; 204 210 NV_RETURN_COVERED_DEFAULT( 0 ); 205 211 } … … 230 236 case R32I : return GL_R32I; 231 237 case R32UI : return GL_R32UI; 238 case RGBA8I : return GL_RGBA8I; 239 case RGBA8UI : return GL_RGBA8UI; 240 case RGBA16I : return GL_RGBA16I; 241 case RGBA16UI: return GL_RGBA16UI; 242 case RGBA32I : return GL_RGBA32I; 243 case RGBA32UI: return GL_RGBA32UI; 244 232 245 NV_RETURN_COVERED_DEFAULT( 0 ); 233 246 }
Note: See TracChangeset
for help on using the changeset viewer.