Skip to content

Commit

Permalink
DX11 add settings initialization when creating from existing textures.
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Klingensmith <[email protected]>
  • Loading branch information
Nick Klingensmith committed Sep 26, 2024
1 parent 675b8d7 commit ab2452d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sk_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,7 @@ skg_tex_t skg_tex_create_from_existing(void *native_tex, skg_tex_type_ type, skg
result.mips = color_desc.MipLevels > 1 ? skg_mip_generate : skg_mip_none;
result.format = override_format != 0 ? override_format : skg_tex_fmt_from_native(color_desc.Format);
skg_tex_make_view(&result, color_desc.MipLevels, -1, color_desc.BindFlags & D3D11_BIND_SHADER_RESOURCE);
skg_tex_settings (&result, skg_tex_address_repeat, skg_tex_sample_linear, 0);

return result;
}
Expand All @@ -2045,6 +2046,7 @@ skg_tex_t skg_tex_create_from_layer(void *native_tex, skg_tex_type_ type, skg_te
result.multisample = color_desc.SampleDesc.Count;
result.format = override_format != 0 ? override_format : skg_tex_fmt_from_native(color_desc.Format);
skg_tex_make_view(&result, color_desc.MipLevels, array_layer, color_desc.BindFlags & D3D11_BIND_SHADER_RESOURCE);
skg_tex_settings (&result, skg_tex_address_repeat, skg_tex_sample_linear, 0);

return result;
}
Expand Down
2 changes: 2 additions & 0 deletions src/sk_gpu_dx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,7 @@ skg_tex_t skg_tex_create_from_existing(void *native_tex, skg_tex_type_ type, skg
result.mips = color_desc.MipLevels > 1 ? skg_mip_generate : skg_mip_none;
result.format = override_format != 0 ? override_format : skg_tex_fmt_from_native(color_desc.Format);
skg_tex_make_view(&result, color_desc.MipLevels, -1, color_desc.BindFlags & D3D11_BIND_SHADER_RESOURCE);
skg_tex_settings (&result, skg_tex_address_repeat, skg_tex_sample_linear, 0);

return result;
}
Expand All @@ -1212,6 +1213,7 @@ skg_tex_t skg_tex_create_from_layer(void *native_tex, skg_tex_type_ type, skg_te
result.multisample = color_desc.SampleDesc.Count;
result.format = override_format != 0 ? override_format : skg_tex_fmt_from_native(color_desc.Format);
skg_tex_make_view(&result, color_desc.MipLevels, array_layer, color_desc.BindFlags & D3D11_BIND_SHADER_RESOURCE);
skg_tex_settings (&result, skg_tex_address_repeat, skg_tex_sample_linear, 0);

return result;
}
Expand Down

0 comments on commit ab2452d

Please sign in to comment.