Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple attachment and multisample textures is broken and lacks robustness #20

Open
chaoticbob opened this issue Sep 27, 2020 · 1 comment

Comments

@chaoticbob
Copy link
Owner

Issue stemming from #18

I looked at this a bit more and it seems like the move here maybe to better align TR's API with how DX works with multiple sample images. I played around with some changes which I'll put up on a branch later today.

High level list of changes:

  • Added attachment parameter to tr_cmd_render_target_transition
  • Added tr_cmd_resolve_image to resolve a single texture uses the format from single sample texture (not sure if this is the best thing)
  • Added tr_cmd_resolve_render_target to resolve all attachments assuming their states are the same
  • Removed the automatic resolve in tr_internal_dx_cmd_end_render

Here's what the function signatures look like:

tr_api_export void tr_cmd_render_target_transition(tr_cmd* p_cmd, tr_render_target* p_render_target, uint32_t attachment_index, tr_texture_usage old_usage, tr_texture_usage new_usage);

tr_api_export void tr_cmd_resolve_image(tr_cmd* p_cmd, tr_texture* p_src_texture, tr_texture_usage src_current_usage, tr_texture_usage src_final_usage, tr_texture* p_dst_texture, tr_texture_usage dst_current_usage, tr_texture_usage dst_final_usage);

tr_api_export void tr_cmd_resolve_render_target(tr_cmd* p_cmd, tr_render_target* p_render_target, tr_texture_usage ms_current_usage, tr_texture_usage ms_final_usage, tr_texture_usage ss_current_usage, tr_texture_usage ss_final_usage);

Let me know what you think.

@inequation
Copy link
Contributor

Sorry for taking so long to respond! That looks great, thank you. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants