-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Postshader: Let shaders use the previous frame #14528
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5abec6c
Font: Prevent a crash on invalid data.
unknownbrackets 44d2d8a
Draw: Assert sampler bindings are in valid ranges.
unknownbrackets 1ca1a8b
Postshader: Correct sampler binding translation.
unknownbrackets 7bbaae4
Postshader: Let shaders use the previous frame.
unknownbrackets 17071e7
Postshader: Add uniform for delta since last frame.
unknownbrackets 7f81444
Draw: Use constants for texture slots.
unknownbrackets File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Draw: Assert sampler bindings are in valid ranges.
- Loading branch information
commit 44d2d8a2a3f04acd63431fe89a5e7f2c2afbe9dd
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ | |
|
||
namespace Draw { | ||
|
||
static constexpr int MAX_BOUND_TEXTURES = 8; | ||
|
||
// A problem is that we can't get the D3Dcompiler.dll without using a later SDK than 7.1, which was the last that | ||
// supported XP. A possible solution might be here: | ||
// https://tedwvc.wordpress.com/2014/01/01/how-to-target-xp-with-vc2012-or-vc2013-and-continue-to-use-the-windows-8-x-sdk/ | ||
|
@@ -1162,6 +1164,7 @@ void D3D11DrawContext::UpdateBuffer(Buffer *buffer, const uint8_t *data, size_t | |
} | ||
|
||
void D3D11DrawContext::BindVertexBuffers(int start, int count, Buffer **buffers, int *offsets) { | ||
_assert_(start + count <= ARRAY_SIZE(nextVertexBuffers_)); | ||
// Lazy application | ||
for (int i = 0; i < count; i++) { | ||
D3D11Buffer *buf = (D3D11Buffer *)buffers[i]; | ||
|
@@ -1329,6 +1332,7 @@ Framebuffer *D3D11DrawContext::CreateFramebuffer(const FramebufferDesc &desc) { | |
void D3D11DrawContext::BindTextures(int start, int count, Texture **textures) { | ||
// Collect the resource views from the textures. | ||
ID3D11ShaderResourceView *views[8]; | ||
_assert_(start + count <= ARRAY_SIZE(views)); | ||
for (int i = 0; i < count; i++) { | ||
D3D11Texture *tex = (D3D11Texture *)textures[i]; | ||
views[i] = tex ? tex->view : nullptr; | ||
|
@@ -1338,6 +1342,7 @@ void D3D11DrawContext::BindTextures(int start, int count, Texture **textures) { | |
|
||
void D3D11DrawContext::BindSamplerStates(int start, int count, SamplerState **states) { | ||
ID3D11SamplerState *samplers[8]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same |
||
_assert_(start + count <= ARRAY_SIZE(samplers)); | ||
for (int i = 0; i < count; i++) { | ||
D3D11SamplerState *samp = (D3D11SamplerState *)states[i]; | ||
samplers[i] = samp->ss; | ||
|
@@ -1613,6 +1618,7 @@ void D3D11DrawContext::BindFramebufferAsRenderTarget(Framebuffer *fbo, const Ren | |
} | ||
|
||
void D3D11DrawContext::BindFramebufferAsTexture(Framebuffer *fbo, int binding, FBChannel channelBit, int attachment) { | ||
_assert_(binding < MAX_BOUND_TEXTURES); | ||
D3D11Framebuffer *fb = (D3D11Framebuffer *)fbo; | ||
switch (channelBit) { | ||
case FBChannel::FB_COLOR_BIT: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might as well change this array length to MAX_BOUND_TEXTURES since you're here poking around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, agreed. Went ahead and cleaned up some other GL checks in Draw too along the same lines.
-[Unknown]