Skip to content

Commit

Permalink
Kick out hardcoded texture sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 17, 2024
1 parent 17b2ad7 commit ec9a93a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ void kope_d3d12_command_list_begin_render_pass(kope_g5_command_list *list, const

render_target_views[render_target_index] = rtv;

scissors[render_target_index] = {0, 0, 1024, 768};
viewports[render_target_index] = {0.0f, 0.0f, 1024.0f, 768.0f, 0.0f, 1.0f};
scissors[render_target_index] = {0, 0, (LONG)render_target->d3d12.width, (LONG)render_target->d3d12.height};
viewports[render_target_index] = {0.0f, 0.0f, (FLOAT)render_target->d3d12.width, (FLOAT)render_target->d3d12.height, 0.0f, 1.0f};
}

list->d3d12.list->OMSetRenderTargets((UINT)parameters->color_attachments_count, render_target_views, true, nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ void kope_d3d12_device_create_texture(kope_g5_device *device, const kope_g5_text
texture->d3d12.resource_state = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
texture->d3d12.format = format;

texture->d3d12.width = parameters->width;
texture->d3d12.height = parameters->height;

texture->d3d12.in_flight_frame_index = 0;

create_texture_views(device, parameters, texture);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ extern "C" {
typedef struct kope_d3d12_texture {
struct ID3D12Resource *resource;

uint32_t width;
uint32_t height;

uint32_t rtv_index;
uint32_t dsv_index;

Expand Down

0 comments on commit ec9a93a

Please sign in to comment.