JBR-9177 Vulkan: Align jbr21 and main (Part 3)

Cleanup blit code.
This commit is contained in:
Nikita Gubarkov
2025-08-07 21:24:38 +02:00
parent ffebc3f087
commit 6f2fa19cde
4 changed files with 14 additions and 23 deletions

View File

@@ -24,22 +24,15 @@
* questions.
*/
#include <assert.h>
#include <string.h>
#include "jlong.h"
#include "VKUtil.h"
#include "VKBlitLoops.h"
#include "VKSurfaceData.h"
#include "VKRenderer.h"
#include "GraphicsPrimitiveMgr.h"
#include "Trace.h"
#include "VKImage.h"
#include "VKBuffer.h"
#include "VKImage.h"
#include "VKDevice.h"
#include "VKTexturePool.h"
#include "VKUtil.h"
#include "VKRenderer.h"
#include "VKSurfaceData.h"
#include "VKUtil.h"
#define SRCTYPE_BITS sun_java2d_vulkan_VKSwToSurfaceBlit_SRCTYPE_BITS
@@ -100,8 +93,7 @@ void VKBlitLoops_IsoBlit(VKSDOps* srcOps, jint filter,
jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2)
{
if (srcOps == NULL) {
J2dRlsTraceLn(J2D_TRACE_ERROR,
"VKBlitLoops_IsoBlit: srcOps is null")
J2dRlsTraceLn(J2D_TRACE_ERROR, "VKBlitLoops_IsoBlit: srcOps is null");
return;
}
@@ -147,7 +139,7 @@ static void VKBlitLoops_FindStageBufferMemoryType(VKMemoryRequirements* requirem
void VKBlitLoops_Blit(JNIEnv *env,
SurfaceDataOps* src,
jshort srctype, jint hint,
jshort srctype, jint filter,
jint sx1, jint sy1,
jint sx2, jint sy2,
jdouble dx1, jdouble dy1,
@@ -237,7 +229,7 @@ void VKBlitLoops_Blit(JNIEnv *env,
VKRenderer_RecordBarriers(device->renderer, NULL, NULL, &barrier, &barrierBatch);
}
VKRenderer_DrawImage(image, type.format, type.swizzle, hint, SAMPLER_WRAP_BORDER,
VKRenderer_DrawImage(image, type.format, type.swizzle, filter, SAMPLER_WRAP_BORDER,
0, 0, (float)sw, (float)sh, (float)dx1, (float)dy1, (float)dx2, (float)dy2);
VKRenderer_FlushMemory(context->surface, buffer.range);
@@ -258,7 +250,7 @@ void VKBlitLoops_Blit(JNIEnv *env,
*/
void
VKBlitLoops_SurfaceToSwBlit(JNIEnv *env,
VKSDOps* src, SurfaceDataOps* dst, jint dsttype,
VKSDOps* src, SurfaceDataOps* dst,
jint srcx, jint srcy, jint dstx, jint dsty,
jint width, jint height)
{

View File

@@ -28,10 +28,8 @@
#define VKBlitLoops_h_Included
#include "jni.h"
#include "sun_java2d_vulkan_VKBlitLoops.h"
#include "VKTypes.h"
#include "SurfaceData.h"
#include "VKTypes.h"
void VKBlitLoops_IsoBlit(VKSDOps* srcOps,
jint filter,
@@ -42,7 +40,7 @@ void VKBlitLoops_IsoBlit(VKSDOps* srcOps,
void VKBlitLoops_Blit(JNIEnv *env,
SurfaceDataOps* src,
jshort srctype, jint hint,
jshort srctype, jint filter,
jint sx1, jint sy1,
jint sx2, jint sy2,
jdouble dx1, jdouble dy1,
@@ -50,7 +48,7 @@ void VKBlitLoops_Blit(JNIEnv *env,
void
VKBlitLoops_SurfaceToSwBlit(JNIEnv *env,
VKSDOps* src, SurfaceDataOps* dst, jint dsttype,
VKSDOps* src, SurfaceDataOps* dst,
jint srcx, jint srcy, jint dstx, jint dsty,
jint width, jint height);

View File

@@ -27,7 +27,8 @@
#ifndef VKBuffer_h_Included
#define VKBuffer_h_Included
#include "VKTypes.h"
#include "VKAllocator.h"
#include "VKUtil.h"
struct VKBuffer {
VkBuffer handle;

View File

@@ -378,7 +378,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_vulkan_VKRenderQueue_flushBuffer
J2dRlsTraceLn8(J2D_TRACE_VERBOSE,
"VKRenderQueue_flushBuffer: SURFACE_TO_SW_BLIT (%p) (%d %d %d %d) -> (%p) (%d %d)",
src, sx, sy, w, h, dst, dx, dy);
VKBlitLoops_SurfaceToSwBlit(env, src, dst, dsttype, sx, sy, dx, dy, w, h);
VKBlitLoops_SurfaceToSwBlit(env, src, dst, sx, sy, dx, dy, w, h);
}
break;
case sun_java2d_pipe_BufferedOpCodes_MASK_FILL: