mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
glsl-out: make the cs adjustment to also flip Y
This commit is contained in:
@@ -130,7 +130,7 @@ bitflags::bitflags! {
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
|
||||
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
|
||||
pub struct WriterFlags: u32 {
|
||||
/// Extend output Z from (0,1) to (-1,1).
|
||||
/// Flip output Y and extend Z from (0,1) to (-1,1).
|
||||
const ADJUST_COORDINATE_SPACE = 0x1;
|
||||
/// Supports GL_EXT_texture_shadow_lod on the host, which provides
|
||||
/// additional functions on shadows and arrays of shadows.
|
||||
@@ -1520,7 +1520,7 @@ impl<'a, W: Write> Writer<'a, W> {
|
||||
{
|
||||
writeln!(
|
||||
self.out,
|
||||
"gl_Position.z = gl_Position.z * 2.0 - gl_Position.w;",
|
||||
"gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w);",
|
||||
)?;
|
||||
write!(self.out, "{}", INDENT.repeat(indent))?;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ void main() {
|
||||
type10 _tmp_return = type10(_expr10, _expr11, _expr12, _expr13, _expr14);
|
||||
_vs2fs_location0 = _tmp_return.member;
|
||||
gl_Position = _tmp_return.gen_gl_Position;
|
||||
gl_Position.z = gl_Position.z * 2.0 - gl_Position.w;
|
||||
gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ void main() {
|
||||
VertexOutput _tmp_return = VertexOutput(uv, vec4((1.2 * pos), 0.0, 1.0));
|
||||
_vs2fs_location0 = _tmp_return.uv;
|
||||
gl_Position = _tmp_return.position;
|
||||
gl_Position.z = gl_Position.z * 2.0 - gl_Position.w;
|
||||
gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user