d3d12: sketch out mipmap gen
This commit is contained in:
parent
56538dbfbf
commit
8bb02d31e9
44
librashader-runtime-d3d12/Cargo.toml
Normal file
44
librashader-runtime-d3d12/Cargo.toml
Normal file
|
@ -0,0 +1,44 @@
|
|||
[package]
|
||||
name = "librashader-runtime-d3d12"
|
||||
edition = "2021"
|
||||
|
||||
license = "MPL-2.0 OR GPL-3.0-only"
|
||||
version = "0.1.0-beta.8"
|
||||
authors = ["Ronny Chan <ronny@ronnychan.ca>"]
|
||||
repository = "https://github.com/SnowflakePowered/librashader"
|
||||
readme = "../README.md"
|
||||
categories = ["emulators", "compilers", "graphics"]
|
||||
keywords = ["shader", "retroarch", "SPIR-V"]
|
||||
description = "RetroArch shaders for all."
|
||||
|
||||
[dependencies]
|
||||
librashader-common = { path = "../librashader-common", features = ["d3d12"], version = "0.1.0-beta.8" }
|
||||
librashader-presets = { path = "../librashader-presets", version = "0.1.0-beta.8" }
|
||||
librashader-preprocess = { path = "../librashader-preprocess", version = "0.1.0-beta.8" }
|
||||
librashader-reflect = { path = "../librashader-reflect", version = "0.1.0-beta.8", features = ["standalone"] }
|
||||
librashader-runtime = { path = "../librashader-runtime", version = "0.1.0-beta.8" }
|
||||
thiserror = "1.0.37"
|
||||
spirv_cross = { package = "librashader-spirv-cross", version = "0.23" }
|
||||
|
||||
rustc-hash = "1.1.0"
|
||||
bytemuck = "1.12.3"
|
||||
array-init = "2.1.0"
|
||||
bit-set = "0.5.3"
|
||||
|
||||
[target.'cfg(windows)'.dependencies.windows]
|
||||
version = "0.44.0"
|
||||
features = [
|
||||
"Win32_Foundation",
|
||||
"Win32_Graphics_Dxgi_Common",
|
||||
"Win32_Graphics_Direct3D",
|
||||
"Win32_Graphics_Direct3D12",
|
||||
"Win32_Graphics_Direct3D_Fxc",
|
||||
"Win32_Graphics_Gdi",
|
||||
"Win32_Security",
|
||||
"Win32_System_LibraryLoader",
|
||||
"Win32_System_Threading",
|
||||
"Win32_System_WindowsProgramming",
|
||||
"Win32_UI_WindowsAndMessaging",
|
||||
]
|
||||
[dev-dependencies]
|
||||
gfx-maths = "0.2.8"
|
|
@ -85,6 +85,8 @@ struct D3D12DescriptorHeapInner {
|
|||
//
|
||||
// 0 - Occupied
|
||||
// 1 - free
|
||||
|
||||
// todo: actually use a bitset here.
|
||||
map: Box<[bool]>,
|
||||
}
|
||||
|
||||
|
|
29
librashader-runtime-d3d12/src/lib.rs
Normal file
29
librashader-runtime-d3d12/src/lib.rs
Normal file
|
@ -0,0 +1,29 @@
|
|||
#![feature(const_trait_impl)]
|
||||
#![feature(let_chains)]
|
||||
|
||||
mod error;
|
||||
mod filter_chain;
|
||||
mod heap;
|
||||
mod hello_triangle;
|
||||
mod samplers;
|
||||
mod texture;
|
||||
mod util;
|
||||
mod mipmap;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::hello_triangle::{DXSample, SampleCommandLine};
|
||||
|
||||
#[test]
|
||||
fn triangle_d3d12() {
|
||||
let sample = hello_triangle::d3d12_hello_triangle::Sample::new(
|
||||
"../test/slang-shaders/border/gameboy-player/gameboy-player-crt-royale.slangp",
|
||||
&SampleCommandLine {
|
||||
use_warp_device: false,
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
hello_triangle::main(sample).unwrap()
|
||||
}
|
||||
}
|
19
librashader-runtime-d3d12/src/mipmap.rs
Normal file
19
librashader-runtime-d3d12/src/mipmap.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
use windows::Win32::Graphics::Direct3D12::{D3D12_GPU_DESCRIPTOR_HANDLE, ID3D12Device, ID3D12PipelineState, ID3D12RootSignature};
|
||||
use librashader_common::Size;
|
||||
use crate::error;
|
||||
|
||||
pub struct D3D12MipmapGen {
|
||||
device: ID3D12Device,
|
||||
root_signature: ID3D12RootSignature,
|
||||
pipeline: ID3D12PipelineState,
|
||||
}
|
||||
|
||||
impl D3D12MipmapGen {
|
||||
pub fn new(device: &ID3D12Device) -> error::Result<D3D12MipmapGen> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn generate_mipmaps(miplevels: u16, size: Size<u32>, handle: D3D12_GPU_DESCRIPTOR_HANDLE) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue