Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aclysma committed Aug 4, 2024
1 parent 7adf876 commit 19ceb4d
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 25 deletions.
2 changes: 1 addition & 1 deletion rafx-api/src/backends/dx12/internal/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub fn blend_state_blend_state_desc(
|| def.src_factor_alpha != RafxBlendFactor::One
|| def.dst_factor_alpha != RafxBlendFactor::Zero;

let mut desc = &mut blend_desc.RenderTarget[attachment_index as usize];
let desc = &mut blend_desc.RenderTarget[attachment_index as usize];
desc.BlendEnable = blend_enable.into();
desc.RenderTargetWriteMask = def.masks.bits();
desc.BlendOp = def.blend_op.into();
Expand Down
7 changes: 1 addition & 6 deletions rafx-api/src/backends/dx12/internal/mipmap_resources.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
use super::d3d12;
use crate::dx12::RafxDeviceContextDx12;
use crate::{
RafxComputePipelineDef, RafxImmutableSamplerKey, RafxImmutableSamplers, RafxPipeline,
RafxResourceType, RafxResult, RafxRootSignature, RafxRootSignatureDef, RafxSampler,
RafxSamplerDef, RafxShader, RafxShaderModule, RafxShaderModuleDefDx12, RafxShaderResource,
RafxShaderStageDef, RafxShaderStageFlags, RafxShaderStageReflection,
};
use crate::RafxResult;

pub struct Dx12MipmapResources {
//pub shader: RafxShader,
Expand Down
2 changes: 1 addition & 1 deletion rafx-api/src/backends/dx12/root_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ impl RafxRootSignatureDx12 {
root_sig_string.GetBufferPointer() as *const u8,
root_sig_string.GetBufferSize(),
);
let str = String::from_utf8_lossy(sig_string);
//let str = String::from_utf8_lossy(sig_string);
//println!("root sig {}", str);

device_context
Expand Down
8 changes: 4 additions & 4 deletions rafx-api/src/backends/dx12/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ impl RafxTextureDx12 {
Flags: d3d12::D3D12_RESOURCE_FLAG_NONE,
};

let mut resource_states = RafxResourceState::UNDEFINED;
let resource_states = RafxResourceState::UNDEFINED;

if create_uav_chain {
desc.Flags |= d3d12::D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
Expand Down Expand Up @@ -891,7 +891,7 @@ impl RafxTextureDx12 {
if create_uav_chain {
srv_uav_handle_count += texture_def.mip_count;
}
let mut resource_desc = unsafe { image.image.GetDesc() };
let resource_desc = unsafe { image.image.GetDesc() };

let is_cube_map = texture_def
.resource_type
Expand Down Expand Up @@ -1047,8 +1047,8 @@ impl RafxTextureDx12 {
next_dsv_handle = Some(next_dsv_handle.unwrap().add_offset(1));
}

let mut first_rtv_slice = next_rtv_handle;
let mut first_dsv_slice = next_dsv_handle;
let first_rtv_slice = next_rtv_handle;
let first_dsv_slice = next_dsv_handle;

for mip_level in 0..texture_def.mip_count {
if texture_def
Expand Down
3 changes: 1 addition & 2 deletions rafx-api/src/extra/indirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ impl<'a> RafxIndexedIndirectCommandEncoder<'a> {
unsafe {
#[cfg(feature = "rafx-dx12")]
if self.is_dx12 {
let mut ptr =
self.mapped_memory as *mut RafxDrawIndexedIndirectCommandWithPushConstant;
let ptr = self.mapped_memory as *mut RafxDrawIndexedIndirectCommandWithPushConstant;
let push_constant = command.first_instance;
*ptr.add(index) = RafxDrawIndexedIndirectCommandWithPushConstant {
command,
Expand Down
6 changes: 3 additions & 3 deletions rafx-api/src/types/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,14 +922,14 @@ impl From<DxgiCommon::DXGI_FORMAT> for RafxFormat {
// DxgiCommon::B10G11R11_UFLOAT_PACK32 => RafxFormat::B10G11R11_UFLOAT_PACK32,
// DxgiCommon::E5B9G9R9_UFLOAT_PACK32 => RafxFormat::E5B9G9R9_UFLOAT_PACK32,
DxgiCommon::DXGI_FORMAT_D16_UNORM => RafxFormat::D16_UNORM,
DxgiCommon::DXGI_FORMAT_D24_UNORM_S8_UINT => RafxFormat::X8_D24_UNORM_PACK32,
//DxgiCommon::DXGI_FORMAT_D24_UNORM_S8_UINT => RafxFormat::X8_D24_UNORM_PACK32,
DxgiCommon::DXGI_FORMAT_D32_FLOAT => RafxFormat::D32_SFLOAT,
// DxgiCommon::S8_UINT => RafxFormat::S8_UINT,
// DxgiCommon::D16_UNORM_S8_UINT => RafxFormat::D16_UNORM_S8_UINT,
DxgiCommon::DXGI_FORMAT_D24_UNORM_S8_UINT => RafxFormat::D24_UNORM_S8_UINT,
DxgiCommon::DXGI_FORMAT_D32_FLOAT_S8X24_UINT => RafxFormat::D32_SFLOAT_S8_UINT,
DxgiCommon::DXGI_FORMAT_BC1_UNORM => RafxFormat::BC1_RGB_UNORM_BLOCK,
DxgiCommon::DXGI_FORMAT_BC1_UNORM_SRGB => RafxFormat::BC1_RGB_SRGB_BLOCK,
//DxgiCommon::DXGI_FORMAT_BC1_UNORM => RafxFormat::BC1_RGB_UNORM_BLOCK,
//DxgiCommon::DXGI_FORMAT_BC1_UNORM_SRGB => RafxFormat::BC1_RGB_SRGB_BLOCK,
DxgiCommon::DXGI_FORMAT_BC1_UNORM => RafxFormat::BC1_RGBA_UNORM_BLOCK,
DxgiCommon::DXGI_FORMAT_BC1_UNORM_SRGB => RafxFormat::BC1_RGBA_SRGB_BLOCK,
DxgiCommon::DXGI_FORMAT_BC2_UNORM => RafxFormat::BC2_UNORM_BLOCK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl JobProcessor for MaterialJobProcessor {
|handle_factory| {
//let shader_module = job_system::make_handle_to_default_artifact(job_api, shader_module);
let mut passes = Vec::default();
for pass_entry in asset_data.passes().resolve_entries()?.into_iter() {
for pass_entry in &asset_data.passes().resolve_entries()? {
let pass_entry = asset_data.passes().entry(*pass_entry);

let fixed_function_state =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ impl JobProcessor for MaterialInstanceJobProcessor {
handle_factory.make_handle_to_default_artifact(asset_data.material().get()?);

let mut slot_assignments = Vec::default();
for slot_assignent_entry in
asset_data.slot_assignments().resolve_entries()?.into_iter()
{
for slot_assignent_entry in &asset_data.slot_assignments().resolve_entries()? {
let slot_assignment =
asset_data.slot_assignments().entry(*slot_assignent_entry);

Expand Down
4 changes: 2 additions & 2 deletions rafx-assets/src/assets/image/builder_compressed_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ impl JobProcessor for GpuCompressedImageJobProcessor {
})
} else {
let mut layers = Vec::default();
for &layer_entry in layer_entries.into_iter() {
for &layer_entry in &layer_entries {
let layer = imported_data.data_layers().entry(layer_entry);
let mip_level_entries = layer.mip_levels().resolve_entries()?;
let mut mip_levels = Vec::default();
for &mip_level_entry in mip_level_entries.into_iter() {
for &mip_level_entry in &mip_level_entries {
let mip_level = layer.mip_levels().entry(mip_level_entry);
mip_levels.push(ImageAssetDataMipLevel {
width: mip_level.width().get()?,
Expand Down
2 changes: 0 additions & 2 deletions rafx-base/src/trust_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use std::prelude::v1::*;

#[cfg(feature = "std")]
use std::error::Error;

use std::{
Expand Down Expand Up @@ -46,7 +45,6 @@ impl Display for InvalidBorrow {
}
}

#[cfg(feature = "std")]
impl Error for InvalidBorrow {
fn description(&self) -> &str {
"This error is returned when you try to borrow immutably when it's already \
Expand Down

0 comments on commit 19ceb4d

Please sign in to comment.