mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-05 23:43:04 +00:00
Resolve warnings
This commit is contained in:
parent
ccb3b08333
commit
eff2d891c5
3 changed files with 22 additions and 9 deletions
|
@ -23,7 +23,8 @@ namespace Ryujinx.Graphics.OpenGL.Effects
|
|||
public static uint CompileProgram(GL api, string[] shaders, ShaderType shaderType)
|
||||
{
|
||||
var shader = api.CreateShader(shaderType);
|
||||
api.ShaderSource(shader, (uint)shaders.Length, shaders, 0);
|
||||
var length = 0;
|
||||
api.ShaderSource(shader, (uint)shaders.Length, shaders, in length);
|
||||
api.CompileShader(shader);
|
||||
|
||||
var program = api.CreateProgram();
|
||||
|
|
|
@ -419,11 +419,13 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
{
|
||||
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
||||
{
|
||||
var indices = indexBaseOffset + quadIndex * 4 * indexElemSize;
|
||||
|
||||
_gd.Api.DrawElementsInstancedBaseVertexBaseInstance(
|
||||
PrimitiveType.TriangleFan,
|
||||
4,
|
||||
_elementsType,
|
||||
indexBaseOffset + quadIndex * 4 * indexElemSize,
|
||||
in indices,
|
||||
(uint)instanceCount,
|
||||
firstVertex,
|
||||
(uint)firstInstance);
|
||||
|
@ -433,11 +435,13 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
{
|
||||
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
||||
{
|
||||
var indices = indexBaseOffset + quadIndex * 4 * indexElemSize;
|
||||
|
||||
_gd.Api.DrawElementsInstancedBaseInstance(
|
||||
PrimitiveType.TriangleFan,
|
||||
4,
|
||||
_elementsType,
|
||||
indexBaseOffset + quadIndex * 4 * indexElemSize,
|
||||
in indices,
|
||||
(uint)instanceCount,
|
||||
(uint)firstInstance);
|
||||
}
|
||||
|
@ -446,11 +450,13 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
{
|
||||
for (int quadIndex = 0; quadIndex < quadsCount; quadIndex++)
|
||||
{
|
||||
var indices = indexBaseOffset + quadIndex * 4 * indexElemSize;
|
||||
|
||||
_gd.Api.DrawElementsInstanced(
|
||||
PrimitiveType.TriangleFan,
|
||||
4,
|
||||
_elementsType,
|
||||
indexBaseOffset + quadIndex * 4 * indexElemSize,
|
||||
in indices,
|
||||
(uint)instanceCount);
|
||||
}
|
||||
}
|
||||
|
@ -609,7 +615,8 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
|
||||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||
|
||||
_gd.Api.DrawElementsIndirect(_primitiveType, _elementsType, indirectBuffer.Offset);
|
||||
var offset = indirectBuffer.Offset;
|
||||
_gd.Api.DrawElementsIndirect(_primitiveType, _elementsType, in offset);
|
||||
|
||||
_vertexArray.RestoreIndexBuffer();
|
||||
|
||||
|
@ -631,10 +638,11 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||
_gd.Api.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToUInt32());
|
||||
|
||||
var offset = indirectBuffer.Offset;
|
||||
_gd.Api.MultiDrawElementsIndirectCount(
|
||||
_primitiveType,
|
||||
_elementsType,
|
||||
indirectBuffer.Offset,
|
||||
in offset,
|
||||
parameterBuffer.Offset,
|
||||
(uint)maxDrawCount,
|
||||
(uint)stride);
|
||||
|
@ -656,7 +664,8 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
|
||||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||
|
||||
_gd.Api.DrawArraysIndirect(_primitiveType, indirectBuffer.Offset);
|
||||
var offset = indirectBuffer.Offset;
|
||||
_gd.Api.DrawArraysIndirect(_primitiveType, in offset);
|
||||
|
||||
PostDraw();
|
||||
}
|
||||
|
@ -674,9 +683,10 @@ namespace Ryujinx.Graphics.OpenGL
|
|||
_gd.Api.BindBuffer(BufferTargetARB.DrawIndirectBuffer, indirectBuffer.Handle.ToUInt32());
|
||||
_gd.Api.BindBuffer(BufferTargetARB.ParameterBuffer, parameterBuffer.Handle.ToUInt32());
|
||||
|
||||
var offset = indirectBuffer.Offset;
|
||||
_gd.Api.MultiDrawArraysIndirectCount(
|
||||
_primitiveType,
|
||||
indirectBuffer.Offset,
|
||||
in offset,
|
||||
parameterBuffer.Offset,
|
||||
(uint)maxDrawCount,
|
||||
(uint)stride);
|
||||
|
|
|
@ -27,7 +27,9 @@ namespace Ryujinx.Graphics.OpenGL.Queries
|
|||
_type = type;
|
||||
|
||||
_api.BindBuffer(BufferTargetARB.QueryBuffer, _buffer);
|
||||
_api.BufferStorage(BufferStorageTarget.QueryBuffer, sizeof(long), DefaultValue, BufferStorageMask.MapReadBit | BufferStorageMask.MapWriteBit | BufferStorageMask.MapPersistentBit);
|
||||
|
||||
var defaultValue = DefaultValue;
|
||||
_api.BufferStorage(BufferStorageTarget.QueryBuffer, sizeof(long), in defaultValue, BufferStorageMask.MapReadBit | BufferStorageMask.MapWriteBit | BufferStorageMask.MapPersistentBit);
|
||||
|
||||
unsafe
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue