some tweaks
parent
35684df005
commit
7386952974
|
@ -183,6 +183,41 @@ public class CopyPass
|
|||
);
|
||||
}
|
||||
|
||||
public void DownloadFromBuffer(
|
||||
GpuBuffer buffer,
|
||||
TransferBuffer transferBuffer,
|
||||
in BufferCopy copyParams
|
||||
) {
|
||||
#if DEBUG
|
||||
AssertBufferBoundsCheck(buffer.Size, copyParams.SrcOffset, copyParams.Size);
|
||||
AssertBufferBoundsCheck(transferBuffer.Size, copyParams.DstOffset, copyParams.Size);
|
||||
#endif
|
||||
|
||||
Refresh.Refresh_DownloadFromBuffer(
|
||||
Handle,
|
||||
buffer.Handle,
|
||||
transferBuffer.Handle,
|
||||
copyParams.ToRefresh()
|
||||
);
|
||||
}
|
||||
|
||||
public void DownloadFromTexture(
|
||||
in TextureRegion textureRegion,
|
||||
TransferBuffer transferBuffer,
|
||||
in BufferImageCopy copyParams
|
||||
) {
|
||||
#if DEBUG
|
||||
AssertBufferBoundsCheck(transferBuffer.Size, copyParams.BufferOffset, textureRegion.Size);
|
||||
#endif
|
||||
|
||||
Refresh.Refresh_DownloadFromTexture(
|
||||
Handle,
|
||||
textureRegion.ToRefresh(),
|
||||
transferBuffer.Handle,
|
||||
copyParams.ToRefresh()
|
||||
);
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
private void AssertBufferBoundsCheck(uint bufferLengthInBytes, uint offsetInBytes, uint copyLengthInBytes)
|
||||
{
|
||||
|
|
|
@ -139,7 +139,7 @@ namespace MoonWorks.Graphics.Font
|
|||
// Call this AFTER binding your text pipeline!
|
||||
public void Render(RenderPass renderPass, Math.Float.Matrix4x4 transformMatrix)
|
||||
{
|
||||
renderPass.BindFragmentSamplers(new TextureSamplerBinding(
|
||||
renderPass.BindFragmentSampler(new TextureSamplerBinding(
|
||||
CurrentFont.Texture,
|
||||
GraphicsDevice.LinearSampler
|
||||
));
|
||||
|
|
|
@ -896,28 +896,28 @@ public readonly record struct TextureSamplerBinding(
|
|||
|
||||
public readonly record struct StorageBufferReadWriteBinding(
|
||||
GpuBuffer Buffer,
|
||||
bool cycle
|
||||
bool Cycle
|
||||
) {
|
||||
public Refresh.StorageBufferReadWriteBinding ToRefresh()
|
||||
{
|
||||
return new Refresh.StorageBufferReadWriteBinding
|
||||
{
|
||||
Buffer = Buffer.Handle,
|
||||
Cycle = Conversions.BoolToInt(cycle)
|
||||
Cycle = Conversions.BoolToInt(Cycle)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public readonly record struct StorageTextureReadWriteBinding(
|
||||
in TextureSlice TextureSlice,
|
||||
bool cycle
|
||||
bool Cycle
|
||||
) {
|
||||
public Refresh.StorageTextureReadWriteBinding ToRefresh()
|
||||
{
|
||||
return new Refresh.StorageTextureReadWriteBinding
|
||||
{
|
||||
TextureSlice = TextureSlice.ToRefresh(),
|
||||
Cycle = Conversions.BoolToInt(cycle)
|
||||
Cycle = Conversions.BoolToInt(Cycle)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ public class RenderPass
|
|||
);
|
||||
}
|
||||
|
||||
public unsafe void BindFragmentSamplers(
|
||||
public unsafe void BindFragmentSampler(
|
||||
in TextureSamplerBinding textureSamplerBinding,
|
||||
uint slot = 0
|
||||
) {
|
||||
|
|
|
@ -301,9 +301,9 @@ namespace MoonWorks.Video
|
|||
);
|
||||
|
||||
renderPass.BindGraphicsPipeline(Device.VideoPipeline);
|
||||
renderPass.BindFragmentSamplers(new TextureSamplerBinding(yTexture, LinearSampler), 0);
|
||||
renderPass.BindFragmentSamplers(new TextureSamplerBinding(uTexture, LinearSampler), 1);
|
||||
renderPass.BindFragmentSamplers(new TextureSamplerBinding(vTexture, LinearSampler), 2);
|
||||
renderPass.BindFragmentSampler(new TextureSamplerBinding(yTexture, LinearSampler), 0);
|
||||
renderPass.BindFragmentSampler(new TextureSamplerBinding(uTexture, LinearSampler), 1);
|
||||
renderPass.BindFragmentSampler(new TextureSamplerBinding(vTexture, LinearSampler), 2);
|
||||
renderPass.DrawPrimitives(0, 1);
|
||||
|
||||
commandBuffer.EndRenderPass(renderPass);
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
uint windowWidth,
|
||||
uint windowHeight,
|
||||
ScreenMode screenMode,
|
||||
Graphics.SwapchainComposition swapchainComposition,
|
||||
Graphics.PresentMode presentMode,
|
||||
bool systemResizable = false,
|
||||
bool startMaximized = false
|
||||
|
@ -51,6 +52,7 @@
|
|||
WindowWidth = windowWidth;
|
||||
WindowHeight = windowHeight;
|
||||
ScreenMode = screenMode;
|
||||
SwapchainComposition = swapchainComposition;
|
||||
PresentMode = presentMode;
|
||||
SystemResizable = systemResizable;
|
||||
StartMaximized = startMaximized;
|
||||
|
|
Loading…
Reference in New Issue