GPUFramebuffer: Allow to bind a specific texture mip to framebuffer.
This commit is contained in:
@@ -226,7 +226,7 @@ static void EEVEE_draw_scene(void *vedata)
|
||||
|
||||
/* Attach depth to the hdr buffer and bind it */
|
||||
DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
DRW_framebuffer_texture_attach(fbl->main, dtxl->depth, 0);
|
||||
DRW_framebuffer_texture_attach(fbl->main, dtxl->depth, 0, 0);
|
||||
DRW_framebuffer_bind(fbl->main);
|
||||
|
||||
/* Clear Depth */
|
||||
@@ -240,7 +240,7 @@ static void EEVEE_draw_scene(void *vedata)
|
||||
|
||||
/* Restore default framebuffer */
|
||||
DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
DRW_framebuffer_bind(dfbl->default_fb);
|
||||
|
||||
DRW_draw_pass(psl->tonemap);
|
||||
|
||||
@@ -141,17 +141,17 @@ void EEVEE_lights_cache_finish(EEVEE_StorageList *stl, EEVEE_TextureList *txl, E
|
||||
if (!txl->shadow_depth_cube_pool) {
|
||||
txl->shadow_depth_cube_pool = DRW_texture_create_2D_array(512, 512, MAX2(1, linfo->num_cube * 6), DRW_TEX_DEPTH_24, DRW_TEX_FILTER | DRW_TEX_COMPARE, NULL);
|
||||
if (fbl->shadow_cube_fb)
|
||||
DRW_framebuffer_texture_attach(fbl->shadow_cube_fb, txl->shadow_depth_cube_pool, 0);
|
||||
DRW_framebuffer_texture_attach(fbl->shadow_cube_fb, txl->shadow_depth_cube_pool, 0, 0);
|
||||
}
|
||||
if (!txl->shadow_depth_map_pool) {
|
||||
txl->shadow_depth_map_pool = DRW_texture_create_2D_array(512, 512, MAX2(1, linfo->num_map), DRW_TEX_DEPTH_24, DRW_TEX_FILTER | DRW_TEX_COMPARE, NULL);
|
||||
if (fbl->shadow_map_fb)
|
||||
DRW_framebuffer_texture_attach(fbl->shadow_map_fb, txl->shadow_depth_map_pool, 0);
|
||||
DRW_framebuffer_texture_attach(fbl->shadow_map_fb, txl->shadow_depth_map_pool, 0, 0);
|
||||
}
|
||||
if (!txl->shadow_depth_cascade_pool) {
|
||||
txl->shadow_depth_cascade_pool = DRW_texture_create_2D_array(512, 512, MAX2(1, linfo->num_cascade), DRW_TEX_DEPTH_24, DRW_TEX_FILTER | DRW_TEX_COMPARE, NULL);
|
||||
if (fbl->shadow_cascade_fb)
|
||||
DRW_framebuffer_texture_attach(fbl->shadow_cascade_fb, txl->shadow_depth_map_pool, 0);
|
||||
DRW_framebuffer_texture_attach(fbl->shadow_cascade_fb, txl->shadow_depth_map_pool, 0, 0);
|
||||
}
|
||||
|
||||
DRWFboTexture tex_cube = {&txl->shadow_depth_cube_pool, DRW_BUF_DEPTH_24, DRW_TEX_FILTER | DRW_TEX_COMPARE};
|
||||
|
||||
@@ -1256,7 +1256,7 @@ void DRW_framebuffer_init(struct GPUFrameBuffer **fb, int width, int height, DRW
|
||||
}
|
||||
}
|
||||
|
||||
GPU_framebuffer_texture_attach(*fb, *fbotex.tex, color_attachment);
|
||||
GPU_framebuffer_texture_attach(*fb, *fbotex.tex, color_attachment, 0);
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_check_valid(*fb, NULL)) {
|
||||
@@ -1290,9 +1290,9 @@ void DRW_framebuffer_clear(bool color, bool depth, bool stencil, float clear_col
|
||||
((stencil) ? GL_STENCIL_BUFFER_BIT : 0));
|
||||
}
|
||||
|
||||
void DRW_framebuffer_texture_attach(struct GPUFrameBuffer *fb, GPUTexture *tex, int slot)
|
||||
void DRW_framebuffer_texture_attach(struct GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip)
|
||||
{
|
||||
GPU_framebuffer_texture_attach(fb, tex, slot);
|
||||
GPU_framebuffer_texture_attach(fb, tex, slot, mip);
|
||||
}
|
||||
|
||||
void DRW_framebuffer_texture_detach(GPUTexture *tex)
|
||||
|
||||
@@ -214,7 +214,7 @@ static void EDIT_CURVE_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -234,7 +234,7 @@ static void EDIT_LATTICE_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -476,7 +476,7 @@ static void EDIT_MESH_draw_scene(void *vedata)
|
||||
DRW_draw_pass(psl->mix_occlude);
|
||||
|
||||
/* reattach */
|
||||
DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
}
|
||||
else {
|
||||
DRW_draw_pass(psl->normals);
|
||||
|
||||
@@ -212,7 +212,7 @@ static void EDIT_METABALL_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ static void EDIT_SURFACE_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ static void EDIT_TEXT_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -1265,7 +1265,7 @@ static void OBJECT_draw_scene(void *vedata)
|
||||
DRW_draw_pass(psl->outlines_fade5);
|
||||
|
||||
/* reattach */
|
||||
DRW_framebuffer_texture_attach(fbl->outlines, txl->outlines_depth_tx, 0);
|
||||
DRW_framebuffer_texture_attach(fbl->outlines, txl->outlines_depth_tx, 0, 0);
|
||||
DRW_framebuffer_bind(dfbl->default_fb);
|
||||
|
||||
/* This needs to be drawn after the oultine */
|
||||
|
||||
@@ -212,7 +212,7 @@ static void PAINT_TEXTURE_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ static void PAINT_VERTEX_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ static void PAINT_WEIGHT_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ static void PARTICLE_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ static void POSE_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ static void SCULPT_draw_scene(void *vedata)
|
||||
* DRW_framebuffer_texture_detach(dtxl->depth);
|
||||
* DRW_framebuffer_bind(fbl->custom_fb);
|
||||
* DRW_draw_pass(psl->pass);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0);
|
||||
* DRW_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0);
|
||||
* DRW_framebuffer_bind(dfbl->default_fb);
|
||||
*/
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ struct GPUTexture;
|
||||
void GPU_texture_bind_as_framebuffer(struct GPUTexture *tex);
|
||||
|
||||
GPUFrameBuffer *GPU_framebuffer_create(void);
|
||||
bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, struct GPUTexture *tex, int slot);
|
||||
bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, struct GPUTexture *tex, int slot, int mip);
|
||||
void GPU_framebuffer_texture_detach(struct GPUTexture *tex);
|
||||
void GPU_framebuffer_bind(GPUFrameBuffer *fb);
|
||||
void GPU_framebuffer_slots_bind(GPUFrameBuffer *fb, int slot);
|
||||
|
||||
@@ -633,8 +633,8 @@ bool GPU_fx_compositor_initialize_passes(
|
||||
/* bind the buffers */
|
||||
|
||||
/* first depth buffer, because system assumes read/write buffers */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->depth_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->color_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->depth_buffer, 0, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->color_buffer, 0, 0);
|
||||
|
||||
if (!GPU_framebuffer_check_valid(fx->gbuffer, err_out))
|
||||
printf("%.256s\n", err_out);
|
||||
@@ -679,7 +679,7 @@ static void gpu_fx_bind_render_target(int *passes_left, GPUFX *fx, struct GPUOff
|
||||
}
|
||||
else {
|
||||
/* bind the ping buffer to the color buffer */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, target, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, target, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ void GPU_fx_compositor_setup_XRay_pass(GPUFX *fx, bool do_xray)
|
||||
GPU_framebuffer_texture_detach(fx->depth_buffer);
|
||||
|
||||
/* first depth buffer, because system assumes read/write buffers */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->depth_buffer_xray, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->depth_buffer_xray, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ void GPU_fx_compositor_XRay_resolve(GPUFX *fx)
|
||||
GPU_framebuffer_texture_detach(fx->depth_buffer_xray);
|
||||
|
||||
/* attach regular framebuffer */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->depth_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->depth_buffer, 0, 0);
|
||||
|
||||
/* full screen quad where we will always write to depth buffer */
|
||||
gpuSaveState(&fx->attribs, GPU_DEPTH_BUFFER_BIT | GPU_SCISSOR_BIT);
|
||||
@@ -950,9 +950,9 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_shader_uniform_texture(dof_shader_pass2, interface->color_uniform, src);
|
||||
|
||||
/* target is the downsampled coc buffer */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_half_downsampled_near, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_half_downsampled_far, 1);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_nearfar_coc, 2);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_half_downsampled_near, 0, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_half_downsampled_far, 1, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_nearfar_coc, 2, 0);
|
||||
/* binding takes care of setting the viewport to the downsampled size */
|
||||
GPU_framebuffer_slots_bind(fx->gbuffer, 0);
|
||||
|
||||
@@ -997,7 +997,7 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_texture_filter_mode(fx->dof_half_downsampled_far, false);
|
||||
|
||||
/* target is the downsampled coc buffer */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_far_blur, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_far_blur, 0, 0);
|
||||
GPU_texture_bind_as_framebuffer(fx->dof_far_blur);
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
@@ -1020,7 +1020,7 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_shader_uniform_texture(dof_shader_pass2, interface->color_uniform, fx->dof_half_downsampled_near);
|
||||
GPU_texture_filter_mode(fx->dof_half_downsampled_near, false);
|
||||
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_blur, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_blur, 0, 0);
|
||||
/* have to clear the buffer unfortunately */
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
/* the draw call we all waited for, draw a point per pixel, scaled per circle of confusion */
|
||||
@@ -1140,7 +1140,7 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_shader_uniform_texture(dof_shader_pass1, interface->depth_uniform, fx->depth_buffer);
|
||||
|
||||
/* target is the downsampled coc buffer */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_buffer, 0, 0);
|
||||
/* binding takes care of setting the viewport to the downsampled size */
|
||||
GPU_texture_bind_as_framebuffer(fx->dof_near_coc_buffer);
|
||||
|
||||
@@ -1182,7 +1182,7 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_shader_uniform_texture(dof_shader_pass2, interface->color_uniform, fx->dof_near_coc_buffer);
|
||||
|
||||
/* use final buffer as a temp here */
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_final_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_final_buffer, 0, 0);
|
||||
|
||||
/* Drawing quad */
|
||||
Batch_draw(fx->quad_batch);
|
||||
@@ -1203,7 +1203,7 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_texture_bind(fx->dof_near_coc_final_buffer, numslots++);
|
||||
GPU_shader_uniform_texture(dof_shader_pass2, interface->color_uniform, fx->dof_near_coc_final_buffer);
|
||||
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_blurred_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_blurred_buffer, 0, 0);
|
||||
|
||||
Batch_draw(fx->quad_batch);
|
||||
|
||||
@@ -1232,7 +1232,7 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_texture_bind(fx->dof_near_coc_blurred_buffer, numslots++);
|
||||
GPU_shader_uniform_texture(dof_shader_pass3, interface->near_coc_blurred, fx->dof_near_coc_blurred_buffer);
|
||||
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_final_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_final_buffer, 0, 0);
|
||||
|
||||
Batch_draw(fx->quad_batch);
|
||||
/* disable bindings */
|
||||
@@ -1258,7 +1258,7 @@ bool GPU_fx_do_composite_pass(
|
||||
GPU_shader_uniform_texture(dof_shader_pass4, interface->near_coc_downsampled, fx->dof_near_coc_final_buffer);
|
||||
GPU_shader_uniform_vector(dof_shader_pass4, interface->invrendertargetdim_uniform, 2, 1, invrendertargetdim);
|
||||
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_buffer, 0);
|
||||
GPU_framebuffer_texture_attach(fx->gbuffer, fx->dof_near_coc_buffer, 0, 0);
|
||||
|
||||
Batch_draw(fx->quad_batch);
|
||||
/* disable bindings */
|
||||
|
||||
@@ -114,7 +114,7 @@ GPUFrameBuffer *GPU_framebuffer_create(void)
|
||||
return fb;
|
||||
}
|
||||
|
||||
bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot)
|
||||
bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip)
|
||||
{
|
||||
GLenum attachment;
|
||||
|
||||
@@ -145,15 +145,15 @@ bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slo
|
||||
|
||||
#if defined(__APPLE__) && defined(WITH_GL_PROFILE_COMPAT)
|
||||
/* Mac workaround, remove after we switch to core profile */
|
||||
glFramebufferTextureEXT(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0);
|
||||
glFramebufferTextureEXT(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), mip);
|
||||
#elif defined(WITH_GL_PROFILE_COMPAT)
|
||||
/* Workaround for Mesa compatibility profile, remove after we switch to core profile */
|
||||
if(!GLEW_VERSION_3_2) /* glFramebufferTexture was introduced in 3.2. It is *not* available in the ARB FBO extension */
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GPU_texture_target(tex), GPU_texture_opengl_bindcode(tex), 0);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GPU_texture_target(tex), GPU_texture_opengl_bindcode(tex), mip);
|
||||
else
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0); /* normal core call, same as below */
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), mip); /* normal core call, same as below */
|
||||
#else
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0);
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), mip);
|
||||
#endif
|
||||
|
||||
if (GPU_texture_depth(tex))
|
||||
@@ -194,7 +194,7 @@ void GPU_framebuffer_texture_detach(GPUTexture *tex)
|
||||
attachment = GL_COLOR_ATTACHMENT0 + fb_attachment;
|
||||
}
|
||||
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GPU_texture_target(tex), 0, 0);
|
||||
glFramebufferTexture(GL_FRAMEBUFFER, attachment, 0, 0);
|
||||
|
||||
GPU_texture_framebuffer_set(tex, NULL, -1);
|
||||
}
|
||||
@@ -526,7 +526,7 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth, 0)) {
|
||||
if (!GPU_framebuffer_texture_attach(ofs->fb, ofs->depth, 0, 0)) {
|
||||
GPU_offscreen_free(ofs);
|
||||
return NULL;
|
||||
}
|
||||
@@ -537,7 +537,7 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_texture_attach(ofs->fb, ofs->color, 0)) {
|
||||
if (!GPU_framebuffer_texture_attach(ofs->fb, ofs->color, 0, 0)) {
|
||||
GPU_offscreen_free(ofs);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
|
||||
return lamp;
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_texture_attach(lamp->fb, lamp->depthtex, 0)) {
|
||||
if (!GPU_framebuffer_texture_attach(lamp->fb, lamp->depthtex, 0, 0)) {
|
||||
gpu_lamp_shadow_free(lamp);
|
||||
return lamp;
|
||||
}
|
||||
@@ -293,7 +293,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
|
||||
return lamp;
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex, 0)) {
|
||||
if (!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex, 0, 0)) {
|
||||
gpu_lamp_shadow_free(lamp);
|
||||
return lamp;
|
||||
}
|
||||
@@ -316,7 +316,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
|
||||
return lamp;
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_texture_attach(lamp->blurfb, lamp->blurtex, 0)) {
|
||||
if (!GPU_framebuffer_texture_attach(lamp->blurfb, lamp->blurtex, 0, 0)) {
|
||||
gpu_lamp_shadow_free(lamp);
|
||||
return lamp;
|
||||
}
|
||||
@@ -338,7 +338,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
|
||||
return lamp;
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex, 0)) {
|
||||
if (!GPU_framebuffer_texture_attach(lamp->fb, lamp->tex, 0, 0)) {
|
||||
gpu_lamp_shadow_free(lamp);
|
||||
return lamp;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ void GPU_viewport_bind(GPUViewport *viewport, const rcti *rect)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!GPU_framebuffer_texture_attach(dfbl->default_fb, dtxl->color, 0)) {
|
||||
if (!GPU_framebuffer_texture_attach(dfbl->default_fb, dtxl->color, 0, 0)) {
|
||||
ok = false;
|
||||
goto cleanup;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ void GPU_viewport_bind(GPUViewport *viewport, const rcti *rect)
|
||||
ok = false;
|
||||
goto cleanup;
|
||||
}
|
||||
else if (!GPU_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0)) {
|
||||
else if (!GPU_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0)) {
|
||||
ok = false;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user