Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glsl-in: Texture builtins fixes #1719

Merged
merged 1 commit into from
Feb 10, 2022
Merged

Conversation

JCapucho
Copy link
Collaborator

@JCapucho JCapucho commented Feb 6, 2022

This one grew out of hand quick. Initially it was just replacing the bit
loops with a function driving the declarations to make the code sharing
better and support different scalar kinds.

Now it includes a lot of fixes:

  • textureSize now also returns the array layers as the last component
    on the return (only for arrayed textures)
  • textureSize now supports multisampled textures
  • the texture family of functions now consumes a vec3 coordinate
    vector for all 1D shadow textures
  • Shadow textures can use the bias version of texture functions
    (temporarily disabled since naga doesn't support it)
  • 3D textures can be used in textureProj
  • sampler2DArrayShadow can't be used in textureLod or in texture with bias
  • Cube textures cannot be used with offsets

Updates the tests to cover all functions

Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work!
A few minor comments from me here

src/front/glsl/builtins.rs Outdated Show resolved Hide resolved
src/front/glsl/builtins.rs Outdated Show resolved Hide resolved
tests/in/glsl/samplers.frag Show resolved Hide resolved
This one grew out of hand quick. Initially it was just replacing the bit
loops with a function driving the declarations to make the code sharing
better and support different scalar kinds.

Now it includes a lot of fixes:
- `textureSize` now also returns the array layers as the last component
  on the return (only for arrayed textures)
- `textureSize` now supports multisampled textures
- the `texture` family of functions now consumes a `vec3` coordinate
  vector for all 1D shadow textures
- Shadow textures can use the bias version of `texture` functions
  (temporarily disabled since naga doesn't support it)
- 3D textures can be used in `textureProj`
- `sampler2DArrayShadow` can't be used in `textureLod` or in `texture` with bias
- Cube textures cannot be used with offsets

Updates the tests to cover all functions
@JCapucho JCapucho requested a review from kvark February 8, 2022 16:33
@kvark kvark merged commit 1f14f7e into gfx-rs:master Feb 10, 2022
@JCapucho JCapucho deleted the glsl-texture-fixes branch February 19, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants