mirror of
https://github.com/redstrate/Physis.git
synced 2025-06-06 14:47:46 +00:00
Simplify shader reading
This commit is contained in:
parent
4709a3a3c4
commit
5002e4a590
1 changed files with 2 additions and 7 deletions
|
@ -63,14 +63,9 @@ pub struct Shader {
|
||||||
#[br(args { count: texture_count as usize, inner: ResourceParameterBinReadArgs { strings_offset }})]
|
#[br(args { count: texture_count as usize, inner: ResourceParameterBinReadArgs { strings_offset }})]
|
||||||
pub texture_parameters: Vec<ResourceParameter>,
|
pub texture_parameters: Vec<ResourceParameter>,
|
||||||
|
|
||||||
/// Additional data specific to the shader type
|
|
||||||
#[br(seek_before = SeekFrom::Start(shader_data_offset as u64 + data_offset as u64))]
|
|
||||||
#[br(count = if is_vertex { shader_data_offset } else { 0 } )]
|
|
||||||
#[br(restore_position)]
|
|
||||||
pub additional_data: Vec<u8>,
|
|
||||||
|
|
||||||
/// The HLSL bytecode of this shader. The DX level used varies.
|
/// The HLSL bytecode of this shader. The DX level used varies.
|
||||||
#[br(seek_before = SeekFrom::Start(shader_data_offset as u64 + data_offset as u64 + if is_vertex { 8 } else { 0 } ))]
|
// TODO: dx9 is 4, not 8
|
||||||
|
#[br(seek_before = SeekFrom::Start(shader_data_offset as u64 + data_offset as u64 + if is_vertex { 8 } else { 0 }))]
|
||||||
#[br(count = data_size)]
|
#[br(count = data_size)]
|
||||||
#[br(restore_position)]
|
#[br(restore_position)]
|
||||||
pub bytecode: Vec<u8>,
|
pub bytecode: Vec<u8>,
|
||||||
|
|
Loading…
Add table
Reference in a new issue