| … | 223 unchanged lines hidden | ||
| 224 | 224 | begin_render_pass_d3d12 :: proc(ctx: bk.Frame_Context, desc: bk.Render_Pass_Begin_Desc) { | |
| 225 | 225 | if g_d3d == nil { return } | |
| 226 | 226 | ||
| 227 | - | fb_entry := &g_d3d.framebuffers[desc.framebuffer] | |
| 228 | - | if !fb_entry.active { return } | |
| 227 | + | fb_entry, fb_ok := framebuffer_entry(desc.framebuffer) | |
| 228 | + | if !fb_ok { return } | |
| 229 | 229 | ||
| 230 | - | pass_entry := &g_d3d.render_passes[desc.pass] | |
| 231 | - | is_depth_only := pass_entry.active && pass_entry.desc.depth_only | |
| 230 | + | pass_entry, pass_ok := render_pass_entry(desc.pass) | |
| 231 | + | is_depth_only := pass_ok && pass_entry.desc.depth_only | |
| 232 | 232 | ||
| 233 | 233 | rtv_handle: d3d12.CPU_DESCRIPTOR_HANDLE | |
| 234 | 234 | has_rtv := false | |
| 235 | 235 | if fb_entry.color_tex != bk.NULL_TEXTURE { | |
| 236 | - | tex_entry := &g_d3d.textures[fb_entry.color_tex] | |
| 237 | - | if tex_entry.active && tex_entry.has_rtv { | |
| 236 | + | if tex_entry, tex_ok := texture_entry(fb_entry.color_tex); tex_ok && tex_entry.has_rtv { | |
| 238 | 237 | if tex_entry.state != {.RENDER_TARGET} { | |
| 239 | 238 | transition_resource(tex_entry.resource, tex_entry.state, {.RENDER_TARGET}) | |
| 240 | 239 | tex_entry.state = {.RENDER_TARGET} | |
| … | 7 unchanged lines hidden | ||
| 248 | 247 | dsv_handle: d3d12.CPU_DESCRIPTOR_HANDLE | |
| 249 | 248 | has_dsv := false | |
| 250 | 249 | if fb_entry.depth_tex != bk.NULL_TEXTURE { | |
| 251 | - | tex_entry := &g_d3d.textures[fb_entry.depth_tex] | |
| 252 | - | if tex_entry.active && tex_entry.has_dsv { | |
| 250 | + | if tex_entry, tex_ok := texture_entry(fb_entry.depth_tex); tex_ok && tex_entry.has_dsv { | |
| 253 | 251 | // Transition depth to DEPTH_WRITE | |
| 254 | 252 | if tex_entry.state != {.DEPTH_WRITE} { | |
| 255 | 253 | transition_resource(tex_entry.resource, tex_entry.state, {.DEPTH_WRITE}) | |
| … | 119 unchanged lines hidden | ||
Diff hidden because this file has more than 800 lines.