misc: tweaks
This commit is contained in:
parent
1ffdefd4e8
commit
f08098680a
5 changed files with 22 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
||||||
const WIDTH: i32 = 900;
|
const WIDTH: i32 = 1920;
|
||||||
const HEIGHT: i32 = 700;
|
const HEIGHT: i32 = 1080;
|
||||||
const TITLE: &str = "librashader DirectX 11";
|
const TITLE: &str = "librashader DirectX 11";
|
||||||
|
|
||||||
use windows::{
|
use windows::{
|
||||||
|
|
|
@ -103,20 +103,6 @@ impl LutTexture {
|
||||||
unsafe {
|
unsafe {
|
||||||
let handle = device.CreateTexture2D(&desc, None).unwrap();
|
let handle = device.CreateTexture2D(&desc, None).unwrap();
|
||||||
|
|
||||||
let srv = device.CreateShaderResourceView(
|
|
||||||
&handle,
|
|
||||||
Some(&D3D11_SHADER_RESOURCE_VIEW_DESC {
|
|
||||||
Format: desc.Format,
|
|
||||||
ViewDimension: D3D_SRV_DIMENSION_TEXTURE2D,
|
|
||||||
Anonymous: D3D11_SHADER_RESOURCE_VIEW_DESC_0 {
|
|
||||||
Texture2D: D3D11_TEX2D_SRV {
|
|
||||||
MostDetailedMip: 0,
|
|
||||||
MipLevels: u32::MAX,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
// need a staging texture to defer mipmap generation
|
// need a staging texture to defer mipmap generation
|
||||||
let staging = device.CreateTexture2D(
|
let staging = device.CreateTexture2D(
|
||||||
&D3D11_TEXTURE2D_DESC {
|
&D3D11_TEXTURE2D_DESC {
|
||||||
|
@ -155,6 +141,20 @@ impl LutTexture {
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let srv = device.CreateShaderResourceView(
|
||||||
|
&handle,
|
||||||
|
Some(&D3D11_SHADER_RESOURCE_VIEW_DESC {
|
||||||
|
Format: desc.Format,
|
||||||
|
ViewDimension: D3D_SRV_DIMENSION_TEXTURE2D,
|
||||||
|
Anonymous: D3D11_SHADER_RESOURCE_VIEW_DESC_0 {
|
||||||
|
Texture2D: D3D11_TEX2D_SRV {
|
||||||
|
MostDetailedMip: 0,
|
||||||
|
MipLevels: u32::MAX,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)?;
|
||||||
|
|
||||||
if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 {
|
if (desc.MiscFlags & D3D11_RESOURCE_MISC_GENERATE_MIPS).0 != 0 {
|
||||||
context.GenerateMips(&srv)
|
context.GenerateMips(&srv)
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,8 @@ use crate::gl::gl3::CompatibilityGL;
|
||||||
use crate::gl::{FramebufferInterface, GLInterface};
|
use crate::gl::{FramebufferInterface, GLInterface};
|
||||||
use crate::viewport::Viewport;
|
use crate::viewport::Viewport;
|
||||||
|
|
||||||
const WIDTH: u32 = 900;
|
const WIDTH: u32 = 1920;
|
||||||
const HEIGHT: u32 = 700;
|
const HEIGHT: u32 = 1080;
|
||||||
const TITLE: &str = "librashader OpenGL";
|
const TITLE: &str = "librashader OpenGL";
|
||||||
|
|
||||||
pub fn compile_program(vertex: &str, fragment: &str) -> GLuint {
|
pub fn compile_program(vertex: &str, fragment: &str) -> GLuint {
|
||||||
|
|
|
@ -13,8 +13,8 @@ use crate::gl::gl46::DirectStateAccessGL;
|
||||||
use crate::gl::{FramebufferInterface, GLInterface};
|
use crate::gl::{FramebufferInterface, GLInterface};
|
||||||
use crate::viewport::Viewport;
|
use crate::viewport::Viewport;
|
||||||
|
|
||||||
const WIDTH: u32 = 900;
|
const WIDTH: u32 = 1920;
|
||||||
const HEIGHT: u32 = 700;
|
const HEIGHT: u32 = 1080;
|
||||||
const TITLE: &str = "librashader OpenGL 4.6";
|
const TITLE: &str = "librashader OpenGL 4.6";
|
||||||
|
|
||||||
pub fn compile_program(vertex: &str, fragment: &str) -> GLuint {
|
pub fn compile_program(vertex: &str, fragment: &str) -> GLuint {
|
||||||
|
|
|
@ -47,7 +47,8 @@ mod tests {
|
||||||
fn triangle_gl46() {
|
fn triangle_gl46() {
|
||||||
let (glfw, window, events, shader, vao) = gl::gl46::hello_triangle::setup();
|
let (glfw, window, events, shader, vao) = gl::gl46::hello_triangle::setup();
|
||||||
let mut filter = FilterChainGL::load_from_path(
|
let mut filter = FilterChainGL::load_from_path(
|
||||||
"../test/slang-shaders/vhs/VHSPro.slangp",
|
// "../test/slang-shaders/vhs/VHSPro.slangp",
|
||||||
|
"../test/slang-shaders/border/gameboy-player/gameboy-player-crt-royale.slangp",
|
||||||
Some(&FilterChainOptionsGL {
|
Some(&FilterChainOptionsGL {
|
||||||
gl_version: 0,
|
gl_version: 0,
|
||||||
use_dsa: true,
|
use_dsa: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue